1
/***************************************
3
* JBoss: The OpenSource J2EE WebOS *
5
* Distributable under LGPL license. *
6
* See terms of license at gnu.org. *
8
***************************************/
9
package org.jboss.test.remoting.transporter.proxy.local;
11
import junit.framework.TestCase;
12
import org.jboss.remoting.transporter.TransporterClient;
13
import org.jboss.remoting.transporter.TransporterServer;
16
* @author <a href="mailto:tom@jboss.org">Tom Elrod</a>
18
public class Client extends TestCase
20
private TransporterServer server;
21
private DateProcessor dateProcessor;
23
public void setUp() throws Exception
25
server = TransporterServer.createTransporterServer("socket://localhost:5400", new DateProcessorImpl(), DateProcessor.class.getName());
26
dateProcessor = (DateProcessor) TransporterClient.createTransporterClient("socket://localhost:5400", DateProcessor.class);
29
public void testDateFormatting() throws Exception
31
DateConsumer consumer = (DateConsumer) TransporterClient.createTransporterClient("socket://localhost:5401", DateConsumer.class);
32
String response = consumer.consumeDate(dateProcessor);
33
System.out.println("Response from date consumer is " + response);
34
assertTrue("The DateProcessor within this jvm should have been called to format date and was not.", DateProcessorImpl.formatDateCalled);
37
public void tearDown()
39
if (dateProcessor != null)
41
TransporterClient.destroyTransporterClient(dateProcessor);
49
public static void main(String[] args)
53
Client client = new Client();
55
client.testDateFormatting();
b'\\ No newline at end of file'