1 package org.sapia.ubik.rmi.server; 2 3 import junit.framework.TestCase; 4 5 import org.sapia.ubik.net.ServerAddress; 6 import org.sapia.ubik.net.TCPAddress; 7 8 9 18 public class RemoteRefStatelessTest extends TestCase { 19 public RemoteRefStatelessTest(String arg0) { 20 super(arg0); 21 } 22 23 public void testAddSibling() throws Exception { 24 RemoteRefStateless st = new RemoteRefStateless(); 25 ServerAddress currentAddr = new TCPAddress("current", 1); 26 OID currentOid = new OID(1); 27 RemoteRefStateless.ServiceInfo current = new RemoteRefStateless.ServiceInfo(currentAddr, 28 currentOid, false, VmId.getInstance(), true); 29 st._serviceInfos.add(current); 30 super.assertEquals(1, st.getInfos().size()); 31 32 RemoteRefStateless otherRef = new RemoteRefStateless(); 33 ServerAddress otherAddr = new TCPAddress("other", 1); 34 OID otherOid = new OID(2); 35 RemoteRefStateless.ServiceInfo other = new RemoteRefStateless.ServiceInfo(currentAddr, 36 currentOid, false, VmId.getInstance(), true); 37 st.addSibling(otherRef); 38 super.assertEquals(1, st.getInfos().size()); 39 st.addSibling(st); 40 super.assertEquals(1, st.getInfos().size()); 41 } 42 } 43 | Popular Tags |