You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ga...@apache.org on 2022/09/28 03:52:52 UTC
[flink] branch release-1.16 updated: [hotfix] Show paramter for templated tests with junit5
This is an automated email from the ASF dual-hosted git repository.
gaoyunhaii pushed a commit to branch release-1.16
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.16 by this push:
new d2ab2896c3e [hotfix] Show paramter for templated tests with junit5
d2ab2896c3e is described below
commit d2ab2896c3e0a00d60805371d5c95dbe5dff40db
Author: Yun Gao <ga...@gmail.com>
AuthorDate: Mon Sep 26 23:36:19 2022 +0800
[hotfix] Show paramter for templated tests with junit5
---
.../java/org/apache/flink/util/TestLoggerExtension.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/util/TestLoggerExtension.java b/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/util/TestLoggerExtension.java
index ba5c7763c9e..82595b5a9fb 100644
--- a/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/util/TestLoggerExtension.java
+++ b/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/util/TestLoggerExtension.java
@@ -35,30 +35,33 @@ public class TestLoggerExtension implements TestWatcher, BeforeEachCallback {
public void beforeEach(ExtensionContext context) {
LOG.info(
"\n================================================================================"
- + "\nTest {}.{} is running."
+ + "\nTest {}.{}[{}] is running."
+ "\n--------------------------------------------------------------------------------",
context.getRequiredTestClass().getCanonicalName(),
- context.getRequiredTestMethod().getName());
+ context.getRequiredTestMethod().getName(),
+ context.getDisplayName());
}
@Override
public void testSuccessful(ExtensionContext context) {
LOG.info(
"\n--------------------------------------------------------------------------------"
- + "\nTest {}.{} successfully run."
+ + "\nTest {}.{}[{}] successfully run."
+ "\n================================================================================",
context.getRequiredTestClass().getCanonicalName(),
- context.getRequiredTestMethod().getName());
+ context.getRequiredTestMethod().getName(),
+ context.getDisplayName());
}
@Override
public void testFailed(ExtensionContext context, Throwable cause) {
LOG.error(
"\n--------------------------------------------------------------------------------"
- + "\nTest {}.{} failed with:\n{}"
+ + "\nTest {}.{}[{}] failed with:\n{}"
+ "\n================================================================================",
context.getRequiredTestClass().getCanonicalName(),
context.getRequiredTestMethod().getName(),
+ context.getDisplayName(),
exceptionToString(cause));
}