Skip to content

Add a jupiter-tests target to run JUnit 5 tests - #235

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:junitlauncher-jupiter-target
Open

Add a jupiter-tests target to run JUnit 5 tests#235
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:junitlauncher-jupiter-target

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

There is currently nowhere to put a JUnit 5 test: the junit task cannot run
Jupiter, and junitlauncher is only exercised by the tests ofjunitlauncher.
This adds a jupiter-tests target beside the existing run, so a Jupiter test can
be written and will actually execute.

It is deliberately additive. The 356 existing test classes stay on the junit
task, junitreport still aggregates only that task's XML, and the new target
writes its reports elsewhere. Nothing about the current reporting changes.

A single selector names the JUnit 5 tests. The junit batch excludes it and
jupiter-tests includes it, so the two runners cannot pick up the same class and
the list cannot drift out of step. UnicodeUtilTest moves across as the first
one — otherwise the target would run nothing and silently keep passing.

Failures reuse junit.failed, so check-failed and test fail the build exactly
as they already do. legacy-plain writes only to files, so the target prints the
failing reports; the fileset selects nothing when the run passed.

Why not switch the runner outright

That was the original intent, and it looks blocked. The junit run feeds
junitreport, which would mean moving to the legacy-xml listener — the subject
of 69683, 69685, 69687 and 69707, two of which report that junitreport cannot
correctly read what that listener writes. Switching wholesale would regress this
project's own test reporting. Those look worth fixing first; this target needs
none of them.

errorproperty also has no junitlauncher equivalent (70175), though it does not
matter here since both properties already map to junit.failed.

Verified

  • ant jupiter-testsTests run: 1, Failures: 0.
  • ant junit-batch -Djunit.includes="**/UnicodeUtilTest.java" → not picked up by
    the junit task; the same command with SymlinkUtilsTest does run it, so the
    exclusion is doing the work rather than the batch running empty.
  • With the test deliberately broken: the assertion detail reaches the console and
    junit.failedtests.failedfail fires.

This change was created with AI assistance.

The junit task cannot run Jupiter tests, so there is nowhere to put one
today. This adds a junitlauncher target beside the existing run and a
selector naming the JUnit 5 tests, used by both so the two runners cannot
pick up the same class.
UnicodeUtilTest moves across as the first one, to prove the target runs.
Reports go to their own directory; junitreport still aggregates only the
junit task's XML, so nothing about the existing reporting changes.
@slachiewicz
slachiewicz marked this pull request as ready for review August 22, 2026 21:07
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@slachiewicz