test/sun/management/jmxremote/bootstrap/LocalManagementTest.java

Print this page
rev 9934 : 8043520: Serviceability tests using @library failing with java.lang.NoClassDefFoundError


  25 import java.io.IOException;
  26 import java.lang.reflect.Method;
  27 import java.lang.reflect.Modifier;
  28 import java.nio.file.FileSystem;
  29 import java.nio.file.FileSystems;
  30 import java.nio.file.Files;
  31 import java.nio.file.Path;
  32 import java.util.ArrayList;
  33 import java.util.List;
  34 import java.util.concurrent.TimeUnit;
  35 import java.util.concurrent.atomic.AtomicReference;
  36 
  37 /**
  38  * @test
  39  * @library /lib/testlibrary
  40  * @bug 5016507 6173612 6319776 6342019 6484550 8004926
  41  * @summary Start a managed VM and test that a management tool can connect
  42  *          without connection or username/password details.
  43  *          TestManager will attempt a connection to the address obtained from
  44  *          both agent properties and jvmstat buffer.
  45  * @build jdk.testlibrary.ProcessTools
  46  * @build jdk.testlibrary.Utils
  47  * @build TestManager TestApplication
  48  * @run main/othervm/timeout=300 -XX:+UsePerfData LocalManagementTest
  49  */
  50 
  51 import jdk.testlibrary.ProcessTools;
  52 import jdk.testlibrary.Utils;
  53 
  54 public class LocalManagementTest {
  55     private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
  56     private static final String TEST_JDK = System.getProperty("test.jdk");
  57     private static int MAX_GET_FREE_PORT_TRIES = 10;
  58 
  59     public static void main(String[] args) throws Exception {
  60         try {
  61             MAX_GET_FREE_PORT_TRIES = Integer.parseInt(System.getProperty("test.getfreeport.max.tries", "10"));
  62         } catch (NumberFormatException ex) {
  63         }
  64 
  65         int failures = 0;
  66         for(Method m : LocalManagementTest.class.getDeclaredMethods()) {
  67             if (Modifier.isStatic(m.getModifiers()) &&




  25 import java.io.IOException;
  26 import java.lang.reflect.Method;
  27 import java.lang.reflect.Modifier;
  28 import java.nio.file.FileSystem;
  29 import java.nio.file.FileSystems;
  30 import java.nio.file.Files;
  31 import java.nio.file.Path;
  32 import java.util.ArrayList;
  33 import java.util.List;
  34 import java.util.concurrent.TimeUnit;
  35 import java.util.concurrent.atomic.AtomicReference;
  36 
  37 /**
  38  * @test
  39  * @library /lib/testlibrary
  40  * @bug 5016507 6173612 6319776 6342019 6484550 8004926
  41  * @summary Start a managed VM and test that a management tool can connect
  42  *          without connection or username/password details.
  43  *          TestManager will attempt a connection to the address obtained from
  44  *          both agent properties and jvmstat buffer.
  45  * @build jdk.testlibrary.* TestManager TestApplication


  46  * @run main/othervm/timeout=300 -XX:+UsePerfData LocalManagementTest
  47  */
  48 
  49 import jdk.testlibrary.ProcessTools;
  50 import jdk.testlibrary.Utils;
  51 
  52 public class LocalManagementTest {
  53     private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
  54     private static final String TEST_JDK = System.getProperty("test.jdk");
  55     private static int MAX_GET_FREE_PORT_TRIES = 10;
  56 
  57     public static void main(String[] args) throws Exception {
  58         try {
  59             MAX_GET_FREE_PORT_TRIES = Integer.parseInt(System.getProperty("test.getfreeport.max.tries", "10"));
  60         } catch (NumberFormatException ex) {
  61         }
  62 
  63         int failures = 0;
  64         for(Method m : LocalManagementTest.class.getDeclaredMethods()) {
  65             if (Modifier.isStatic(m.getModifiers()) &&