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

Brian Stansberry brian.stansberry at jboss.com
Mon Jan 29 00:00:48 EST 2007


  User: bstansberry
  Date: 07/01/29 00:00:48

  Modified:    tests/functional/org/jboss/cache/eviction 
                        LRUPolicyTest.java
  Log:
  [JBCACHE-921] Test that "partially evicted" nodes eventually get fully removed
  
  Revision  Changes    Path
  1.23      +17 -1     JBossCache/tests/functional/org/jboss/cache/eviction/LRUPolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LRUPolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/LRUPolicyTest.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -b -r1.22 -r1.23
  --- LRUPolicyTest.java	11 Jan 2007 13:49:05 -0000	1.22
  +++ LRUPolicyTest.java	29 Jan 2007 05:00:48 -0000	1.23
  @@ -14,7 +14,7 @@
    *
    * @author Ben Wang, Feb 11, 2004
    * @author Daniel Huang - dhuang at jboss.org
  - * @version $Revision: 1.22 $
  + * @version $Revision: 1.23 $
    */
   public class LRUPolicyTest extends TestCase
   {
  @@ -236,6 +236,22 @@
         }
      }
   
  +   public void testCompleteRemoval() throws Exception
  +   {
  +      String rootStr = "/test/";
  +      
  +      // Add a parent, then a child. LRU will evict the parent, 
  +      // then the child, leaving behind an empty parent
  +      Fqn parent = Fqn.fromString(rootStr + "parent");
  +      cache_.put(parent, "key", "value");
  +      cache_.put(new Fqn(parent, "child"), "key", "value");
  +      
  +      // Give eviction time to run a few times, then confirm parent
  +      // is completely gone
  +      TestingUtil.sleepThread((wakeupIntervalMillis_ * 4) + 100);      
  +      assertFalse("Parent completely removed", cache_.getRoot().hasChild(parent));            
  +   }
  +
   
      class MyPutter extends Thread
      {
  
  
  



More information about the jboss-cvs-commits mailing list