< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/jvmti/InstrumentationTest.java

Print this page

118                        "-XX:+UnlockDiagnosticVMOptions",
119                        "-XX:+WhiteBoxAPI",
120                        "-Xshare:off",
121                        agentCmdArg,
122                        "InstrumentationApp", flagFile, bootJar, appJar, custJar);
123         CDSTestUtils.run(opts)
124                     .assertNormalExit();
125         checkAttach(t);
126 
127         // Dump the AppCDS archive. On some platforms AppCDSv2 may not be enabled, so we
128         // first try the v2 classlist, and if that fails, revert to the v1 classlist.
129         // Note that the InstrumentationApp$ArchivedIfAppCDSv2Enabled class is archived
130         // only if V2 is enabled. This is tested by InstrumentationApp.isAppCDSV2Enabled().
131         String[] v2Classes = {
132             "InstrumentationApp$ArchivedIfAppCDSv2Enabled",
133             "java/lang/Object id: 0",
134             "InstrumentationApp$Intf id: 1",
135             "InstrumentationApp$Coo  id: 2 super: 0 interfaces: 1 source: " + custJar,
136         };
137         String[] sharedClassesWithV2 = TestCommon.concat(v2Classes, sharedClasses);
138         OutputAnalyzer out = TestCommon.dump(appJar, sharedClassesWithV2, bootCP);
139         if (out.getExitValue() != 0) {
140             System.out.println("Redumping with AppCDSv2 disabled");
141                 TestCommon.testDump(appJar, sharedClasses, bootCP);
142         }
143 
144         // Run with AppCDS.
145         System.out.println("");
146         System.out.println("============================================================");
147         System.out.println("CDS: YES, attachAgent: " + (attachAgent ? "YES" : "NO"));
148         System.out.println("============================================================");
149         System.out.println("");
150 
151         flagFile = getFlagFile(attachAgent);
152         t = doAttach(attachAgent, flagFile, agentJar);
153         out = TestCommon.execAuto("-cp", appJar,
154                 bootCP,
155                 "-XX:+UnlockDiagnosticVMOptions",
156                 "-XX:+WhiteBoxAPI",
157                 agentCmdArg,
158                "InstrumentationApp", flagFile, bootJar, appJar, custJar);

118                        "-XX:+UnlockDiagnosticVMOptions",
119                        "-XX:+WhiteBoxAPI",
120                        "-Xshare:off",
121                        agentCmdArg,
122                        "InstrumentationApp", flagFile, bootJar, appJar, custJar);
123         CDSTestUtils.run(opts)
124                     .assertNormalExit();
125         checkAttach(t);
126 
127         // Dump the AppCDS archive. On some platforms AppCDSv2 may not be enabled, so we
128         // first try the v2 classlist, and if that fails, revert to the v1 classlist.
129         // Note that the InstrumentationApp$ArchivedIfAppCDSv2Enabled class is archived
130         // only if V2 is enabled. This is tested by InstrumentationApp.isAppCDSV2Enabled().
131         String[] v2Classes = {
132             "InstrumentationApp$ArchivedIfAppCDSv2Enabled",
133             "java/lang/Object id: 0",
134             "InstrumentationApp$Intf id: 1",
135             "InstrumentationApp$Coo  id: 2 super: 0 interfaces: 1 source: " + custJar,
136         };
137         String[] sharedClassesWithV2 = TestCommon.concat(v2Classes, sharedClasses);
138         OutputAnalyzer out = TestCommon.dump(appJar, sharedClassesWithV2, "-XX:-PreloadSharedClasses", bootCP);
139         if (out.getExitValue() != 0) {
140             System.out.println("Redumping with AppCDSv2 disabled");
141                 TestCommon.testDump(appJar, sharedClasses, bootCP);
142         }
143 
144         // Run with AppCDS.
145         System.out.println("");
146         System.out.println("============================================================");
147         System.out.println("CDS: YES, attachAgent: " + (attachAgent ? "YES" : "NO"));
148         System.out.println("============================================================");
149         System.out.println("");
150 
151         flagFile = getFlagFile(attachAgent);
152         t = doAttach(attachAgent, flagFile, agentJar);
153         out = TestCommon.execAuto("-cp", appJar,
154                 bootCP,
155                 "-XX:+UnlockDiagnosticVMOptions",
156                 "-XX:+WhiteBoxAPI",
157                 agentCmdArg,
158                "InstrumentationApp", flagFile, bootJar, appJar, custJar);
< prev index next >