35 * @library /test/lib
36 * @modules java.base/jdk.internal.misc
37 * java.compiler
38 * java.management
39 * jdk.internal.jvmstat/sun.jvmstat.monitor
40 * @run testng DynLibsTest
41 */
42
43 public class DynLibsTest {
44
45 public void run(CommandExecutor executor) {
46 OutputAnalyzer output = executor.execute("VM.dynlibs");
47
48 String osDependentBaseString = null;
49 if (Platform.isAix()) {
50 osDependentBaseString = "lib%s.so";
51 } else if (Platform.isLinux()) {
52 osDependentBaseString = "lib%s.so";
53 } else if (Platform.isOSX()) {
54 osDependentBaseString = "lib%s.dylib";
55 } else if (Platform.isSolaris()) {
56 osDependentBaseString = "lib%s.so";
57 } else if (Platform.isWindows()) {
58 osDependentBaseString = "%s.dll";
59 }
60
61 if (osDependentBaseString == null) {
62 Assert.fail("Unsupported OS");
63 }
64
65 output.shouldContain(String.format(osDependentBaseString, "jvm"));
66 output.shouldContain(String.format(osDependentBaseString, "java"));
67 output.shouldContain(String.format(osDependentBaseString, "management"));
68 }
69
70 @Test
71 public void jmx() {
72 run(new JMXExecutor());
73 }
74 }
|
35 * @library /test/lib
36 * @modules java.base/jdk.internal.misc
37 * java.compiler
38 * java.management
39 * jdk.internal.jvmstat/sun.jvmstat.monitor
40 * @run testng DynLibsTest
41 */
42
43 public class DynLibsTest {
44
45 public void run(CommandExecutor executor) {
46 OutputAnalyzer output = executor.execute("VM.dynlibs");
47
48 String osDependentBaseString = null;
49 if (Platform.isAix()) {
50 osDependentBaseString = "lib%s.so";
51 } else if (Platform.isLinux()) {
52 osDependentBaseString = "lib%s.so";
53 } else if (Platform.isOSX()) {
54 osDependentBaseString = "lib%s.dylib";
55 } else if (Platform.isWindows()) {
56 osDependentBaseString = "%s.dll";
57 }
58
59 if (osDependentBaseString == null) {
60 Assert.fail("Unsupported OS");
61 }
62
63 output.shouldContain(String.format(osDependentBaseString, "jvm"));
64 output.shouldContain(String.format(osDependentBaseString, "java"));
65 output.shouldContain(String.format(osDependentBaseString, "management"));
66 }
67
68 @Test
69 public void jmx() {
70 run(new JMXExecutor());
71 }
72 }
|