Skip to content

How to debug a TCK test with GlassFish loaded in the debugger

Scott Marlow edited this page Apr 16, 2025 · 3 revisions

Pass the -Dglassfish.suspend option to Maven command will run GlassFish in a debugger on port 9091.

Example to debug tests in platformtck/glassfish-runner/persistence-platform-tck:

  1. Update the glassfish-runner/persistence-platform-tck/persistence-platform-tck-run/src/test/resources/appclient-arquillian.xml to set the debug and suspend container properties to true [1].
  2. Update persistence-platform-tck-run/platform_pom.xml to only run the Platform tests that you want to debug. Or update pom.xml for Web Profile.
  3. mvn -Dglassfish.suspend -f persistence-platform-tck-run/platform_pom.xml test-compile failsafe:integration-test@jpa-tests-appclient -Pfull,staging -Dtck.test.persistence.version=11.0.1-SNAPSHOT 2>&1 | tee jpa.log

[1]

<group qualifier="glassfish-servers" default="true">
  <container qualifier="tck-appclient" default="true">
      <configuration>
          <property name="glassFishHome">target/glassfish8</property>
          <property name="allowConnectingToRunningServer">true</property>
          <property name="debug">true</property>
          <property name="suspend">true</property>
      </configuration>
Clone this wiki locally