~ubuntu-branches/ubuntu/raring/libjboss-remoting-java/raring

« back to all changes in this revision

Viewing changes to tests/org/jboss/test/remoting/transport/socket/stress/SocketInvokerServerTest.java

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-09 14:01:03 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: package-import@ubuntu.com-20110909140103-hqokx61534tas9rg
Tags: 2.5.3.SP1-1
* Newer but not newest upstream release. Do not build samples.
* Change debian/watch to upstream's svn repo.
* Add patch to fix compile error caused by tomcat update.
  (Closes: #628303)
* Switch to source format 3.0.
* Switch to debhelper level 7.
* Remove useless Depends.
* Update Standards-Version: 3.9.2.
* Update README.source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package org.jboss.test.remoting.transport.socket.stress;
2
 
 
3
 
import org.apache.log4j.Level;
4
 
import org.jboss.remoting.InvocationRequest;
5
 
import org.jboss.remoting.InvokerLocator;
6
 
import org.jboss.remoting.ServerInvocationHandler;
7
 
import org.jboss.remoting.ServerInvoker;
8
 
import org.jboss.remoting.callback.InvokerCallbackHandler;
9
 
import org.jboss.remoting.transport.Connector;
10
 
 
11
 
import javax.management.MBeanServer;
12
 
 
13
 
/**
14
 
 * @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
15
 
 */
16
 
public class SocketInvokerServerTest
17
 
{
18
 
   private Connector connector = null;
19
 
 
20
 
   private int maxPoolSize = 300;
21
 
//   private int maxPoolSize = 1000;
22
 
 
23
 
   public String getTransport()
24
 
   {
25
 
      return "socket";
26
 
   }
27
 
 
28
 
   public void setUp() throws Exception
29
 
   {
30
 
      InvokerLocator locator = new InvokerLocator(getTransport() + "://" + "localhost" + ":" + 6700 + "/?" +
31
 
                                                  "MaxPoolSize=" + maxPoolSize);
32
 
      connector = new Connector(locator);
33
 
      connector.create();
34
 
 
35
 
      connector.addInvocationHandler("test", new TestInvocationHandler());
36
 
 
37
 
      connector.start();
38
 
   }
39
 
 
40
 
   public void tearDown()
41
 
   {
42
 
      if(connector != null)
43
 
      {
44
 
         connector.stop();
45
 
         connector.destroy();
46
 
      }
47
 
   }
48
 
 
49
 
   public static void main(String[] args)
50
 
   {
51
 
      org.apache.log4j.BasicConfigurator.configure();
52
 
      org.apache.log4j.Category.getRoot().setLevel(Level.INFO);
53
 
 
54
 
      SocketInvokerServerTest server = new SocketInvokerServerTest();
55
 
      try
56
 
      {
57
 
         server.setUp();
58
 
//         Thread.currentThread().sleep(300000);
59
 
         Thread.currentThread().sleep(7200000);
60
 
         server.tearDown();
61
 
         System.out.println("Have torn down test.");
62
 
      }
63
 
      catch(Exception e)
64
 
      {
65
 
         e.printStackTrace();
66
 
      }
67
 
   }
68
 
 
69
 
   public class TestInvocationHandler implements ServerInvocationHandler
70
 
   {
71
 
 
72
 
      public void setMBeanServer(MBeanServer server)
73
 
      {
74
 
         //TODO: -TME Implement
75
 
      }
76
 
 
77
 
      public void setInvoker(ServerInvoker invoker)
78
 
      {
79
 
         //TODO: -TME Implement
80
 
      }
81
 
 
82
 
      public Object invoke(InvocationRequest invocation) throws Throwable
83
 
      {
84
 
         return invocation.getParameter();
85
 
      }
86
 
 
87
 
      public void addListener(InvokerCallbackHandler callbackHandler)
88
 
      {
89
 
         //TODO: -TME Implement
90
 
      }
91
 
 
92
 
      public void removeListener(InvokerCallbackHandler callbackHandler)
93
 
      {
94
 
         //TODO: -TME Implement
95
 
      }
96
 
   }
97
 
 
98
 
}