TooManyFooTest.java revision 0
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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 6398884
* @summary Test that a method inherited from two different interfaces
* appears only once in MBeanInfo.
* @author dfuchs
* @run clean TooManyFooTest
* @run build TooManyFooTest
* @run main TooManyFooTest
*/
/**
* Class TooManyFooTest
* @author Sun Microsystems, 2005 - All rights reserved.
*/
public class TooManyFooTest {
/**
* A logger for this class.
**/
public static class NumberHolder {
}
public static class MyNumberHolder extends NumberHolder {
}
public interface Parent1 {
public int foo(); // Both in Parent1 and Parent2
// Parent2
// Concrete type in MBean
}
public interface Parent2 {
public int foo(); // Both in Parent1 and Parent2
public NumberHolder toofoofoo();
}
}
}
}
public static class Child implements ChildMBean {
public int foo() {return 0;}
}
public static class ChildMix implements ChildMXBean {
public int foo() {return 0;}
}
}
/** Creates a new instance of TooManyFooTest */
public TooManyFooTest() {
}
private static final int OPCOUNT;
private static final String[][] type_array = {
{ "foo", int.class.getName() },
};
static {
try {
}
}
}
} catch (Exception x) {
throw new ExceptionInInitializerError(x);
}
}
throws Exception {
final ObjectName childName =
final MBeanServer server =
try {
" operations here...");
} else {
}
" foos for "+name);
}
final boolean mxb =
throw new AssertionError("MXBean is not OpenMBean?");
// Sanity check
// The spec doesn't guarantee that the MBeanOperationInfo
// of an MXBean will be an OpenMBeanOperationInfo, and in
// some circumstances in our implementation it will not.
// However, in thsi tests, for all methods but foo(),
// it should.
//
if (!(mboi instanceof OpenMBeanOperationInfo))
"() is not Open?");
}
// For MXBeans, we need to compare 'exp' with the original
// type - because mboi.getReturnType() returns the OpenType
//
getFieldValue("originalType");
", expected "+exp);
throw new RuntimeException("Bad return type for "+
}
} finally {
}
}
final StandardMBean schildx =
final StandardMBean schildmx =
}
}