1 7 package org.jboss.test.remoting.registry; 8 9 import org.jboss.remoting.transport.Connector; 10 import org.jboss.remoting.InvokerRegistry; 11 import org.jboss.remoting.ServerInvoker; 12 import org.jboss.remoting.InvokerLocator; 13 14 import junit.framework.TestCase; 15 16 19 public class InvokerRegistryUpdateTestCase extends TestCase 20 { 21 private Connector connector; 22 private String locatorURI = "socket://localhost"; 23 24 public void setUp() throws Exception 25 { 26 connector = new Connector(); 27 connector.setInvokerLocator(locatorURI); 28 connector.create(); 29 connector.stop(); 30 } 31 32 public void tearDown() throws Exception 33 { 34 if(connector != null) 35 { 36 connector.stop(); 37 connector.destroy(); 38 } 39 } 40 41 public void testRegistryUpdate() 42 { 43 ServerInvoker[] serverInvokers = InvokerRegistry.getServerInvokers(); 44 ServerInvoker serverInvoker = serverInvokers[0]; 45 InvokerLocator locator = serverInvoker.getLocator(); 46 String locatorURI = locator.getLocatorURI(); 47 assertTrue("Invoker locator uri should have changed.", !this.locatorURI.equals(locatorURI)); 48 } 49 } | Popular Tags |