1 7 package org.jboss.test.remoting.marshall.dynamic.remote.socket; 8 9 import org.jboss.remoting.Client; 10 import org.jboss.remoting.InvokerLocator; 11 12 import junit.framework.TestCase; 13 14 17 public class MarshallerLoadingClient extends TestCase implements MarshallerLoadingConstants 18 { 19 public void testInvocation() throws Throwable 20 { 21 Client remotingClient = null; 22 23 try 25 { 26 Class.forName("org.jboss.test.remoting.marshall.dynamic.remote.socket.TestMarshaller"); 27 assertTrue("Was able to load the TestMarshaller class locally, when it should NOT be on the classpath.", false); 28 return; 29 } 30 catch(ClassNotFoundException e) 31 { 32 assertTrue("Was not able to load TestMarshaller from local classpath as expected.", true); 33 } 34 35 try 36 { 37 InvokerLocator locator = new InvokerLocator(locatorURI); 38 System.out.println("Calling remoting server with locator uri of: " + locatorURI); 39 40 remotingClient = new Client(locator, null); 41 Object response = remotingClient.invoke("Do something", null); 42 assertTrue(true); 43 44 System.out.println("Invocation response: " + response); 45 } 46 finally 47 { 48 if(remotingClient != null) 49 { 50 remotingClient.disconnect(); 51 } 52 } 53 } 54 55 } | Popular Tags |