[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/transport/bisocket/ssl/timeout ...

Ron Sigal ron_sigal at yahoo.com
Fri Jan 26 02:58:08 EST 2007


  User: rsigal  
  Date: 07/01/26 02:58:08

  Added:       src/tests/org/jboss/test/remoting/transport/bisocket/ssl/timeout 
                        Tag: remoting_2_x
                        SSLBisocketPerInvocationTimeoutTestCase.java
  Log:
  JBREM-598:  Unit tests for per invocation timeout.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +49 -0     JBossRemoting/src/tests/org/jboss/test/remoting/transport/bisocket/ssl/timeout/Attic/SSLBisocketPerInvocationTimeoutTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLBisocketPerInvocationTimeoutTestCase.java
  ===================================================================
  RCS file: SSLBisocketPerInvocationTimeoutTestCase.java
  diff -N SSLBisocketPerInvocationTimeoutTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLBisocketPerInvocationTimeoutTestCase.java	26 Jan 2007 07:58:08 -0000	1.1.2.1
  @@ -0,0 +1,49 @@
  +package org.jboss.test.remoting.transport.bisocket.ssl.timeout;
  +
  +import java.lang.reflect.Field;
  +import java.util.HashMap;
  +import java.util.List;
  +
  +import org.jboss.remoting.ServerInvoker;
  +import org.jboss.remoting.transport.ClientInvoker;
  +import org.jboss.remoting.transport.socket.MicroSocketClientInvoker;
  +import org.jboss.remoting.transport.socket.SocketWrapper;
  +import org.jboss.test.remoting.timeout.SSLPerCreationInvocationTimeoutTestRoot;
  +
  +public class SSLBisocketPerInvocationTimeoutTestCase extends SSLPerCreationInvocationTimeoutTestRoot
  +{
  +   /**
  +    * This test verifies that the timeout for a socket wrapper gets reset after
  +    * an invocation with an invocation specific timeout has been executed.
  +    */
  +   public void testTimeoutReset() throws Throwable
  +   {
  +      log.info("entering " + getName());
  +      ClientInvoker invoker = client.getInvoker();
  +      assertTrue(invoker instanceof MicroSocketClientInvoker);
  +      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
  +      field.setAccessible(true);
  +      List pool = (List) field.get(invoker);
  +      // Note that an invoker is created during the connect phase.
  +      assertEquals(1, pool.size());
  +      
  +      Object response = client.invoke(NO_WAIT);
  +      assertEquals(NO_WAIT, response);
  +      assertEquals(1, pool.size());
  +      SocketWrapper socket = (SocketWrapper) pool.get(0);
  +      assertEquals(CONFIGURED_TIMEOUT, socket.getTimeout());
  +      
  +      HashMap metadata = new HashMap();
  +      metadata.put(ServerInvoker.TIMEOUT, "1000");
  +      response = client.invoke(NO_WAIT, metadata);
  +      assertEquals(NO_WAIT, response);
  +      assertEquals(1, pool.size());
  +      socket = (SocketWrapper) pool.get(0);
  +      assertEquals(CONFIGURED_TIMEOUT, socket.getTimeout());
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "sslbisocket";
  +   }
  +}
  
  
  



More information about the jboss-cvs-commits mailing list