| 1 package org.sapia.ubik.rmi.server; 2 3 import junit.framework.TestCase; 4 5 import org.sapia.ubik.net.TCPAddress; 6 import org.sapia.ubik.test.TestUtils; 7 8 import java.lang.reflect.Proxy ; 9 10 11 15 public class RemoteRefExTest extends TestCase { 16 20 public RemoteRefExTest(String arg0) { 21 super(arg0); 22 } 23 24 public void testSerialize() throws Exception { 25 RemoteRefEx ref = new RemoteRefEx(new OID(0), 26 new TCPAddress("localhost", 0)); 27 Object proxy = Proxy.newProxyInstance(Thread.currentThread() 28 .getContextClassLoader(), 29 TestUtils.getInterfacesFor(java.rmi.Remote .class), ref); 30 TestUtils.serialize(proxy); 31 } 32 33 public void testDeserialize() throws Exception { 34 RemoteRefEx ref = new RemoteRefEx(new OID(0), 35 new TCPAddress("localhost", 0)); 36 Object proxy = Proxy.newProxyInstance(Thread.currentThread() 37 .getContextClassLoader(), 38 TestUtils.getInterfacesFor(java.rmi.Remote .class), ref); 39 byte[] b = TestUtils.serialize(proxy); 40 proxy = TestUtils.deserialize(b); 41 } 42 } 43 | Popular Tags |