23
24 import java.io.File;
25 import java.io.IOException;
26 import java.net.ServerSocket;
27 import java.net.Socket;
28 import java.util.List;
29 import java.util.Properties;
30
31 import jdk.testlibrary.OutputAnalyzer;
32 import jdk.testlibrary.ProcessThread;
33 import jdk.testlibrary.ProcessTools;
34
35 import com.sun.tools.attach.AgentInitializationException;
36 import com.sun.tools.attach.AgentLoadException;
37 import com.sun.tools.attach.VirtualMachine;
38 import com.sun.tools.attach.VirtualMachineDescriptor;
39
40 /*
41 * @test
42 * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
43 * @summary Basic unit tests for the VM attach mechanism.
44 * @key intermittent
45 * @library /lib/testlibrary
46 * @modules java.instrument
47 * java.management
48 * jdk.jartool/sun.tools.jar
49 * @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application RedefineDummy RunnerUtil
50 * @run main BasicTests
51 *
52 * This test will perform a number of basic attach tests.
53 */
54 public class BasicTests {
55
56 /*
57 * The actual test is in the nested class TestMain.
58 * The responsibility of this class is to:
59 * 1. Build all needed jars.
60 * 2. Start the Application class in a separate process.
61 * 3. Find the pid and shutdown port of the running Application.
62 * 4. Launches the tests in nested class TestMain that will attach to the Application.
63 * 5. Shut down the Application.
64 */
65 public static void main(String args[]) throws Throwable {
66 ProcessThread processThread = null;
67 try {
68 buildJars();
69 processThread = RunnerUtil.startApplication();
70 runTests(processThread.getPid());
71 } catch (Throwable t) {
72 System.out.println("TestBasic got unexpected exception: " + t);
|
23
24 import java.io.File;
25 import java.io.IOException;
26 import java.net.ServerSocket;
27 import java.net.Socket;
28 import java.util.List;
29 import java.util.Properties;
30
31 import jdk.testlibrary.OutputAnalyzer;
32 import jdk.testlibrary.ProcessThread;
33 import jdk.testlibrary.ProcessTools;
34
35 import com.sun.tools.attach.AgentInitializationException;
36 import com.sun.tools.attach.AgentLoadException;
37 import com.sun.tools.attach.VirtualMachine;
38 import com.sun.tools.attach.VirtualMachineDescriptor;
39
40 /*
41 * @test
42 * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
43 * @key intermittent
44 * @summary Basic unit tests for the VM attach mechanism. This test will perform
45 * a number of basic attach tests.
46 *
47 * @library /lib/testlibrary
48 * @modules java.instrument
49 * java.management
50 * jdk.jartool/sun.tools.jar
51 *
52 * @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application RedefineDummy RunnerUtil
53 * @run main BasicTests
54 *
55 */
56 public class BasicTests {
57
58 /*
59 * The actual test is in the nested class TestMain.
60 * The responsibility of this class is to:
61 * 1. Build all needed jars.
62 * 2. Start the Application class in a separate process.
63 * 3. Find the pid and shutdown port of the running Application.
64 * 4. Launches the tests in nested class TestMain that will attach to the Application.
65 * 5. Shut down the Application.
66 */
67 public static void main(String args[]) throws Throwable {
68 ProcessThread processThread = null;
69 try {
70 buildJars();
71 processThread = RunnerUtil.startApplication();
72 runTests(processThread.getPid());
73 } catch (Throwable t) {
74 System.out.println("TestBasic got unexpected exception: " + t);
|