[
https://issues.apache.org/jira/browse/OPENJPA-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18143563#comment-18143563
]
Richard Zowalla commented on OPENJPA-3077:
------------------------------------------
I looked at why the profile still fails after the manifest change. Three things:
1. The root pom's test-dynamic-enhancer profile turns on the security manager.
JDK 24+ refuses to start the test JVM, and on 17/21 the old policy lacks
ManagementPermission "monitor" for surefire's ForkedBooter, so the fork dies in
every module.
2. Because that profile is in the root pom, {{-Ptest-dynamic-enhancer}}
switches off the activeByDefault test-derby profile, so there is no Derby
driver/URL.
3. {{-javaagent}} pointing into ~/.m2 needs a prior install and otherwise picks
up a stale kernel jar (here: no Premain-Class, "Agent_OnLoad: instrument").
I pushed two commits on top: the root profile and the leftover policy.file
profiles are removed; openjpa-persistence-jdbc builds a manifest-only agent jar
(Premain-Class=PCEnhancerAgent) in target/ and passes it to {{-javaagent}}, so
the kernel classes come from the reactor, and recompiles the test classes so
they are really enhanced at load time (be6fb428f); DynamicEnhancementSuite
checks that the agent is active and leaves out TestClone and
TestDataCacheBehavesIdentical, which the regular build excludes as well
(5876818a8). With that {{mvn test -Ptest-dynamic-enhancer}} runs 417 tests on
Derby with 0 failures on JDK 17, 21 and 25.
Self-attach via {{openjpa.DynamicEnhancementAgent}} on JDK 9+ (no tools.jar) is
a separate issue.
See https://github.com/apache/openjpa/pull/306
> test-dynamic-enhancer is broken
> -------------------------------
>
> Key: OPENJPA-3077
> URL: https://issues.apache.org/jira/browse/OPENJPA-3077
> Project: OpenJPA
> Issue Type: Bug
> Components: instrumentation, jdbc, kernel
> Affects Versions: 4.1.1
> Reporter: Maxim Solodovnik
> Assignee: Maxim Solodovnik
> Priority: Major
> Fix For: 4.2.0
>
>
> No tests are successful if {{test-dynamic-enhancer}} profile being used
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)