Skip to content

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
migration/java-21-migrationfrom
devin/p3-tests-java21
Open

P3-tests: upgrade test/mocking/E2E frameworks for Java 21 and make the full gate pass#15
devin-ai-integration[bot] wants to merge 2 commits into
migration/java-21-migrationfrom
devin/p3-tests-java21

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 17, 2026

Copy link
Copy Markdown

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-development is BUILD SUCCESS across all 13 modules (unit tests + jacoco + license-header + animal-sniffer all green), and the -Plegacy-test E2E module compiles under Java 21.

The primary blocker was EasyMock 2.x dragging in legacy net.sf.cglib, which throws ExceptionInInitializerError at net.sf.cglib.core.KeyFactory under JDK 21 (JPMS). Moving to EasyMock 5 (ByteBuddy) fixes the previously-failing BatchRetrieveDaoTest and the framework-web taglib tests.

Dependency upgrades (root pom.xml dependencyManagement)

  • org.easymock:easymock 2.5.15.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:testng 5.97.10.2; dropped the <classifier>jdk15</classifier> (managed dep + the integration module dep).
  • selenium.version 2.43.14.27.0; geb.version 0.10.07.0.
  • com.icegreen:greenmail 1.32.1.0 (jakarta.mail).
  • org.hsqldb:hsqldb 2.3.12.7.3.

Test-code API fixes

  • EasyMock class-extension merge: 6 test files switched
    import org.easymock.classextension.EasyMockimport 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) → public geb.navigator.Navigator in TopLevelEntity.groovy.
  • Groovy 4 moved AntBuilder out of core into groovy-ant and out of the default imports; added an explicit import groovy.ant.AntBuilder in GebConfig.groovy (the artifact is already on the classpath transitively via groovy-all).
  • These are gated behind -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-development profile's surefire argLine injected dev-only JVM args into the test fork:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8083
-agentpath:${jrebel.path} -Drebel.log.stdout=true

${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 -Xmx1024m and 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)

Module Tests Fail Err Skip
common 1 0 0 0
broadleaf-profile 1 0 0 0
broadleaf-open-admin-platform 5 0 0 0
broadleaf-contentmanagement-module 8 0 0 0
broadleaf-framework 140 0 0 0
broadleaf-framework-web 4 0 0 0
broadleaf-admin-module 10 0 0 0
integration 0 0 0 0
broadleaf-profile-web / broadleaf-admin-functional-tests — (no test execution; compile-only)

Total: 169 tests, 0 failures, 0 errors, 0 skipped.

TODO(java21-migration) — out of P3-tests scope, flagged for the core/common phase

The integration module'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-phase TODO(java21-migration) markers:

  • bl-common-applicationContext.xml: blSpringCacheManagerorg.springframework.cache.ehcache.EhCacheCacheManager (Spring 6 dropped the EhCache 2 integration). The companion MergeEhCacheManagerFactoryBean already notes this.
  • bl-common-applicationContext.xml: blVelocityEngineorg.springframework.ui.velocity.VelocityEngineFactoryBean (Velocity support removed in Spring 5/6). VelocityMessageCreator already 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


Open in Devin Review

- 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.
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

…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.
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