1 package org.jacorb.test.notification; 2 3 import java.util.Properties ; 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 14 15 public class EventChannelFactoryTest 16 extends NotificationTestCase { 17 18 AbstractChannelFactory factory_; 19 20 22 public EventChannelFactoryTest (String name, NotificationTestCaseSetup setup){ 23 super(name, setup); 24 } 25 26 28 public void setUpTest() throws Exception { 29 factory_ = AbstractChannelFactory.newFactory(new Properties ()); 30 31 factory_.activate(); 32 } 33 34 35 public void tearDownTest() throws Exception { 36 factory_.dispose(); 37 } 38 39 40 public void testGetCorbaLoc() throws Exception { 41 String _corbaLoc = factory_.getCorbaLoc(); 42 43 assertNotNull(_corbaLoc); 44 45 org.omg.CORBA.Object 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 { 58 String ior = factory_.getIOR(); 59 60 assertNotNull(ior); 61 62 org.omg.CORBA.Object 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 { 75 return NotificationTestCase.suite(EventChannelFactoryTest.class); 76 } 77 } 78 | Popular Tags |