17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
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 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.test.lib.thread.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 * @library /test/lib
45 * @modules java.management
46 * jdk.attach
47 * jdk.jartool/sun.tools.jar
48 *
49 * @run build jdk.testlibrary.* Application SimpleProvider jdk.testlibrary.*
50 * @run main/timeout=300 StartManagementAgent
51 */
52
53 /*
54 * This test is not meant to test all possible configuration parameters to
55 * the JMX agent, there are other tests for that. This test makes sure it is
56 * possible to start the agent via attach.
57 */
58 public class StartManagementAgent {
59 public static void main(String[] args) throws Throwable {
60 ProcessThread processThread = null;
61 try {
62 System.out.println("Starting test application");
63 processThread = RunnerUtil.startApplication();
64 System.out.println("Application started");
65 runTests(processThread.getPid());
66 } catch (Throwable t) {
67 System.out.println("StartManagementAgent got unexpected exception: " + t);
68 t.printStackTrace();
69 throw t;
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
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 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.test.lib.thread.ProcessThread;
37 import jdk.test.lib.Utils;
38
39 /*
40 * @test
41 * @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
42 *
43 * @library /test/lib
44 * @modules java.management
45 * jdk.attach
46 * jdk.jartool/sun.tools.jar
47 *
48 * @run build Application SimpleProvider
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();
68 throw t;
|