| 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 RemoteRefReliableTest extends TestCase { 16 20 public RemoteRefReliableTest(String arg0) { 21 super(arg0); 22 } 23 24 public void testSerialize() throws Exception { 25 RemoteRefReliable ref = new RemoteRefReliable(new OID(0), 26 new TCPAddress("localhost", 0)); 27 ref.setUp("ubik://somehost/someName"); 28 29 Object proxy = Proxy.newProxyInstance(Thread.currentThread() 30 .getContextClassLoader(), 31 TestUtils.getInterfacesFor(java.rmi.Remote .class), ref); 32 TestUtils.serialize(proxy); 33 } 34 35 public void testDeserialize() throws Exception { 36 RemoteRefReliable ref = new RemoteRefReliable(new OID(0), 37 new TCPAddress("localhost", 0)); 38 ref.setUp("ubik://somehost/someName"); 39 40 Object proxy = Proxy.newProxyInstance(Thread.currentThread() 41 .getContextClassLoader(), 42 TestUtils.getInterfacesFor(java.rmi.Remote .class), ref); 43 byte[] b = TestUtils.serialize(proxy); 44 proxy = TestUtils.deserialize(b); 45 } 46 } 47 | Popular Tags |