[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/transport/socket/oneway ...

Ron Sigal ron_sigal at yahoo.com
Sun Jul 8 01:53:42 EDT 2007


  User: rsigal  
  Date: 07/07/08 01:53:42

  Modified:    src/tests/org/jboss/test/remoting/transport/socket/oneway 
                        Tag: remoting_2_x OnewayInvocationTestCase.java
  Log:
  JBREM-684:  (1) Synchronized counter increment; (2) reduced wait to 2000 ms.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +8 -4      JBossRemoting/src/tests/org/jboss/test/remoting/transport/socket/oneway/OnewayInvocationTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: OnewayInvocationTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/transport/socket/oneway/OnewayInvocationTestCase.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -b -r1.1.2.5 -r1.1.2.6
  --- OnewayInvocationTestCase.java	3 Mar 2007 06:08:23 -0000	1.1.2.5
  +++ OnewayInvocationTestCase.java	8 Jul 2007 05:53:41 -0000	1.1.2.6
  @@ -50,7 +50,7 @@
    * returns socket to pool in the case of oneway invocations. See JBREM-684.
    * 
    * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  - * @version $Revision: 1.1.2.5 $
  + * @version $Revision: 1.1.2.6 $
    * <p>
    * Copyright Jan 22, 2007
    * </p>
  @@ -114,7 +114,7 @@
            log.info("failed on invocation: " + i + " (should be " + MAX_POOL_SIZE + ")");
         }
   
  -      Thread.sleep(4000);
  +      Thread.sleep(2000);
         assertEquals(MAX_POOL_SIZE + 10, i);
         assertEquals(MAX_POOL_SIZE + 10, handler.counter);
         client.disconnect();
  @@ -160,7 +160,7 @@
            log.info("failed on invocation: " + i + " (should be " + MAX_POOL_SIZE + ")");
         }
   
  -      Thread.sleep(4000);
  +      Thread.sleep(2000);
         assertEquals(MAX_POOL_SIZE + 10, i);
         assertEquals(MAX_POOL_SIZE + 10, handler.counter);
         client.disconnect();
  @@ -178,13 +178,17 @@
      public static class TestHandler implements ServerInvocationHandler
      {
         public int counter;
  +      private Object lock = new Object();
         
         public void setMBeanServer(MBeanServer server) {}
         public void setInvoker(ServerInvoker invoker) {}
   
         public Object invoke(InvocationRequest invocation) throws Throwable
         {
  +         synchronized(lock)
  +         {
            counter++;
  +         }
            Integer i = (Integer) invocation.getParameter();
            log.info("got invocation: " + i.intValue());
            return new Integer(i.intValue() + 1);
  
  
  



More information about the jboss-cvs-commits mailing list