KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > rmi > server > StatelessStubTableTest


1 /*
2  * StatelessStubTableTest.java
3  * JUnit based test
4  *
5  * Created on October 31, 2005, 2:18 PM
6  */

7
8 package org.sapia.ubik.rmi.server;
9
10 import junit.framework.*;
11 import java.io.IOException JavaDoc;
12 import java.lang.ref.SoftReference JavaDoc;
13 import java.lang.reflect.Proxy JavaDoc;
14 import java.util.ArrayList JavaDoc;
15 import java.util.Collections JavaDoc;
16 import java.util.HashMap JavaDoc;
17 import java.util.List JavaDoc;
18 import java.util.Map JavaDoc;
19 import javax.naming.Name JavaDoc;
20 import org.sapia.archie.impl.DefaultNameParser;
21 import org.sapia.archie.jndi.JndiNameParser;
22 import org.sapia.ubik.mcast.RemoteEvent;
23 import org.sapia.ubik.mcast.AsyncEventListener;
24 import org.sapia.ubik.mcast.EventChannel;
25 import org.sapia.ubik.rmi.naming.remote.archie.SyncPutEvent;
26
27 /**
28  *
29  * @author yduchesne
30  */

31 public class StatelessStubTableTest extends TestCase {
32   
33   public StatelessStubTableTest(String JavaDoc testName) {
34     super(testName);
35   }
36
37   protected void setUp() throws Exception JavaDoc {
38   }
39
40   protected void tearDown() throws Exception JavaDoc {
41   }
42
43   /**
44    * Test of doRegister method, of class org.sapia.ubik.rmi.server.StatelessStubTable.
45    */

46   public void testDoRegister() throws Exception JavaDoc{
47     JndiNameParser parser = new JndiNameParser(new DefaultNameParser());
48     Name JavaDoc name = parser.parse("stub");
49     RemoteRefStateless ref = new RemoteRefStateless(name, "test");
50     StatelessStubTable.doRegister(ref);
51     super.assertEquals(1, StatelessStubTable.getSiblings("test").size());
52     
53   }
54   
55 }
56
Popular Tags