< prev index next >

test/jdk/java/lang/instrument/RetransformApp.java

Print this page

 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */
 23 
 24 
 25 import java.io.PrintStream;
 26 import java.nio.file.Path;
 27 
 28 import jdk.test.lib.process.OutputAnalyzer;
 29 import jdk.test.lib.process.ProcessTools;
 30 import jdk.test.lib.helpers.ClassFileInstaller;
 31 
 32 /*
 33  * @test
 34  * @bug 6274264 6274241 5070281
 35  * @summary test retransformClasses
 36  *
 37  * @modules java.instrument
 38  * @library /test/lib

 39  * @build RetransformAgent asmlib.Instrumentor
 40  * @enablePreview
 41  * @comment The test uses asmlib/Instrumentor.java which relies on ClassFile API PreviewFeature.
 42  * @run driver/timeout=240 RetransformApp roleDriver
 43  * @comment The test uses a higher timeout to prevent test timeouts noted in JDK-6528548
 44  */
 45 public class RetransformApp {
 46 
 47     public static void main(String[] args) throws Exception {
 48         if (args.length == 1) {
 49             if (!"roleDriver".equals(args[0])) {
 50                 throw new Exception("unexpected program argument: " + args[0]);
 51             }
 52             // launch the RetransformApp java process after creating the necessary
 53             // infrastructure
 54             System.out.println("creating agent jar");
 55             final Path agentJar = createAgentJar();
 56             System.out.println("launching app, with javaagent jar: " + agentJar);
 57             launchApp(agentJar);
 58         } else {

 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */
 23 
 24 
 25 import java.io.PrintStream;
 26 import java.nio.file.Path;
 27 
 28 import jdk.test.lib.process.OutputAnalyzer;
 29 import jdk.test.lib.process.ProcessTools;
 30 import jdk.test.lib.helpers.ClassFileInstaller;
 31 
 32 /*
 33  * @test
 34  * @bug 6274264 6274241 5070281
 35  * @summary test retransformClasses
 36  *
 37  * @modules java.instrument
 38  * @library /test/lib
 39  * @build jdk.test.lib.process.ProcessTools
 40  * @build RetransformAgent asmlib.Instrumentor
 41  * @enablePreview
 42  * @comment The test uses asmlib/Instrumentor.java which relies on ClassFile API PreviewFeature.
 43  * @run driver/timeout=240 RetransformApp roleDriver
 44  * @comment The test uses a higher timeout to prevent test timeouts noted in JDK-6528548
 45  */
 46 public class RetransformApp {
 47 
 48     public static void main(String[] args) throws Exception {
 49         if (args.length == 1) {
 50             if (!"roleDriver".equals(args[0])) {
 51                 throw new Exception("unexpected program argument: " + args[0]);
 52             }
 53             // launch the RetransformApp java process after creating the necessary
 54             // infrastructure
 55             System.out.println("creating agent jar");
 56             final Path agentJar = createAgentJar();
 57             System.out.println("launching app, with javaagent jar: " + agentJar);
 58             launchApp(agentJar);
 59         } else {
< prev index next >