< prev index next >

test/hotspot/jtreg/runtime/cds/serviceability/transformRelatedClasses/TransformRelatedClasses.java

Print this page

132 
133     // same test jar and archive can be used for all test cases
134     private void prepare() throws Exception {
135         // create agent jar
136         // Agent is the same for all test cases
137         String pathToManifest = "../../../../testlibrary/jvmti/TransformerAgent.mf";
138         agentJar = ClassFileInstaller.writeJar("TransformerAgent.jar",
139                        ClassFileInstaller.Manifest.fromSourceFile(pathToManifest),
140                                            agentClasses);
141 
142         // create a test jar
143         testJar =
144             ClassFileInstaller.writeJar(parent + "-" + child + ".jar",
145                                            testClasses);
146 
147         // create an archive
148         String classList =
149             CDSTestUtils.makeClassList("transform-" + parent, testNames).getPath();
150 
151         CDSTestUtils.createArchiveAndCheck("-Xbootclasspath/a:" + testJar,
152             "-XX:ExtraSharedClassListFile=" + classList);
153     }
154 
155 
156     private void runTest(TestEntry entry) throws Exception {
157         log("runTest(): testCaseId = " + entry.testCaseId);
158 
159         // execute with archive
160         String agentParam = "-javaagent:" + agentJar + "=" +
161             TransformTestCommon.getAgentParams(entry, parent, child);
162 
163         CDSOptions opts = new CDSOptions()
164             .addPrefix("-Xbootclasspath/a:" + testJar, "-Xlog:class+load=info")
165             .setUseVersion(false)
166             .addSuffix( "-showversion",agentParam, child);
167 
168         OutputAnalyzer out = CDSTestUtils.runWithArchive(opts);
169         TransformTestCommon.checkResults(entry, out, parent, child);
170     }
171 }

132 
133     // same test jar and archive can be used for all test cases
134     private void prepare() throws Exception {
135         // create agent jar
136         // Agent is the same for all test cases
137         String pathToManifest = "../../../../testlibrary/jvmti/TransformerAgent.mf";
138         agentJar = ClassFileInstaller.writeJar("TransformerAgent.jar",
139                        ClassFileInstaller.Manifest.fromSourceFile(pathToManifest),
140                                            agentClasses);
141 
142         // create a test jar
143         testJar =
144             ClassFileInstaller.writeJar(parent + "-" + child + ".jar",
145                                            testClasses);
146 
147         // create an archive
148         String classList =
149             CDSTestUtils.makeClassList("transform-" + parent, testNames).getPath();
150 
151         CDSTestUtils.createArchiveAndCheck("-Xbootclasspath/a:" + testJar,
152             "-XX:ExtraSharedClassListFile=" + classList, "-XX:-PreloadSharedClasses");
153     }
154 
155 
156     private void runTest(TestEntry entry) throws Exception {
157         log("runTest(): testCaseId = " + entry.testCaseId);
158 
159         // execute with archive
160         String agentParam = "-javaagent:" + agentJar + "=" +
161             TransformTestCommon.getAgentParams(entry, parent, child);
162 
163         CDSOptions opts = new CDSOptions()
164             .addPrefix("-Xbootclasspath/a:" + testJar, "-Xlog:class+load=info")
165             .setUseVersion(false)
166             .addSuffix( "-showversion",agentParam, child);
167 
168         OutputAnalyzer out = CDSTestUtils.runWithArchive(opts);
169         TransformTestCommon.checkResults(entry, out, parent, child);
170     }
171 }
< prev index next >