01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package test.javax.management.remote.compliance.serialization;
10:
11: import java.io.Serializable;
12: import java.lang.reflect.Modifier;
13:
14: import test.javax.management.compliance.serialization.support.SerializationVerifier;
15: import test.javax.management.remote.compliance.OptionalRemoteJMXComplianceTestCase;
16:
17: /**
18: * @version $Revision: 1.5 $
19: */
20: public class OptionalRemoteJMXSerializationTest extends
21: OptionalRemoteJMXComplianceTestCase {
22: public OptionalRemoteJMXSerializationTest(String s) {
23: super (s);
24: }
25:
26: protected boolean skipClassName(String className) {
27: // For now the optional JSR 160 part is not implemented
28: return true;
29: }
30:
31: protected boolean skipClass(Class cls) {
32: if (cls.isInterface()
33: || !Serializable.class.isAssignableFrom(cls)
34: || Modifier.isAbstract(cls.getModifiers()))
35: return true;
36: return false;
37: }
38:
39: protected void checkCompliance(String className) throws Exception {
40: ClassLoader jmxriLoader = createOptionalRemoteJMXRIWithTestsClassLoader();
41: ClassLoader mx4jLoader = createRemoteMX4JWithTestsClassLoader();
42:
43: SerializationVerifier verifier = new SerializationVerifier(
44: "test.javax.management.remote.compliance.serialization.support.OptionalRemoteInstantiator",
45: "test.javax.management.remote.compliance.serialization.support.OptionalRemoteComparator");
46: verifier
47: .verifySerialization(className, jmxriLoader, mx4jLoader);
48: }
49: }
|