RFR: 7903324: Improve per-class reporting of JUnit tests, in .jtr file [v2]

Christian Stein cstein at openjdk.org
Thu Nov 3 16:57:53 UTC 2022


On Thu, 3 Nov 2022 16:53:59 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> Improve per-class reporting of JUnit tests by using a custom `TestExecutionListener` in `JUnitRunner`.
>
> Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
> 
>   More comments addressed

The lines in the sample `.jtr` now read:


----------System.err:(31/1529)----------
STARTED    JupiterTests::nullEmptyAndBlankStrings '[1] test('null')'
SUCCESSFUL JupiterTests::nullEmptyAndBlankStrings '[1] test('null')'
STARTED    JupiterTests::nullEmptyAndBlankStrings '[2] test('')'
SUCCESSFUL JupiterTests::nullEmptyAndBlankStrings '[2] test('')'
STARTED    JupiterTests::nullEmptyAndBlankStrings '[3] test(' ')'
SUCCESSFUL JupiterTests::nullEmptyAndBlankStrings '[3] test(' ')'
[...]
STARTED    JupiterTests::nullEmptyAndBlankStrings '[5] test('123')'
org.opentest4j.AssertionFailedError: Input text "123" not blank ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:40)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:210)
	at JupiterTests.nullEmptyAndBlankStrings(JupiterTests.java:63)
[...]
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:833)
FAILED      JupiterTests::nullEmptyAndBlankStrings '[5] test('123')'
STARTED    JupiterTests::succeedingTest 'succeedingTest()'
SUCCESSFUL JupiterTests::succeedingTest 'succeedingTest()'
SKIPPED    JupiterTests::skippedTest 'skippedTest()' for demonstration purposes
STARTED    JupiterTests::abortedTest 'abortedTest()'
org.opentest4j.TestAbortedException: Assumption failed: abort test execution mid-flight
ABORTED    JupiterTests::abortedTest 'abortedTest()'

-------------

PR: https://git.openjdk.org/jtreg/pull/127


More information about the jtreg-dev mailing list