JUnit3 to JUnit5(Jupiter) Runner Migration for OFBiz Test Cases/ Integration Tests - Migration of plugins test cases - #344
Merged
ashishvijaywargiya merged 10 commits intoJul 31, 2026
Conversation
…age its use in future work.
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).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



JUnit3 to JUnit5(Jupiter) Runner Migration for OFBiz Test Cases/ Integration Tests - Migration of plugins test cases
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.
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).
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.
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.