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

Ron Sigal ron_sigal at yahoo.com
Tue Nov 6 22:39:22 EST 2007


  User: rsigal  
  Date: 07/11/06 22:39:22

  Modified:    src/tests/org/jboss/test/remoting/transport/socket/oneway 
                        Tag: remoting_2_x
                        OnewayConnectionManagerTestCase.java
  Log:
  JBREM-800: Replaced busy waiting on go flag with synchronized waiting.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +19 -5     JBossRemoting/src/tests/org/jboss/test/remoting/transport/socket/oneway/Attic/OnewayConnectionManagerTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: OnewayConnectionManagerTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/transport/socket/oneway/Attic/OnewayConnectionManagerTestCase.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -b -r1.1.2.6 -r1.1.2.7
  --- OnewayConnectionManagerTestCase.java	5 Nov 2007 09:16:36 -0000	1.1.2.6
  +++ OnewayConnectionManagerTestCase.java	7 Nov 2007 03:39:22 -0000	1.1.2.7
  @@ -56,7 +56,7 @@
    * JBREM-706.  It will also serve as unit test for JBREM-843.
    * 
    * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  - * @version $Revision: 1.1.2.6 $
  + * @version $Revision: 1.1.2.7 $
    * <p>
    * Copyright Jun 23, 2007
    * </p>
  @@ -70,6 +70,7 @@
      protected static Logger log = Logger.getLogger(OnewayConnectionManagerTestCase.class);
      protected static boolean firstTime = true;
      protected static boolean go;
  +   protected static Object lock = new Object();
      
      public void setUp() throws Exception
      {
  @@ -469,7 +470,12 @@
            threads[i].start();
         }
         
  +      synchronized (lock)
  +      {
         go = true;
  +         lock.notifyAll();
  +      }
  +      
         Thread.sleep(4000);
         
         // Verify first set of invocations were received.
  @@ -542,7 +548,12 @@
            threads[i].start();
         }
         
  +      synchronized (lock)
  +      {
         go = true;
  +         lock.notifyAll();
  +      }
  +      
         Thread.sleep(4000);
         
         // Verify invocations were received.
  @@ -654,9 +665,12 @@
         {
            try
            {
  +            synchronized (lock)
  +            {
               while (!go)
               {
  -               try {Thread.sleep(10);} catch (InterruptedException e) {}
  +                  try {lock.wait();} catch (InterruptedException e) {}
  +               }
               }
               
               HashMap metadata = new HashMap();
  
  
  



More information about the jboss-cvs-commits mailing list