[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/eviction ...
Brian Stansberry
brian.stansberry at jboss.com
Mon Jan 29 00:24:59 EST 2007
User: bstansberry
Date: 07/01/29 00:24:59
Modified: tests/functional/org/jboss/cache/eviction Tag:
Branch_JBossCache_1_4_0 OptimisticEvictionTest.java
LRUPolicyTest.java
Log:
[JBCACHE-921] Cleanup up partially evicted nodes
Revision Changes Path
No revision
No revision
1.1.2.11 +16 -0 JBossCache/tests/functional/org/jboss/cache/eviction/OptimisticEvictionTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticEvictionTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/OptimisticEvictionTest.java,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -b -r1.1.2.10 -r1.1.2.11
--- OptimisticEvictionTest.java 9 Aug 2006 12:39:19 -0000 1.1.2.10
+++ OptimisticEvictionTest.java 29 Jan 2007 05:24:59 -0000 1.1.2.11
@@ -121,6 +121,22 @@
assertTrue("Eviction interceptor should be in interceptor chain.", found);
}
+ public void testCompleteRemoval() throws Exception
+ {
+ String rootStr = "/timeBased/";
+
+ // 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(5500);
+ assertFalse("Parent completely removed", cache.exists(parent));
+ }
+
public static void main(String[] args)
{
TestRunner.run(new TestSuite(OptimisticEvictionTest.class));
1.10.2.2 +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.10.2.1
retrieving revision 1.10.2.2
diff -u -b -r1.10.2.1 -r1.10.2.2
--- LRUPolicyTest.java 20 Jul 2006 02:28:28 -0000 1.10.2.1
+++ LRUPolicyTest.java 29 Jan 2007 05:24:59 -0000 1.10.2.2
@@ -14,7 +14,7 @@
*
* @author Ben Wang, Feb 11, 2004
* @author Daniel Huang - dhuang at jboss.org
- * @version $Revision: 1.10.2.1 $
+ * @version $Revision: 1.10.2.2 $
*/
public class LRUPolicyTest extends TestCase
{
@@ -239,6 +239,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_.exists(parent));
+ }
+
class MyPutter extends Thread
{
More information about the jboss-cvs-commits
mailing list