# HG changeset patch # User dfuchs # Date 1212067994 -7200 # Node ID 0cacefd2642bf3839f22890194a7c3db2769f5a9 # Parent 21f34954720084679ee2340358012f6728a43931 6673853: LegacyIntrospectorTest is testing an old deprecated com.sun API not present in OpenJDK. Summary: Removed test from open test suite - the corresponding deprecated legacy API is not in open source tree Reviewed-by: emcmanus diff -r 21f349547200 -r 0cacefd2642b jdk/test/javax/management/Introspector/LegacyIntrospectorTest.java --- a/jdk/test/javax/management/Introspector/LegacyIntrospectorTest.java Fri May 23 11:13:45 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -/* - * @test - * @bug 6316460 - * @summary Test that the legacy com.sun.management.jmx.Introspector - * methods work. - * @author Eamonn McManus - * @run clean LegacyIntrospectorTest - * @run build LegacyIntrospectorTest - * @run main LegacyIntrospectorTest - */ - -import javax.management.*; -import com.sun.management.jmx.*; - -public class LegacyIntrospectorTest { - public static interface TestMBean { - public int getWhatever(); - } - public static class Test implements TestMBean { - public int getWhatever() {return 0;} - } - - @SuppressWarnings("deprecation") - public static void main(String[] args) throws Exception { - MBeanInfo mbi = Introspector.testCompliance(Test.class); - MBeanAttributeInfo mbai = mbi.getAttributes()[0]; - if (!mbai.getName().equals("Whatever")) - throw new Exception("Wrong attribute name: " + mbai.getName()); - Class c = Introspector.getMBeanInterface(Test.class); - if (c != TestMBean.class) - throw new Exception("Wrong interface: " + c); - - MBeanServer mbs1 = new MBeanServerImpl(); - if (!mbs1.getDefaultDomain().equals("DefaultDomain")) - throw new Exception("Wrong default domain: " + mbs1.getDefaultDomain()); - - MBeanServer mbs2 = new MBeanServerImpl("Foo"); - if (!mbs2.getDefaultDomain().equals("Foo")) - throw new Exception("Wrong default domain: " + mbs2.getDefaultDomain()); - - ObjectName delegateName = - new ObjectName("JMImplementation:type=MBeanServerDelegate"); - MBeanInfo delegateInfo = mbs2.getMBeanInfo(delegateName); - MBeanInfo refDelegateInfo = - MBeanServerFactory.newMBeanServer().getMBeanInfo(delegateName); - if (!delegateInfo.equals(refDelegateInfo)) - throw new Exception("Wrong delegate info from MBeanServerImpl: " + - delegateInfo); - - System.out.println("TEST PASSED"); - } -}