99 return defineClass(name, buff, 0, buff.length);
100 } catch (Throwable t) {
101 t.printStackTrace();
102 throw new RuntimeException("Unexpected", t);
103 }
104 }
105 }
106 return super.loadClass(name, resolve);
107 }
108 }
109
110 static int numTests = 0;
111 static int failed = 0;
112 static boolean isAttachingAgent = false;
113 static Instrumentation instrumentation;
114
115 public static void main(String args[]) throws Throwable {
116 System.out.println("INFO: AppCDSv1 " + (wb.isSharedClass(InstrumentationApp.class) ? "enabled" :"disabled"));
117 System.out.println("INFO: AppCDSv2 " + (isAppCDSV2Enabled() ? "enabled" : "disabled"));
118
119 File bootJar = new File(args[0]);
120 File appJar = new File(args[1]);
121 File custJar = new File(args[2]);
122 String flagFile = args[3];
123 waitAttach(flagFile);
124
125 instrumentation = InstrumentationRegisterClassFileTransformer.getInstrumentation();
126 System.out.println("INFO: instrumentation = " + instrumentation);
127
128 testBootstrapCDS("Bootstrap Loader", bootJar);
129 testAppCDSv1("Application Loader", appJar);
130
131 if (isAppCDSV2Enabled()) {
132 testAppCDSv2("Custom Loader (unregistered)", custJar);
133 }
134
135 if (failed > 0) {
136 throw new RuntimeException("FINAL RESULT: " + failed + " out of " + numTests + " test case(s) have failed");
137 } else {
138 System.out.println("FINAL RESULT: All " + numTests + " test case(s) have passed!");
139 }
140 }
141
142 static void waitAttach(String flagFile) throws Throwable {
|
99 return defineClass(name, buff, 0, buff.length);
100 } catch (Throwable t) {
101 t.printStackTrace();
102 throw new RuntimeException("Unexpected", t);
103 }
104 }
105 }
106 return super.loadClass(name, resolve);
107 }
108 }
109
110 static int numTests = 0;
111 static int failed = 0;
112 static boolean isAttachingAgent = false;
113 static Instrumentation instrumentation;
114
115 public static void main(String args[]) throws Throwable {
116 System.out.println("INFO: AppCDSv1 " + (wb.isSharedClass(InstrumentationApp.class) ? "enabled" :"disabled"));
117 System.out.println("INFO: AppCDSv2 " + (isAppCDSV2Enabled() ? "enabled" : "disabled"));
118
119 String flagFile = args[0];
120 File bootJar = new File(args[1]);
121 File appJar = new File(args[2]);
122 File custJar = new File(args[3]);
123 waitAttach(flagFile);
124
125 instrumentation = InstrumentationRegisterClassFileTransformer.getInstrumentation();
126 System.out.println("INFO: instrumentation = " + instrumentation);
127
128 testBootstrapCDS("Bootstrap Loader", bootJar);
129 testAppCDSv1("Application Loader", appJar);
130
131 if (isAppCDSV2Enabled()) {
132 testAppCDSv2("Custom Loader (unregistered)", custJar);
133 }
134
135 if (failed > 0) {
136 throw new RuntimeException("FINAL RESULT: " + failed + " out of " + numTests + " test case(s) have failed");
137 } else {
138 System.out.println("FINAL RESULT: All " + numTests + " test case(s) have passed!");
139 }
140 }
141
142 static void waitAttach(String flagFile) throws Throwable {
|