[jbosscache-commits] JBoss Cache SVN: r7623 - core/trunk/src/test/java/org/jboss/cache/loader.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Feb 2 08:07:49 EST 2009


Author: mircea.markus
Date: 2009-02-02 08:07:49 -0500 (Mon, 02 Feb 2009)
New Revision: 7623

Modified:
   core/trunk/src/test/java/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java
Log:
made more stable

Modified: core/trunk/src/test/java/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java	2009-01-31 10:39:31 UTC (rev 7622)
+++ core/trunk/src/test/java/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java	2009-02-02 13:07:49 UTC (rev 7623)
@@ -21,7 +21,7 @@
 import org.jboss.cache.factories.UnitTestConfigurationFactory;
 import org.jboss.cache.util.TestingUtil;
 
- at Test(groups = "functional", sequential = true, testName = "loader.AsyncFileCacheLoaderTest")
+ at Test(groups = "functional", testName = "loader.AsyncFileCacheLoaderTest")
 public class AsyncFileCacheLoaderTest 
 {
    private CacheSPI<Object, Object> cache;
@@ -112,7 +112,13 @@
       {
          cache.put(fqn, "key" + i, "value1");
       }
-      Thread.sleep(1000);
+      //this happens async, so expect this will happen at a further point in time
+      long start = System.currentTimeMillis();
+      while (System.currentTimeMillis() - start < 50000)
+      {
+         if (loader.get(fqn) != null && loader.get(fqn).size() == 50) break;
+         Thread.sleep(100);
+      }
       assertEquals(50, loader.get(fqn).size());
       loader.remove(fqn);
    }
@@ -168,7 +174,13 @@
       {
          cache.put(fqn, "key" + i, "value1");
       }
-      Thread.sleep(1000);
+      //this happens async, so expect this will happen at a further point in time
+      long start = System.currentTimeMillis();
+      while (System.currentTimeMillis() - start < 50000)
+      {
+         if (loader.get(fqn) != null && loader.get(fqn).size() == 50) break;
+         Thread.sleep(100);
+      }
       assertEquals(50, loader.get(fqn).size());
       loader.remove(fqn);
    }




More information about the jbosscache-commits mailing list