[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/eviction ...
Manik Surtani
msurtani at jboss.com
Thu Jul 20 04:05:18 EDT 2006
User: msurtani
Date: 06/07/20 04:05:17
Modified: tests/functional/org/jboss/cache/eviction
LFUPolicyTest.java
Log:
Fixed some broken UTs to use the new xml parsers, cache factories, etc.
Revision Changes Path
1.4 +10 -8 JBossCache/tests/functional/org/jboss/cache/eviction/LFUPolicyTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LFUPolicyTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/LFUPolicyTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- LFUPolicyTest.java 5 May 2006 12:06:57 -0000 1.3
+++ LFUPolicyTest.java 20 Jul 2006 08:05:17 -0000 1.4
@@ -8,16 +8,17 @@
import junit.framework.TestCase;
import org.jboss.cache.Fqn;
-import org.jboss.cache.PropertyConfigurator;
import org.jboss.cache.TreeCache;
-import org.jboss.cache.misc.TestingUtil;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.misc.TestingUtil;
/**
* Unit tests for LFU Policy.
*
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class LFUPolicyTest extends TestCase
{
@@ -49,10 +50,11 @@
void initCaches() throws Exception
{
cache = new TreeCache();
- PropertyConfigurator config = new PropertyConfigurator();
- config.configure(cache, "META-INF/local-lfu-eviction-service.xml"); // read in generic local xml
- cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
- cache.setIsolationLevel(IsolationLevel.SERIALIZABLE);
+ XmlConfigurationParser parser = new XmlConfigurationParser();
+ Configuration c = parser.parseFile("META-INF/local-lfu-eviction-service.xml");
+ cache.setConfiguration(c);
+ c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
+ c.setIsolationLevel(IsolationLevel.SERIALIZABLE);
cache.startService();
}
@@ -308,7 +310,7 @@
public void testConcurrentPutAndEvict() throws Exception
{
- cache.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", new Integer(1));
for (int i = 0; i < 10; i++)
More information about the jboss-cvs-commits
mailing list