[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/eviction ...
Manik Surtani
msurtani at jboss.com
Thu Jan 4 00:35:41 EST 2007
User: msurtani
Date: 07/01/04 00:35:41
Modified: tests/functional/org/jboss/cache/eviction
ElementSizePolicyTest.java
Log:
Major changes around nodes, and the way they interact with the interceptor stack.
Also removed redundant methods in NodeSPI and removed the need for casting to NodeSPI in most cases.
Revision Changes Path
1.12 +10 -5 JBossCache/tests/functional/org/jboss/cache/eviction/ElementSizePolicyTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ElementSizePolicyTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/ElementSizePolicyTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- ElementSizePolicyTest.java 30 Dec 2006 19:48:45 -0000 1.11
+++ ElementSizePolicyTest.java 4 Jan 2007 05:35:41 -0000 1.12
@@ -10,6 +10,7 @@
import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.lock.IsolationLevel;
@@ -38,7 +39,9 @@
wakeupIntervalMillis = cache.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds() * 1000;
log("wakeupInterval is " + wakeupIntervalMillis);
if (wakeupIntervalMillis < 0)
+ {
fail("testEviction(): eviction thread wake up interval is illegal " + wakeupIntervalMillis);
+ }
t1_ex = t2_ex = null;
isTrue = true;
@@ -47,7 +50,7 @@
void initCaches() throws Exception
{
cache = new CacheImpl();
- cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-elementsize-eviction-service.xml")); // read in generic local xml
+ cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-elementsize-eviction-service.xml"));// read in generic local xml
cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
cache.start();
@@ -96,7 +99,7 @@
{
if (i < 6)
{
- int numElements = node.getNodeSPI().getRawData().size();
+ int numElements = ((NodeSPI) node).getDataDirect().size();
assertEquals(i + 1, numElements);
}
else
@@ -106,7 +109,7 @@
}
else
{
- assertEquals(1, node.getNodeSPI().getRawData().size());
+ assertEquals(1, ((NodeSPI) node).getDataDirect().size());
}
}
}
@@ -182,11 +185,13 @@
{
e.printStackTrace();
if (t1_ex == null)
+ {
t1_ex = e;
}
}
}
}
+ }
public void testConcurrentPutAndEvict() throws Exception
@@ -214,7 +219,7 @@
log("nodes/locks: " + cache.getNumberOfNodes() + "/" + cache.getNumberOfLocksHeld());
_sleep(1000);
if (counter > 10)
- { // run for 10 seconds
+ {// run for 10 seconds
isTrue = false;
break;
}
@@ -229,7 +234,7 @@
}
catch (InterruptedException e)
{
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ e.printStackTrace();//To change body of catch statement use File | Settings | File Templates.
}
}
More information about the jboss-cvs-commits
mailing list