slachiewicz commented on PR #179: URL: https://github.com/apache/maven-resolver-ant-tasks/pull/179#issuecomment-5233897085
Checked whether Ant already provides a JUnit 5 way to drive a build file, so that `AntBuildFileExtension` would not be needed. It does not: - `ant-testutil` 1.10.17 (the newest published version) contains only `BuildFileRule` (JUnit 4) and `BuildFileTest` (JUnit 3). No Jupiter variant has ever shipped. - A code search across `apache/ant` returns zero hits for `BuildFileExtension` or anything equivalent. - Ant's own manual on `master` (`tutorial-writing-tasks.html`) still documents `@Rule BuildFileRule` with JUnit 4, and Ant's own test suite is still largely JUnit 4 — which is why there is nothing to inherit. The only alternatives are `junit-jupiter-migrationsupport` with `@EnableRuleMigrationSupport`, which would keep `ant-testutil` and therefore `junit:junit` at compile scope and so defeat the point of this PR, or a rewrite onto Apache AntUnit, which is a much larger change worth proposing separately. Note that the `<junitlauncher>` half of this PR is *not* custom — that is Ant's own official JUnit 5 integration (`org.apache.ant:ant-junitlauncher`). I have trimmed the extension in the meantime: `getFullLog()`, `getOutput()`, `getError()` and `cleanBuffer()` were carried over from `BuildFileRule` but nothing here calls them, and `fullLogBuffer` was write-only. The captured stdout/stderr buffers are gone too — the redirection stays, since it is what keeps a target's console output from flooding the test log, but the bytes are discarded rather than accumulated. 232 lines down to 182. Re-verified after the trim: `mvn test` → `Tests run: 58, Failures: 0, Errors: 0, Skipped: 0`; `mvn -Prun-its verify` → exit 0 with `<junitlauncher>` reporting 17 classes and the same 58 tests; `spotless:check` clean. -- 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]
