2362N/A * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @summary Test that MBeanInfo.equals works even for mutable subclasses 0N/A * @author Eamonn McManus 0N/A * @run clean MBeanInfoEqualsTest 0N/A * @run build MBeanInfoEqualsTest 0N/A * @run main MBeanInfoEqualsTest 0N/A/* Test that MBeanInfo and its referenced classes implement the equals 0N/A and hashCode methods correctly. These classes include some magic 0N/A to improve performance based on the classes' immutability. The 0N/A logic checks that any subclasses encountered remain immutable, and 0N/A falls back on less performant code if not. */ 0N/A // Class just used for reflection 0N/A public boolean isB() {
return false;}
0N/A false,
true,
false),
0N/A true,
false,
false),
0N/A false,
true,
false),
0N/A "a notification info"),
0N/A "a notification info"),
0N/A "another notification info"),
0N/A "a notification info"),
0N/A "a notification info");
0N/A {
a1a,
a1b}, {
a2a,
a2b}, {
a3}, {
a4}, {
a5a,
a5b}, {
a6a,
a6b}, {
a7a,
a7b},
0N/A {
c1a,
c1b,
c1c,
c1d}, {
c2a,
c2b}, {
c3a,
c3b}, {
c4}, {
c5}, {
c6},
0N/A {
i1a,
i1b,
i1c,
i1d,
i1e,
i1f}, {
i2a,
i2b}, {
i3}, {
i4}, {
i5}, {
i6},
0N/A /* This class checks that the MBeanInfo.equals() method really 0N/A does call getClassName() etc rather than referring to its 0N/A /* The equivs array is an array of equivalence classes. The members 0N/A of each equivalence class must be equal among themselves. 0N/A Each member of each equivalence class must be different from 0N/A each member of each other equivalence class. */ 0N/A /* We could simplify this test to compare every element with every 0N/A other and choose whether they are supposed to be the same based 0N/A on whether they are in the same equivalence class. A bit 0N/A simpler, but so what. */ 0N/A "].equals(obj[" + j +
"])");
0N/A "].hashCode() != obj[" + j +
0N/A i +
"].equals(obj[" + j +
"])");