KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > marshall > dynamic > local > MarshallerLoadingClient


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.remoting.marshall.dynamic.local;
8
9 import org.jboss.dtf.MultipleTestRunner;
10 import org.jboss.remoting.AbstractInvokerTest;
11 import org.jboss.remoting.Client;
12 import org.jboss.remoting.InvokerLocator;
13
14 /**
15  * @author <a HREF="mailto:telrod@e2technologies.net">Tom Elrod</a>
16  */

17 public class MarshallerLoadingClient extends AbstractInvokerTest implements MarshallerLoadingConstants
18 {
19    public MarshallerLoadingClient(String JavaDoc name)
20    {
21       super(name);
22    }
23
24    public MarshallerLoadingClient(String JavaDoc name, int numberOfInstances)
25    {
26       super(name, numberOfInstances);
27    }
28
29    public MarshallerLoadingClient(String JavaDoc name, String JavaDoc transport, int port)
30    {
31       super(name, transport, port);
32    }
33
34    public MarshallerLoadingClient(String JavaDoc name, String JavaDoc transport, int port, int numberOfInstances)
35    {
36       super(name, transport, port, numberOfInstances);
37    }
38
39    public void testInvocation() throws Throwable JavaDoc
40    {
41       InvokerLocator locator = new InvokerLocator(locatorURI);
42       System.out.println("Calling remoting server with locator uri of: " + locatorURI);
43
44       Client remotingClient = new Client(locator, null);
45       Object JavaDoc response = remotingClient.invoke("Do something", null);
46       assertTrue(true);
47
48       System.out.println("Invocation response: " + response);
49    }
50
51    /**
52     * Can pass transport and port to be used as parameters.
53     * Valid transports are 'rmi' and 'socket'.
54     *
55     * @param args
56     */

57    public static void main(String JavaDoc[] args)
58    {
59       /*
60       if(args != null && args.length == 2)
61       {
62          transport = args[0];
63          port = Integer.parseInt(args[1]);
64       }
65       */

66       MarshallerLoadingClient client = new MarshallerLoadingClient(MarshallerLoadingClient.class.getName());
67
68       //DEBUG -TME
69
//client.setLogging();
70

71       try
72       {
73          MultipleTestRunner runner = new MultipleTestRunner();
74          runner.doRun(client, true);
75       }
76       catch(Throwable JavaDoc e)
77       {
78          e.printStackTrace();
79          System.exit(1);
80       }
81       System.exit(0);
82    }
83
84
85 }
Popular Tags