/*
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6204469
* @summary Check that descriptors have not broken serial interop.
* @author Eamonn McManus
* @run clean MBeanInfoInteropTest SerializedInfo
* @run build MBeanInfoInteropTest SerializedInfo
* @run main MBeanInfoInteropTest SerializedInfo
*/
/*
* When run with just a classname argument ("SerializedInfo" above),
* this reads the serialized objects from that class.
* When run with the argument "generate" and a classname, say "SerializedInfo",
* this creates the class SerializedInfo.java. The idea is to do that on JDK 5.0
* then run this test on the latest JDK, or vice versa. The
* copy included in this source directory was generated on JDK 5.0
* so that we continue to check forward interop (serialize on JDK 5,
* deserialize on JDK 6). There is no easy way to automate backward
* interop checking.
*/
public class MBeanInfoInteropTest {
else {
"Usage: MBeanInfoInteropTest [generate] ClassName";
}
}
boolean matched = true;
for (Serializable s : objects) {
if (!o.equals(s)) {
showMismatch(o, s);
matched = false;
}
}
if (!matched)
throw new Exception("Read objects did not match");
}
throws Exception {
continue;
if (x == expected) {
break;
}
}
}
for (Serializable s : objects)
oos.writeObject(s);
"// Generated by: MBeanInfoInteropTest generate %s\n" +
"import java.io.*;\n" +
"public class %s {\n" +
byte b = bytes[i];
if (i % 16 == 15)
}
"};\n" +
"}\n");
}
static {
try {
init();
} catch (Exception e) {
throw new IllegalArgumentException("unexpected", e);
}
}
mbai =
mbpi =
mbci1 =
mbci2 =
mbni1 =
mbni2 =
mboi1 =
mboi2 =
mbi1 =
mbi2 =
new MBeanInfo(
"class", "descr",
new MBeanAttributeInfo[] {mbai},
ombai1 =
true, false, false);
ombai2 =
true, false, false, 5);
ombai3 =
true, false, false, 5, 1, 6);
ombai4 =
true, false, false, 5,
ombpi1 =
ombpi2 =
ombpi3 =
ombpi4 =
ombci1 =
ombci2 =
omboi1 =
omboi2 =
ombi1 =
ombi2 =
new OpenMBeanInfoSupport(
"class", "descr",
"name=name", "descriptorType=attribute",
});
mmbai1 =
true, false, false);
mmbai2 =
true, false, false, attrd);
"name=name", "descriptorType=operation", "role=constructor",
});
mmbci1 =
mmbci2 =
mmbci3 =
mmbci4 =
"name=name", "descriptorType=operation",
});
mmboi1 =
mmboi2 =
operd);
mmboi3 =
mmboi4 =
operd);
"name=name", "descriptorType=notification",
});
mmbni1 =
mmbni2 =
mmbni3 =
mmbni4 =
"descr", notifd);
"name=name", "descriptorType=mbean",
});
mmbi1 =
mmbi2 =
mbeand);
mmbi3 =
"class", "descr",
mmbi4 =
"class", "descr",
mbeand);
objects = new Serializable[] {
};
}
}