< prev index next >

test/javax/management/MBeanServer/OldMBeanServerTest.java

Print this page
rev 11832 : 8078896: Add @modules as needed to the jdk_svc tests
Reviewed-by: alanb, mchung
   1 /*
   2  * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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  */


  80 import javax.management.ObjectName;
  81 import javax.management.OperationsException;
  82 import javax.management.QueryEval;
  83 import javax.management.QueryExp;
  84 import javax.management.ReflectionException;
  85 import javax.management.RuntimeErrorException;
  86 import javax.management.RuntimeMBeanException;
  87 import javax.management.StandardMBean;
  88 import javax.management.loading.ClassLoaderRepository;
  89 import javax.management.remote.JMXConnector;
  90 import javax.management.remote.JMXConnectorFactory;
  91 import javax.management.remote.JMXConnectorServer;
  92 import javax.management.remote.JMXConnectorServerFactory;
  93 import javax.management.remote.JMXServiceURL;
  94 
  95 /*
  96  * @test OldMBeanServerTest.java
  97  * @bug 5072268
  98  * @summary Test that nothing assumes a post-1.2 MBeanServer
  99  * @author Eamonn McManus

 100  * @run main/othervm -ea OldMBeanServerTest
 101  */
 102 
 103 /*
 104  * We defined the MBeanServerBuilder class and the associated system
 105  * property javax.management.builder.initial in version 1.2 of the JMX
 106  * spec.  That amounts to a guarantee that someone can set the property
 107  * to an MBeanServer that only knows about JMX 1.2 semantics, and if they
 108  * only do JMX 1.2 operations, everything should work.  This test is a
 109  * sanity check that ensures we don't inadvertently make any API changes
 110  * that stop that from being true.  It includes a complete (if slow)
 111  * MBeanServer implementation.  That implementation doesn't replicate the
 112  * mandated exception behaviour everywhere, though, since there's lots of
 113  * arbitrary cruft in that.  Also, the behaviour of concurrent unregisterMBean
 114  * calls is incorrect in detail.
 115  */
 116 
 117 public class OldMBeanServerTest {
 118     private static MBeanServerConnection mbsc;
 119     private static String failure;


   1 /*
   2  * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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  */


  80 import javax.management.ObjectName;
  81 import javax.management.OperationsException;
  82 import javax.management.QueryEval;
  83 import javax.management.QueryExp;
  84 import javax.management.ReflectionException;
  85 import javax.management.RuntimeErrorException;
  86 import javax.management.RuntimeMBeanException;
  87 import javax.management.StandardMBean;
  88 import javax.management.loading.ClassLoaderRepository;
  89 import javax.management.remote.JMXConnector;
  90 import javax.management.remote.JMXConnectorFactory;
  91 import javax.management.remote.JMXConnectorServer;
  92 import javax.management.remote.JMXConnectorServerFactory;
  93 import javax.management.remote.JMXServiceURL;
  94 
  95 /*
  96  * @test OldMBeanServerTest.java
  97  * @bug 5072268
  98  * @summary Test that nothing assumes a post-1.2 MBeanServer
  99  * @author Eamonn McManus
 100  * @modules java.management
 101  * @run main/othervm -ea OldMBeanServerTest
 102  */
 103 
 104 /*
 105  * We defined the MBeanServerBuilder class and the associated system
 106  * property javax.management.builder.initial in version 1.2 of the JMX
 107  * spec.  That amounts to a guarantee that someone can set the property
 108  * to an MBeanServer that only knows about JMX 1.2 semantics, and if they
 109  * only do JMX 1.2 operations, everything should work.  This test is a
 110  * sanity check that ensures we don't inadvertently make any API changes
 111  * that stop that from being true.  It includes a complete (if slow)
 112  * MBeanServer implementation.  That implementation doesn't replicate the
 113  * mandated exception behaviour everywhere, though, since there's lots of
 114  * arbitrary cruft in that.  Also, the behaviour of concurrent unregisterMBean
 115  * calls is incorrect in detail.
 116  */
 117 
 118 public class OldMBeanServerTest {
 119     private static MBeanServerConnection mbsc;
 120     private static String failure;


< prev index next >