Skip to content

Migrate the published test base classes off PlexusTestCase - #937

Merged
slachiewicz merged 1 commit into
wagon-3.xfrom
junit5-published-bases-3x
Aug 18, 2026
Merged

Migrate the published test base classes off PlexusTestCase#937
slachiewicz merged 1 commit into
wagon-3.xfrom
junit5-published-bases-3x

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Backport of #936. Same four published base classes: WagonTestCase,
CommandExecutorTestCase, HttpWagonTestCase and KnownHostsProviderTestCase.

This one reaches third-party providers, and wagon-3.x is a patch line. These classes live
in src/main/java of released artifacts and carry no annotations today — they are discovered by
JUnit 3 naming through PlexusTestCase extends junit.framework.TestCase. A provider whose test
does class MyWagonTest extends HttpWagonTestCase {} inherits those tests today; once the base
is on Jupiter and that provider has no Jupiter engine in their own POM, surefire keeps selecting
the JUnit 4 provider and the inherited tests are no longer discovered — a green build with
no coverage, rather than a compile error. Their own testXxx() methods, written in the style
this base class taught them, stop running for the same reason. This is worth a release note.

The earlier plan kept wagon-3.x on JUnit 4 for exactly that reason; the decision to accept it
here is deliberate.

Three things carried over from #936, unchanged: plexus-testing is compile scope on
wagon-provider-test and wagon-ssh-common-test because @PlexusTest sits on published
classes; the six members lost with PlexusTestCase are replaced rather than dropped so
subclasses keep compiling; and runTest()/testSkipped become assumeTrue, so wagon-scm tests
needing an external cvs now report as skipped where they previously reported as passing.

Five places this branch deliberately differs from master, because the lines have drifted:

  • Assertions, HttpWagonTests and StreamingWagonTestCase keep plexus-util's FileUtils
    and IOUtil. Master dropped them for java.nio; here they are still in use and unrelated to
    the migration.
  • HttpWagonTestCase keeps the commented-out testDeflateGet block that master has since
    removed.
  • HttpWagonTestCase keeps FileUtils.fileRead rather than taking master's switch to
    Files.readAllBytes; only the assertEquals argument order changes.
  • AbstractHttpClientWagonTest swaps four assertThat(x, instanceOf(Y.class)) for
    assertInstanceOf. Hamcrest was never declared here — it arrived transitively through
    junit:junit, which this change removes. Master has no Hamcrest left to worry about; on this
    branch the choice was between declaring hamcrest-core:1.3 explicitly or using the assertion
    JUnit 5 already provides.
  • FtpWagonTest gains a static import for assertTrue, which it previously inherited from
    junit.framework.TestCase. Master replaced that call with assertNotNull(e.getMessage()) in
    unrelated work; that improvement is not backported here.

Verified: per-module <testcase> element counts in the surefire XML are unchanged against
3fca786f across all eight provider modules, with no new 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
slachiewicz marked this pull request as ready for review August 18, 2026 14:54
@slachiewicz
slachiewicz merged commit 321d460 into wagon-3.x Aug 18, 2026
13 checks passed
@slachiewicz
slachiewicz deleted the junit5-published-bases-3x branch August 18, 2026 19:46
@github-actions github-actions Bot added this to the 3.5.4 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