Skip to content

Migrate the published test base classes off PlexusTestCase - #936

Merged
slachiewicz merged 1 commit into
masterfrom
junit5-published-bases
Aug 18, 2026
Merged

Migrate the published test base classes off PlexusTestCase#936
slachiewicz merged 1 commit into
masterfrom
junit5-published-bases

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Completes the JUnit 5 move for the test base classes that wagon publishes: WagonTestCase,
CommandExecutorTestCase, HttpWagonTestCase and KnownHostsProviderTestCase. These are
src/main/java in released artifacts, so the change reaches consumers who extend them —
which drove three decisions worth a reviewer's attention.

plexus-testing is a compile-scope dependency of wagon-provider-test and
wagon-ssh-common-test.
@PlexusTest sits on published classes, so a consumer extending
WagonTestCase needs it on their own compile path; test scope would not propagate. Its version
moves to the root dependencyManagement alongside the other third-party versions, since
wagon-ssh already declared it and this change would otherwise make three copies.

Six members disappeared with PlexusTestCase and are replaced rather than dropped, so
subclasses outside this repo keep compiling: getTestFile, getTestPath and getBasedir
delegate to PlexusExtension; getName() is served by a TestInfo callback kept separate from
setUp() — eight subclasses override setUp() and call super.setUp(), and widening that
signature would break every one of them.

runTest() and the testSkipped flag are gone, replaced by assumeTrue. This changes a CI
signal: on a machine without cvs, the old mechanism reported those wagon-scm tests as
passing, and they are now reported as skipped (0 → 14 locally). Same tests, honest status.

Checkstyle FileLength is suppressed for HttpWagonTestCase via a new
src/config/checkstyle-suppressions.xml. One @Test per method took it one line past the
inherited 2000-line limit. Neither @SuppressWarnings nor a CHECKSTYLE_OFF comment can
suppress it — the reasons are in a comment in that file. Splitting the class is a separate change.

Verified: per-module <testcase> element counts in the surefire XML are unchanged against
f289bdd5 across all eight provider modules (22/23/295/214/42/0/0/295), with no errors or
failures.

This change was created with AI assistance.

Tests needing an external cvs binary now use assumeTrue and report as skipped;
runTest() reported them as passing. Do not restore that to quieten CI.
@slachiewicz

Copy link
Copy Markdown
Member Author

The wagon-3.x counterpart is #937. It is not a clean lift — 18 of the 35 files had drifted between the lines, so it carries five deliberate deviations, listed in its description.

This comment was created with AI assistance.

@slachiewicz
slachiewicz merged commit 0962d3e into master Aug 18, 2026
13 checks passed
@slachiewicz
slachiewicz deleted the junit5-published-bases branch August 18, 2026 19:46
@github-actions github-actions Bot added this to the 4.0.0-M1 milestone Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant