Skip to content

Commit

Permalink
MidpointTestMixin: footer indicates failure + exceptions logged as WARN
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Mar 17, 2020
1 parent b66e488 commit e2625a4
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -130,12 +130,15 @@ default void displayTestTitle(String testTitle) {
*/
default void displayTestFooter(String testTitle, ITestResult testResult) {
if (testResult.getThrowable() != null) {
displayException(testTitle + " thrown unexpected exception", testResult.getThrowable());
displayException(testTitle + " threw unexpected exception", testResult.getThrowable());
}

long testMsDuration = testResult.getEndMillis() - testResult.getStartMillis();
System.out.println(TEST_OUT_FOOTER_PREFIX + testTitle + " FINISHED in " + testMsDuration + " ms" + TEST_OUT_FOOTER_SUFFIX);
logger().info(TEST_LOG_PREFIX + testTitle + " FINISHED in " + testMsDuration + " ms" + TEST_LOG_SUFFIX);
String finishedLabel = testResult.isSuccess()
? " FINISHED in "
: " FINISHED with FAILURE in ";
System.out.println(TEST_OUT_FOOTER_PREFIX + testTitle + finishedLabel + testMsDuration + " ms" + TEST_OUT_FOOTER_SUFFIX);
logger().info(TEST_LOG_PREFIX + testTitle + finishedLabel + testMsDuration + " ms" + TEST_LOG_SUFFIX);
}

default void display(String text) {
Expand All @@ -158,7 +161,7 @@ default void displayValue(String title, Object value) {
default void displayException(String title, Throwable e) {
System.out.println(DISPLAY_OUT_PREFIX + title + ":");
e.printStackTrace(System.out);
logger().debug(DISPLAY_LOG_FORMAT1, title, e);
logger().warn(DISPLAY_LOG_FORMAT1, title, e);
}

/**
Expand Down

0 comments on commit e2625a4

Please sign in to comment.