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

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Nov 10 05:07:39 EST 2008


Author: mircea.markus
Date: 2008-11-10 05:07:39 -0500 (Mon, 10 Nov 2008)
New Revision: 7100

Modified:
   core/trunk/src/test/java/org/jboss/cache/eviction/FIFOPolicyTest.java
Log:
fixed intermittent failure - controlled eviction

Modified: core/trunk/src/test/java/org/jboss/cache/eviction/FIFOPolicyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/FIFOPolicyTest.java	2008-11-10 09:44:39 UTC (rev 7099)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/FIFOPolicyTest.java	2008-11-10 10:07:39 UTC (rev 7100)
@@ -33,7 +33,7 @@
  * @author Daniel Huang (dhuang at jboss.org)
  * @version $Revision$
  */
- at Test(groups = {"functional"}, sequential = true, testName = "eviction.FIFOPolicyTest")
+ at Test(groups = {"functional"}, testName = "eviction.FIFOPolicyTest")
 public class FIFOPolicyTest extends EvictionTestsBase
 {
    CacheSPI<Object, Object> cache;
@@ -61,7 +61,7 @@
    void initCaches() throws Exception
    {
       Configuration config = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
-      EvictionConfig evConfig = new EvictionConfig(new EvictionRegionConfig(Fqn.ROOT, new FIFOAlgorithmConfig(maxNodes), 2000000), 200);
+      EvictionConfig evConfig = new EvictionConfig(new EvictionRegionConfig(Fqn.ROOT, new FIFOAlgorithmConfig(maxNodes), 2000000), 0);
       evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/org/jboss/test/data"), new FIFOAlgorithmConfig(5)));
       config.setEvictionConfig(evConfig);
       config.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
@@ -127,7 +127,7 @@
       EvictionController evictionController = new EvictionController(cache);
       evictionController.startEviction();
       // wait a few secs for eviction to complete
-      TestingUtil.sleepThread(500);
+//      TestingUtil.sleepThread(500);
       assertEquals("Number of nodes", maxNodes + 2, cache.getNumberOfNodes());
       for (int i = 0; i < maxNodes; i++)
       {
@@ -154,10 +154,6 @@
    public void testNodeVisited() throws InterruptedException
    {
       String rootStr = "/org/jboss/test/data/";
-      List<Fqn> fqnsToBeEvicted = new ArrayList<Fqn>();
-      for (int i = 0; i < 5; i++) fqnsToBeEvicted.add(Fqn.fromString(rootStr + i));
-      EvictionWatcher watcher = new EvictionWatcher(cache, fqnsToBeEvicted);
-
       for (int i = 0; i < 10; i++)
       {
          String str = rootStr + i;
@@ -173,8 +169,6 @@
          }
       }
 
-      assert watcher.waitForEviction(30, TimeUnit.SECONDS) : "Eviction event not received!";
-
       EvictionController evictionController = new EvictionController(cache);
       evictionController.startEviction();
       try




More information about the jbosscache-commits mailing list