[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/eviction ...
Brian Stansberry
brian.stansberry at jboss.com
Sun Aug 13 16:10:11 EDT 2006
User: bstansberry
Date: 06/08/13 16:10:11
Modified: tests/functional/org/jboss/cache/eviction Tag:
Branch_JBossCache_1_4_0_MUX LRUPolicyTest.java
OptimisticEvictionTest.java
Log:
Update to 1.4.0.SP1
Revision Changes Path
No revision
No revision
1.10.4.1 +8 -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
retrieving revision 1.10.4.1
diff -u -b -r1.10 -r1.10.4.1
--- LRUPolicyTest.java 8 Jun 2006 17:37:39 -0000 1.10
+++ LRUPolicyTest.java 13 Aug 2006 20:10:11 -0000 1.10.4.1
@@ -14,7 +14,7 @@
*
* @author Ben Wang, Feb 11, 2004
* @author Daniel Huang - dhuang at jboss.org
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.10.4.1 $
*/
public class LRUPolicyTest extends TestCase
{
@@ -100,6 +100,13 @@
{
assertNotNull(cache_.get(Fqn.fromString(rootStr + i)));
}
+
+ TestingUtil.sleepThread(wakeupIntervalMillis_ *2 + 500);
+ assertNotNull(cache_.get(Fqn.fromString(rootStr + 5)));
+
+ cache_.getEvictionRegionManager().unmarkNodeCurrentlyInUse(Fqn.fromString(rootStr +5));
+ TestingUtil.sleepThread(wakeupIntervalMillis_ *2 + 500);
+ assertNull(cache_.get(Fqn.fromString(rootStr + 5)));
}
public void testEviction()
1.1.2.3.2.2 +20 -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.3.2.1
retrieving revision 1.1.2.3.2.2
diff -u -b -r1.1.2.3.2.1 -r1.1.2.3.2.2
--- OptimisticEvictionTest.java 27 Jun 2006 00:11:24 -0000 1.1.2.3.2.1
+++ OptimisticEvictionTest.java 13 Aug 2006 20:10:11 -0000 1.1.2.3.2.2
@@ -1,6 +1,8 @@
package org.jboss.cache.eviction;
import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
import org.jboss.cache.CacheException;
import org.jboss.cache.DummyTransactionManagerLookup;
import org.jboss.cache.Fqn;
@@ -87,6 +89,19 @@
assertTrue(!cache.exists("/timeBased/test"));
}
+ public void testMultEvictionOccurences() throws Exception
+ {
+ for (int i=0; i<50; i++)
+ {
+ cache.put("/testingRegion/test/" + i, "key", "value");
+ }
+
+ // allow some time for the eviction thread to finish it's work
+ TestingUtil.sleepThread(1000);
+
+ assertEquals(12, cache.getNumberOfNodes()); // root + base + num nodes in region
+ }
+
public void testInterceptorChain() throws Exception
{
List interceptors = cache.getInterceptors();
@@ -106,4 +121,9 @@
assertTrue("Eviction interceptor should be in interceptor chain.", found);
}
+ public static void main(String[] args)
+ {
+ TestRunner.run(new TestSuite(OptimisticEvictionTest.class));
+ }
+
}
More information about the jboss-cvs-commits
mailing list