< prev index next >

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

Print this page
rev 16856 : 8177374: fix module dependency declaration in jdk_svc tests
Reviewed-by: duke


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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 java.lang.reflect.Method;
  25 import java.lang.reflect.Modifier;
  26 import java.util.ArrayList;
  27 import java.util.List;
  28 import java.util.concurrent.atomic.AtomicReference;
  29 
  30 import jdk.testlibrary.ProcessTools;
  31 import jdk.testlibrary.Utils;
  32 
  33 /**
  34  * @test
  35  * @library /lib/testlibrary
  36  * @bug 5016507 6173612 6319776 6342019 6484550 8004926
  37  * @summary Start a managed VM and test that a management tool can connect
  38  *          without connection or username/password details.
  39  *          TestManager will attempt a connection to the address obtained from
  40  *          both agent properties and jvmstat buffer.


  41  * @modules jdk.management.agent/jdk.internal.agent



  42  * @build jdk.testlibrary.* TestManager TestApplication
  43  * @run main/othervm/timeout=300 LocalManagementTest
  44  */
  45 public class LocalManagementTest {
  46     private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
  47 
  48     public static void main(String[] args) throws Exception {
  49         int failures = 0;
  50         for(Method m : LocalManagementTest.class.getDeclaredMethods()) {
  51             if (Modifier.isStatic(m.getModifiers()) &&
  52                 m.getName().startsWith("test")) {
  53                 m.setAccessible(true);
  54                 try {
  55                     System.out.println(m.getName());
  56                     System.out.println("==========");
  57                     Boolean rslt = (Boolean)m.invoke(null);
  58                     if (!rslt) {
  59                         System.err.println(m.getName() + " failed");
  60                         failures++;
  61                     }




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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 java.lang.reflect.Method;
  25 import java.lang.reflect.Modifier;
  26 import java.util.ArrayList;
  27 import java.util.List;
  28 import java.util.concurrent.atomic.AtomicReference;
  29 
  30 import jdk.testlibrary.ProcessTools;
  31 import jdk.testlibrary.Utils;
  32 
  33 /**
  34  * @test

  35  * @bug 5016507 6173612 6319776 6342019 6484550 8004926
  36  * @summary Start a managed VM and test that a management tool can connect
  37  *          without connection or username/password details.
  38  *          TestManager will attempt a connection to the address obtained from
  39  *          both agent properties and jvmstat buffer.
  40  *
  41  * @library /lib/testlibrary
  42  * @modules jdk.management.agent/jdk.internal.agent
  43  *          java.management
  44  *          jdk.attach
  45  *
  46  * @build jdk.testlibrary.* TestManager TestApplication
  47  * @run main/othervm/timeout=300 LocalManagementTest
  48  */
  49 public class LocalManagementTest {
  50     private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
  51 
  52     public static void main(String[] args) throws Exception {
  53         int failures = 0;
  54         for(Method m : LocalManagementTest.class.getDeclaredMethods()) {
  55             if (Modifier.isStatic(m.getModifiers()) &&
  56                 m.getName().startsWith("test")) {
  57                 m.setAccessible(true);
  58                 try {
  59                     System.out.println(m.getName());
  60                     System.out.println("==========");
  61                     Boolean rslt = (Boolean)m.invoke(null);
  62                     if (!rslt) {
  63                         System.err.println(m.getName() + " failed");
  64                         failures++;
  65                     }


< prev index next >