slachiewicz opened a new pull request, #179: URL: https://github.com/apache/maven-resolver-ant-tasks/pull/179
This repository was the last one in the resolver line with its whole test suite still on JUnit 4 — 18 test classes, no Jupiter at all. ### What is mechanical The bulk is the OpenRewrite `org.openrewrite.java.testing.junit5.JUnit4to5Migration` recipe: annotations, the `Assert` → `Assertions` move including the argument-order flip on the message-carrying overloads, and `@Rule TemporaryFolder` → `@TempDir`. ### What the recipe could not do **`build.xml` ran this same suite through the Ant `<junit>` task.** That task only understands JUnit 3 and 4, which is what the 16 `JUnit4TestAdapter suite()` methods existed for — they were load-bearing, not vestigial. Migrating the tests without touching `build.xml` would have left the `run-its` smoke test green while silently running nothing at all. It now uses `<junitlauncher>`. Its `<fork>` sets `includeJUnitPlatformLibraries="false"`, because the task's own platform jars are older than the ones on `cp.runtime.test` and otherwise fail the run with a version-alignment error. **`AntBuildsTest` and `CreatePomRainyDayTest` drove Ant's `BuildFileRule`.** `ant-testutil` only ships that as a JUnit 4 `TestRule` (it extends `org.junit.rules.ExternalResource`) and declares `junit:junit` at **compile** scope, so JUnit 4 could not leave the classpath while it was in use. The new `AntBuildFileExtension` reproduces its behaviour behind an `AfterEachCallback` — same log/output capture, same `System.out` synchronisation, same `tearDown`-target handling. `ant-testutil` and `junit:junit` are both gone from the tree now. `examples/example5` and `examples/example6` intentionally stay on JUnit 4: they are Ant sample projects driven by the `run-ant-examples` target, not part of this suite. ### Verification - `mvn test` → `Tests run: 58, Failures: 0, Errors: 0, Skipped: 0`, matching the 58 `@Test` methods on `master` exactly — no test silently stopped being discovered. - `mvn -Prun-its verify` → exit 0, with `<junitlauncher>` reporting all 18 classes and the same 58 tests, so the Ant smoke test really is running the suite again. - `mvn spotless:check` clean. Draft until CI confirms. Generated-by: Claude Opus 5 (1M context) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
