[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...

Manik Surtani msurtani at jboss.com
Tue Jan 30 21:40:21 EST 2007


  User: msurtani
  Date: 07/01/30 21:40:21

  Modified:    tests/functional/org/jboss/cache/buddyreplication 
                        BuddyPoolBroadcastTest.java
  Log:
  Removed dependency on concurrent.jar
  
  Revision  Changes    Path
  1.18      +6 -6      JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyPoolBroadcastTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyPoolBroadcastTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyPoolBroadcastTest.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- BuddyPoolBroadcastTest.java	30 Dec 2006 17:50:00 -0000	1.17
  +++ BuddyPoolBroadcastTest.java	31 Jan 2007 02:40:21 -0000	1.18
  @@ -6,13 +6,13 @@
    */
   package org.jboss.cache.buddyreplication;
   
  -import EDU.oswego.cs.dl.util.concurrent.Latch;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.CacheImpl;
   import org.jboss.cache.misc.TestingUtil;
   
   import java.util.Map;
  +import java.util.concurrent.CountDownLatch;
   
   /**
    * Tests basic group membership semantics
  @@ -137,7 +137,7 @@
         log.debug("Running testConcurrency");
         int numCaches = 15;
         caches = new CacheImpl[numCaches];
  -      Latch latch = new Latch();
  +      CountDownLatch latch = new CountDownLatch(1);
         CacheStarter[] starters = new CacheStarter[numCaches];
   
         for (int i = 0; i < numCaches; i++)
  @@ -149,7 +149,7 @@
   
         // now have the lot start simultaneously
         TestingUtil.sleepThread(500);
  -      latch.release();
  +      latch.countDown();
   
         // allow a generous sleep time
         TestingUtil.blockUntilViewsReceived(caches, 240000);
  @@ -168,10 +168,10 @@
   
      public class CacheStarter extends Thread
      {
  -      private Latch latch;
  +      private CountDownLatch latch;
         private CacheImpl cache;
   
  -      public CacheStarter(Latch latch, CacheImpl cache)
  +      public CacheStarter(CountDownLatch latch, CacheImpl cache)
         {
            this.latch = latch;
            this.cache = cache;
  @@ -181,7 +181,7 @@
         {
            try
            {
  -            latch.acquire();
  +            latch.await();
               cache.start();
            }
            catch (Exception e)
  
  
  



More information about the jboss-cvs-commits mailing list