22 */
23
24 import com.sun.tools.attach.AttachOperationFailedException;
25 import com.sun.tools.attach.VirtualMachine;
26
27 import java.io.File;
28 import java.io.FileWriter;
29 import java.util.Properties;
30 import java.util.HashMap;
31
32 import javax.management.remote.JMXServiceURL;
33 import javax.management.remote.JMXConnector;
34 import javax.management.remote.JMXConnectorFactory;
35
36 import jdk.testlibrary.ProcessThread;
37 import jdk.testlibrary.Utils;
38
39 /*
40 * @test
41 * @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
42 * @modules jdk.jartool/sun.tools.jar
43 * @library /lib/testlibrary
44 * @modules jdk.management.agent
45 * jdk.attach
46 * jdk.jartool/sun.tools.jar
47 * @run build Application SimpleProvider jdk.testlibrary.*
48 * @run main/timeout=300 StartManagementAgent
49 */
50
51 /*
52 * This test is not meant to test all possible configuration parameters to
53 * the JMX agent, there are other tests for that. This test makes sure it is
54 * possible to start the agent via attach.
55 */
56 public class StartManagementAgent {
57 public static void main(String[] args) throws Throwable {
58 ProcessThread processThread = null;
59 try {
60 System.out.println("Starting test application");
61 processThread = RunnerUtil.startApplication();
62 System.out.println("Application started");
63 runTests(processThread.getPid());
64 } catch (Throwable t) {
65 System.out.println("StartManagementAgent got unexpected exception: " + t);
66 t.printStackTrace();
|
22 */
23
24 import com.sun.tools.attach.AttachOperationFailedException;
25 import com.sun.tools.attach.VirtualMachine;
26
27 import java.io.File;
28 import java.io.FileWriter;
29 import java.util.Properties;
30 import java.util.HashMap;
31
32 import javax.management.remote.JMXServiceURL;
33 import javax.management.remote.JMXConnector;
34 import javax.management.remote.JMXConnectorFactory;
35
36 import jdk.testlibrary.ProcessThread;
37 import jdk.testlibrary.Utils;
38
39 /*
40 * @test
41 * @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
42 *
43 * @library /lib/testlibrary
44 * @modules jdk.management.agent
45 * jdk.attach
46 * jdk.jartool/sun.tools.jar
47 *
48 * @run build Application SimpleProvider jdk.testlibrary.*
49 * @run main/timeout=300 StartManagementAgent
50 */
51
52 /*
53 * This test is not meant to test all possible configuration parameters to
54 * the JMX agent, there are other tests for that. This test makes sure it is
55 * possible to start the agent via attach.
56 */
57 public class StartManagementAgent {
58 public static void main(String[] args) throws Throwable {
59 ProcessThread processThread = null;
60 try {
61 System.out.println("Starting test application");
62 processThread = RunnerUtil.startApplication();
63 System.out.println("Application started");
64 runTests(processThread.getPid());
65 } catch (Throwable t) {
66 System.out.println("StartManagementAgent got unexpected exception: " + t);
67 t.printStackTrace();
|