equal
deleted
inserted
replaced
33 import java.util.concurrent.TimeUnit; |
33 import java.util.concurrent.TimeUnit; |
34 import java.util.concurrent.atomic.AtomicReference; |
34 import java.util.concurrent.atomic.AtomicReference; |
35 |
35 |
36 /** |
36 /** |
37 * @test |
37 * @test |
38 * @library ../../../../lib/testlibrary |
38 * @library /lib/testlibrary |
39 * @bug 5016507 6173612 6319776 6342019 6484550 8004926 |
39 * @bug 5016507 6173612 6319776 6342019 6484550 8004926 |
40 * @summary Start a managed VM and test that a management tool can connect |
40 * @summary Start a managed VM and test that a management tool can connect |
41 * without connection or username/password details. |
41 * without connection or username/password details. |
42 * TestManager will attempt a connection to the address obtained from |
42 * TestManager will attempt a connection to the address obtained from |
43 * both agent properties and jvmstat buffer. |
43 * both agent properties and jvmstat buffer. |
106 ProcessBuilder builder = ProcessTools.createJavaProcessBuilder( |
106 ProcessBuilder builder = ProcessTools.createJavaProcessBuilder( |
107 "-javaagent:" + agentPath.toString() + |
107 "-javaagent:" + agentPath.toString() + |
108 "=com.sun.management.jmxremote.port=7775," + |
108 "=com.sun.management.jmxremote.port=7775," + |
109 "com.sun.management.jmxremote.authenticate=false," + |
109 "com.sun.management.jmxremote.authenticate=false," + |
110 "com.sun.management.jmxremote.ssl=false", |
110 "com.sun.management.jmxremote.ssl=false", |
|
111 "-cp", |
|
112 TEST_CLASSES, |
111 "TestApplication", |
113 "TestApplication", |
112 "-exit" |
114 "-exit" |
113 ); |
115 ); |
114 |
116 |
115 Process prc = null; |
117 Process prc = null; |
158 return Files.isRegularFile(path) && Files.isReadable(path); |
160 return Files.isRegularFile(path) && Files.isReadable(path); |
159 } |
161 } |
160 |
162 |
161 private static boolean doTest(String arg) throws Exception { |
163 private static boolean doTest(String arg) throws Exception { |
162 List<String> args = new ArrayList<>(); |
164 List<String> args = new ArrayList<>(); |
|
165 args.add("-cp"); |
|
166 args.add(TEST_CLASSES); |
|
167 |
163 if (arg != null) { |
168 if (arg != null) { |
164 args.add(arg); |
169 args.add(arg); |
165 } |
170 } |
166 args.add("TestApplication"); |
171 args.add("TestApplication"); |
167 ProcessBuilder server = ProcessTools.createJavaProcessBuilder( |
172 ProcessBuilder server = ProcessTools.createJavaProcessBuilder( |