1 7 package org.jboss.test.remoting.handler.mbean; 8 9 import org.jboss.remoting.Client; 10 import org.jboss.remoting.InvokerLocator; 11 12 import junit.framework.TestCase; 13 14 17 public class ClientTest extends TestCase 18 { 19 private static String transport = "socket"; 21 private static String host = "localhost"; 22 private static int port = 5400; 23 24 private String locatorURI = null; 25 26 public void testMakeInvocation() throws Throwable 27 { 28 if(locatorURI == null) 29 { 30 locatorURI = transport + "://" + host + ":" + port; 31 } 32 InvokerLocator locator = new InvokerLocator(locatorURI); 33 System.out.println("Calling remoting server with locator uri of: " + locatorURI); 34 35 Client remotingClient = new Client(locator); 36 Object response = remotingClient.invoke("Do something"); 37 38 assertEquals(response, ServerTest.RESPONSE_VALUE); 39 40 remotingClient.disconnect(); 41 } 42 43 } | Popular Tags |