Skip to content

Move the tests off JUnit 4 and the JUnit 3 plugin testing harness - #886

Merged
slachiewicz merged 3 commits into
apache:masterfrom
slachiewicz:mshade-junit5
Oct 31, 2026
Merged

slachiewicz merged 3 commits into
apache:masterfrom
slachiewicz:mshade-junit5

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

ShadeMojoTest was the last test on the JUnit 3 AbstractMojoTestCase. It now uses @MojoTest, with the container, Shader, ArtifactHandler and project injected, and the shade mojo from @InjectMojo. With that, the tests need neither JUnit 4 nor the vintage engine.

DefaultShaderTest uses plain JUnit 5 assertions instead of Hamcrest. Its assertThat/containsString calls had no imports, which is why master currently fails to compile the tests.

ComponentsXmlResourceTransformerTest moves from xmlunit-legacy to xmlunit-core. The legacy module brings junit:3.8.1, and surefire adds the vintage engine whenever JUnit is on the test classpath, so leaving it would break test discovery. ignoreComments() keeps the old result: the only comment in those files is the license header, which the merged output does not carry.

Verified: mvn verify -Dinvoker.skip → 121 tests, 0 failures, 1 skipped (assumeTrue(isModularRuntime()))

@slachiewicz
slachiewicz marked this pull request as ready for review October 31, 2026 10:13
xmlunit-legacy brings junit 3.8.1, and surefire adds the vintage engine whenever JUnit is on the test classpath, so ComponentsXmlResourceTransformerTest uses xmlunit-core instead.
They had no Hamcrest imports, so master failed to compile its tests.
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