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

 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  * @run driver/timeout=240 RetransformApp roleDriver
 42  * @comment The test uses a higher timeout to prevent test timeouts noted in JDK-6528548
 43  */
 44 public class RetransformApp {
 45 
 46     public static void main(String[] args) throws Exception {
 47         if (args.length == 1) {
 48             if (!"roleDriver".equals(args[0])) {
 49                 throw new Exception("unexpected program argument: " + args[0]);
 50             }
 51             // launch the RetransformApp java process after creating the necessary
 52             // infrastructure
 53             System.out.println("creating agent jar");
 54             final Path agentJar = createAgentJar();
 55             System.out.println("launching app, with javaagent jar: " + agentJar);
 56             launchApp(agentJar);
 57         } else {
 58             System.err.println("running app");
 59             new RetransformApp().run(System.out);
< prev index next >