P3-tests: upgrade test/mocking/E2E frameworks for Java 21 and make the full gate pass#15
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
Conversation
- EasyMock 2.5.1 -> 5.4.0 (ByteBuddy, JDK 21 compatible); remove
easymockclassextension (merged into core in EasyMock 3) and switch
test imports from org.easymock.classextension.EasyMock to org.easymock.EasyMock.
- TestNG 5.9 (jdk15 classifier) -> 7.10.2; drop the jdk15 classifier.
- Selenium 2.43.1 -> 4.27.0; Geb 0.10.0 -> 7.0. Fix functional-tests
compilation under Groovy 4: geb.navigator.NonEmptyNavigator -> Navigator,
add explicit import groovy.ant.AntBuilder (moved out of groovy core in 4.x).
- GreenMail 1.3 -> 2.1.0 (jakarta.mail); HSQLDB 2.3.1 -> 2.7.3.
- integration: remove broken dev-only JRebel/remote-debug surefire argLine
(-agentpath:${jrebel.path} is an unresolved path that crashes the test
fork JVM; -Xdebug/-Xrunjdwp are dev-only).
Part of the automated Java 21 migration.
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…fire argLines Java 8 removed PermGen; the flag only emits an 'Ignoring option MaxPermSize' warning on Java 21. Removes it from the default-test and non-legacy-test executions for consistency with the blc-development profile cleanup.
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.
Summary
Upgrades the test/mocking/E2E framework stack so the full verification gate runs on Java 21. With these changes
export JAVA_HOME=<jdk21> && mvn clean install -Pblc-developmentis BUILD SUCCESS across all 13 modules (unit tests + jacoco + license-header + animal-sniffer all green), and the-Plegacy-testE2E module compiles under Java 21.The primary blocker was EasyMock 2.x dragging in legacy
net.sf.cglib, which throwsExceptionInInitializerErroratnet.sf.cglib.core.KeyFactoryunder JDK 21 (JPMS). Moving to EasyMock 5 (ByteBuddy) fixes the previously-failingBatchRetrieveDaoTestand the framework-web taglib tests.Dependency upgrades (root
pom.xmldependencyManagement)org.easymock:easymock2.5.1→5.4.0(ByteBuddy, JDK 21 compatible).easymockclassextension(2.4) removed entirely — it was merged into core in EasyMock 3. Removed the managed dep and the per-module declarations (common, framework, framework-web, profile, integration).org.testng:testng5.9→7.10.2; dropped the<classifier>jdk15</classifier>(managed dep + the integration module dep).selenium.version2.43.1→4.27.0;geb.version0.10.0→7.0.com.icegreen:greenmail1.3→2.1.0(jakarta.mail).org.hsqldb:hsqldb2.3.1→2.7.3.Test-code API fixes
import org.easymock.classextension.EasyMock→import org.easymock.EasyMock(
BatchRetrieveDaoTest,BaseTagLibTest,CategoryBreadcrumbTagTest,CategoryTagTest,OfferDataItemProvider,OrderOfferProcessorTest).EasyMock.createMock(Class)mocks classes directly in 5.x, so no other call-site changes were needed.E2E compile fixes (
broadleaf-admin-functional-tests, Geb 7 / Selenium 4 / Groovy 4)geb.navigator.NonEmptyNavigator(internal class, gone in Geb 7) → publicgeb.navigator.NavigatorinTopLevelEntity.groovy.AntBuilderout of core intogroovy-antand out of the default imports; added an explicitimport groovy.ant.AntBuilderinGebConfig.groovy(the artifact is already on the classpath transitively viagroovy-all).-Plegacy-test(live-browser E2E) and are not run by the default gate; they now compile under Java 21.integration module surefire fix
The
blc-developmentprofile's surefireargLineinjected dev-only JVM args into the test fork:${jrebel.path}is never defined (it requires a developer's local JRebel install), so the forked test JVM aborts at startup with "The forked VM terminated without properly saying goodbye" — i.e. these integration tests could never run in a clean CI checkout. Removed the JRebel agent + remote-debug attach from both argLines (kept-Xmx1024mand the jacoco-provided${surefire.argLine}). No test selection, assertions, jacoco, or license-header config was weakened.Per-module test results (Java 21,
mvn clean install -Pblc-development)Total: 169 tests, 0 failures, 0 errors, 0 skipped.
TODO(java21-migration) — out of P3-tests scope, flagged for the core/common phase
The
integrationmodule's heavy DB-backed TestNG tests (OrderTest,CatalogTest,EmailTest, …) are the opt-in integration tests and are not executed by the default gate (surefire 3.x auto-selects the JUnit Platform provider, which does not run TestNG; only the integration module uses TestNG). They were already not running before this PR. They additionally cannot pass yet because the merged application context still references Spring classes that Spring 6 removed — these are core/common main-code migration gaps, not test-framework issues, and already carry prior-phaseTODO(java21-migration)markers:bl-common-applicationContext.xml:blSpringCacheManager→org.springframework.cache.ehcache.EhCacheCacheManager(Spring 6 dropped the EhCache 2 integration). The companionMergeEhCacheManagerFactoryBeanalready notes this.bl-common-applicationContext.xml:blVelocityEngine→org.springframework.ui.velocity.VelocityEngineFactoryBean(Velocity support removed in Spring 5/6).VelocityMessageCreatoralready notes this.Wiring these (and re-running the integration TestNG suite) belongs to the core Spring 6 caching/templating migration phase, not the test-framework upgrade.
This is part of the automated Java 21 migration.
Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/457ef89f436d4c56960a9d70cd869843
Requested by: @mbatchelor81