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

« back to all changes in this revision

Viewing changes to src/tests/org/jboss/test/remoting/transport/socket/timeout/idle/IdleTimeoutTestServer.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.timeout.idle;
 
2
 
 
3
import org.apache.log4j.Logger;
 
4
import org.jboss.jrunit.extensions.ServerTestCase;
 
5
import org.jboss.remoting.InvokerLocator;
 
6
import org.jboss.remoting.transport.Connector;
 
7
 
 
8
/**
 
9
 * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
 
10
 */
 
11
public class IdleTimeoutTestServer extends ServerTestCase
 
12
{
 
13
   private Connector connector;
 
14
 
 
15
   private Logger logger = Logger.getRootLogger();
 
16
 
 
17
   protected String getTransport()
 
18
   {
 
19
      return "socket";
 
20
   }
 
21
   
 
22
   public static void main(String[] args) throws Throwable
 
23
   {
 
24
      IdleTimeoutTestServer rt = new IdleTimeoutTestServer();
 
25
      rt.startServer();
 
26
   }
 
27
 
 
28
   public void setUp() throws Exception
 
29
   {
 
30
      startServer();
 
31
   }
 
32
 
 
33
   public void tearDown() throws Exception
 
34
   {
 
35
      if(connector != null)
 
36
      {
 
37
         connector.stop();
 
38
         connector.destroy();
 
39
      }
 
40
   }
 
41
 
 
42
   public void startServer() throws Exception
 
43
   {
 
44
//      String locatorURI = "socket://localhost:54000/?maxPoolSize=2&timeout=60000&backlog=0";
 
45
      String locatorURI = getTransport() + "://localhost:54000/?maxPoolSize=2&backlog=0&timeout=60000&idleTimeout=5";
 
46
      InvokerLocator locator = new InvokerLocator(locatorURI);
 
47
 
 
48
      connector = new Connector();
 
49
 
 
50
      connector.setInvokerLocator(locator.getLocatorURI());
 
51
      connector.create();
 
52
 
 
53
      SampleInvocationHandler invocationHandler = new SampleInvocationHandler();
 
54
      connector.addInvocationHandler("sample", invocationHandler);
 
55
      connector.start();
 
56
   }
 
57
 
 
58
}
 
59