KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > javax > management > remote > compliance > serialization > RemoteJMXSerializationTest


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package test.javax.management.remote.compliance.serialization;
10
11 import java.io.Serializable JavaDoc;
12 import java.lang.reflect.Modifier JavaDoc;
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 RemoteJMXComplianceTestCase
21 {
22    public RemoteJMXSerializationTest(String JavaDoc s)
23    {
24       super(s);
25    }
26
27    protected boolean skipClassName(String JavaDoc className)
28    {
29       boolean isStub = className.endsWith("_Stub");
30       return isStub;
31    }
32
33    protected boolean skipClass(Class JavaDoc cls)
34    {
35       if (cls.isInterface() || !Serializable JavaDoc.class.isAssignableFrom(cls) || Modifier.isAbstract(cls.getModifiers())) return true;
36       return false;
37    }
38
39    protected void checkCompliance(String JavaDoc className) throws Exception JavaDoc
40    {
41       ClassLoader JavaDoc jmxriLoader = createRemoteJMXRIWithTestsClassLoader();
42       ClassLoader JavaDoc mx4jLoader = createRemoteMX4JWithTestsClassLoader();
43
44       SerializationVerifier verifier = new SerializationVerifier("test.javax.management.remote.compliance.serialization.support.RemoteInstantiator", "test.javax.management.remote.compliance.serialization.support.RemoteComparator");
45       verifier.verifySerialization(className, jmxriLoader, mx4jLoader);
46    }
47 }
48
Popular Tags