KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > notification > EventChannelFactoryTest


1 package org.jacorb.test.notification;
2
3 import java.util.Properties JavaDoc;
4
5 import junit.framework.Test;
6
7 import org.jacorb.notification.AbstractChannelFactory;
8 import org.omg.CosNotifyChannelAdmin.EventChannelFactory;
9 import org.omg.CosNotifyChannelAdmin.EventChannelFactoryHelper;
10
11 /**
12  * @author Alphonse Bendt
13  */

14
15 public class EventChannelFactoryTest
16     extends NotificationTestCase {
17
18     AbstractChannelFactory factory_;
19
20     ////////////////////////////////////////
21

22     public EventChannelFactoryTest (String JavaDoc name, NotificationTestCaseSetup setup){
23         super(name, setup);
24     }
25
26     ////////////////////////////////////////
27

28     public void setUpTest() throws Exception JavaDoc {
29         factory_ = AbstractChannelFactory.newFactory(new Properties JavaDoc());
30
31         factory_.activate();
32     }
33
34
35     public void tearDownTest() throws Exception JavaDoc {
36         factory_.dispose();
37     }
38
39
40     public void testGetCorbaLoc() throws Exception JavaDoc {
41         String JavaDoc _corbaLoc = factory_.getCorbaLoc();
42
43         assertNotNull(_corbaLoc);
44
45         org.omg.CORBA.Object JavaDoc obj =
46             getClientORB().string_to_object(_corbaLoc);
47
48         assertNotNull(obj);
49
50         EventChannelFactory factory =
51             EventChannelFactoryHelper.narrow(obj);
52
53         assertFalse(factory._non_existent());
54     }
55
56
57     public void testGetIOR() throws Exception JavaDoc {
58         String JavaDoc ior = factory_.getIOR();
59
60         assertNotNull(ior);
61
62         org.omg.CORBA.Object JavaDoc obj =
63             getClientORB().string_to_object(ior);
64
65         assertNotNull(obj);
66
67         EventChannelFactory factory =
68             EventChannelFactoryHelper.narrow(obj);
69
70         assertFalse(factory._non_existent());
71     }
72
73
74     public static Test suite() throws Exception JavaDoc {
75         return NotificationTestCase.suite(EventChannelFactoryTest.class);
76     }
77 }
78
Popular Tags