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.RemoteJMXComplianceTestCase;
16:
17: /**
18: * @version $Revision: 1.4 $
19: */
20: public class RemoteJMXSerializationTest extends
21: RemoteJMXComplianceTestCase {
22: public RemoteJMXSerializationTest(String s) {
23: super (s);
24: }
25:
26: protected boolean skipClassName(String className) {
27: boolean isStub = className.endsWith("_Stub");
28: return isStub;
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 = createRemoteJMXRIWithTestsClassLoader();
41: ClassLoader mx4jLoader = createRemoteMX4JWithTestsClassLoader();
42:
43: SerializationVerifier verifier = new SerializationVerifier(
44: "test.javax.management.remote.compliance.serialization.support.RemoteInstantiator",
45: "test.javax.management.remote.compliance.serialization.support.RemoteComparator");
46: verifier
47: .verifySerialization(className, jmxriLoader, mx4jLoader);
48: }
49: }
|