< prev index next >

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

Print this page
rev 51731 : imported patch 8210732


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  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.test.lib.process.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  * @library /test/lib
  43  * @modules java.management
  44  *          jdk.attach
  45  *          jdk.management.agent/jdk.internal.agent
  46  *
  47  * @build jdk.testlibrary.* TestManager TestApplication
  48  * @run main/othervm/timeout=300 LocalManagementTest
  49  */
  50 public class LocalManagementTest {
  51     private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
  52 
  53     public static void main(String[] args) throws Exception {
  54         int failures = 0;
  55         for(Method m : LocalManagementTest.class.getDeclaredMethods()) {
  56             if (Modifier.isStatic(m.getModifiers()) &&
  57                 m.getName().startsWith("test")) {
  58                 m.setAccessible(true);
  59                 try {
  60                     System.out.println(m.getName());
  61                     System.out.println("==========");
  62                     Boolean rslt = (Boolean)m.invoke(null);
  63                     if (!rslt) {
  64                         System.err.println(m.getName() + " failed");
  65                         failures++;
  66                     }
  67                 } catch (Exception e) {




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  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.test.lib.process.ProcessTools;
  31 import jdk.test.lib.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 /test/lib
  42  * @modules java.management
  43  *          jdk.attach
  44  *          jdk.management.agent/jdk.internal.agent
  45  *
  46  * @build 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                     }
  66                 } catch (Exception e) {


< prev index next >