Skip to content

JUnit3 to JUnit5(Jupiter) Runner Migration for OFBiz Test Cases/ Integration Tests - Migration of plugins test cases - #344

Merged
ashishvijaywargiya merged 10 commits into
apache:trunkfrom
ashishvijaywargiya:plugin-migration-junit5
Jul 31, 2026
Merged

JUnit3 to JUnit5(Jupiter) Runner Migration for OFBiz Test Cases/ Integration Tests - Migration of plugins test cases#344
ashishvijaywargiya merged 10 commits into
apache:trunkfrom
ashishvijaywargiya:plugin-migration-junit5

Conversation

@ashishvijaywargiya

Copy link
Copy Markdown
Contributor

JUnit3 to JUnit5(Jupiter) Runner Migration for OFBiz Test Cases/ Integration Tests - Migration of plugins test cases

  1. Migrated the last 12 real (non-example) JUnit3 test files to Jupiter - assetmaint's FixedAssetMaintTests, ecommerce's OrderNotificationTests, lucene's LuceneTests, and all 10 scrum test files - dropping each file's (String name) constructor, implementing JupiterTestHelper instead of extending OFBizTestCase, annotating methods @test, and moving sources from src/main to src/test to match the convention already used by other components' test files.

  2. Swapped each migrated file's testdef entry from to (assetmainttests.xml, EcommerceTest.xml, lucenetests.xml, scrumTests.xml), and reordered LuceneTests.java's assertion calls from JUnit3/4's (message, expected, actual) argument order to JUnit 5's (expected, actual, message).

  3. Added @order to every @test method in scrum's multi-method files, proven necessary because JUnit 5's own default ordering ran testAddSprintMember before testRemoveSprintMember and tripped a real, pre-existing de-dup check in assignPartyToWorkEffort on a stale, non-expiring WorkEffortPartyAssignment; files verified order-independent by inspection (assetmaint's FixedAssetMaintTests, ecommerce's OrderNotificationTests, lucene's single-method LuceneTests) were left without @order.

  4. plugins/example gained a new ExampleJupiterTests.groovy (parameterized-test and @disabled demo) wired through a new example-tests-jupiter test-case, kept side-by-side with the untouched JUnit 3 ExampleTests.groovy as the old/new reference pair; both branches were verified together with a full cleanAll/loadAll plus testIntegration run, with every suite passing, including all four migrated plugin suites - assetmainttests, ecommercetests, lucenetests, and scrumtests.

ashishvijaywargiya and others added 10 commits July 21, 2026 17:23
ExampleTests.groovy is back to extends OFBizTestCase (JUnit3), matching tests.xml's junit-test-suite declaration.

ExampleJupiterTests.groovy keeps implements JupiterTestHelper but uses raw delegator/dispatcher field-style access instead of getDelegator()/getDispatcher() calls.
…tation

The ofbiz-framework annotation this test class carries was renamed from
JupiterTestEngine to JupiterIntegrationTest to avoid colliding by simple name with
JUnit 5's own org.junit.jupiter.engine.JupiterTestEngine SPI class.

This commit depends on the renamed JupiterIntegrationTest class existing in the
corresponding ofbiz-framework branch (jupiter-test-engine-tagging, based on
migration-junit5). The framework-side change must be applied or merged first, or
compileGroovy will fail here with an unresolvable class reference to
org.apache.ofbiz.testtools.JupiterIntegrationTest.
This commit depends on the renamed JunitJupiterTest class existing in the
corresponding ofbiz-framework branch (migration-junit5). The framework-side
change must be applied first, or compileGroovy will fail here with an
unresolvable class reference.
Converts the last 12 real (non-example) JUnit3 test files across
assetmaint, ecommerce, lucene, and scrum to Jupiter, using the
JunitJupiterTest/JupiterTestHelper infrastructure: drop the JUnit3
(String name) constructor, implement JupiterTestHelper instead of
extending OFBizTestCase, annotate methods with @test, and move
sources from src/main to src/test. Each testdef's <junit-test-suite>
becomes <jupiter-test-suite>.

@order is kept only on scrum's multi-method files, where
JupiterTestSuite's pinned MethodOrderer.OrderAnnotation is load-bearing:
SprintTests depends on testRemoveSprintMember running before
testAddSprintMember to avoid a pre-existing de-dup bug in
assignPartyToWorkEffort. assetmaint's FixedAssetMaintTests methods are
verified independent (each creates and queries only its own records),
so @order was dropped there; ecommerce's OrderNotificationTests and
lucene's single-method LuceneTests never needed it.

All four suites verified passing under testIntegration:
assetmainttests (3), ecommercetests (51), lucenetests (17), and
scrumtests (479).
@sonarqubecloud

Copy link
Copy Markdown

@ashishvijaywargiya
ashishvijaywargiya merged commit 0cf87bd into apache:trunk Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant