[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/loader ...
Manik Surtani
msurtani at jboss.com
Thu Jul 20 04:05:18 EDT 2006
User: msurtani
Date: 06/07/20 04:05:18
Modified: tests/functional/org/jboss/cache/loader
BdbjeCacheLoaderTest.java
CacheLoaderPurgingTest.java
CacheLoaderTestsBase.java JdbmCacheLoaderTest.java
SharedCacheLoaderTest.java
Log:
Fixed some broken UTs to use the new xml parsers, cache factories, etc.
Revision Changes Path
1.16 +2 -2 JBossCache/tests/functional/org/jboss/cache/loader/BdbjeCacheLoaderTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BdbjeCacheLoaderTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/BdbjeCacheLoaderTest.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- BdbjeCacheLoaderTest.java 24 Jan 2006 17:27:25 -0000 1.15
+++ BdbjeCacheLoaderTest.java 20 Jul 2006 08:05:18 -0000 1.16
@@ -9,7 +9,7 @@
/**
* Runs the same tests as {@link FileCacheLoaderTest}, but with Berkeley DB instead of a file-based CacheLoader
* @author Bela Ban
- * @version $Id: BdbjeCacheLoaderTest.java,v 1.15 2006/01/24 17:27:25 msurtani Exp $
+ * @version $Id: BdbjeCacheLoaderTest.java,v 1.16 2006/07/20 08:05:18 msurtani Exp $
*/
public class BdbjeCacheLoaderTest extends CacheLoaderTestsBase {
@@ -42,7 +42,7 @@
}
}
- cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.bdbje.BdbjeCacheLoader", "", false, true, false));
+ cache.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.bdbje.BdbjeCacheLoader", "", false, true, false));
}
public static Test suite() {
1.2 +10 -3 JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderPurgingTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLoaderPurgingTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderPurgingTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- CacheLoaderPurgingTest.java 30 May 2006 18:40:25 -0000 1.1
+++ CacheLoaderPurgingTest.java 20 Jul 2006 08:05:18 -0000 1.2
@@ -9,6 +9,7 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.xml.XmlHelper;
/**
@@ -35,7 +36,9 @@
public void testSingleLoaderNoPurge() throws Exception
{
cache = new TreeCache();
- cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp")+ "/" + "CacheLoaderPurgingTest", false, false, false));
+ Configuration c = new Configuration();
+ cache.setConfiguration(c);
+ c.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp")+ "/" + "CacheLoaderPurgingTest", false, false, false));
cache.startService();
cache.put(fqn, key, value);
@@ -57,7 +60,9 @@
public void testSingleLoaderPurge() throws Exception
{
cache = new TreeCache();
- cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp") +"/" + "CacheLoaderPurgingTest", false, false, false, true));
+ Configuration c = new Configuration();
+ cache.setConfiguration(c);
+ c.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp") +"/" + "CacheLoaderPurgingTest", false, false, false, true));
cache.startService();
cache.put(fqn, key, value);
@@ -103,7 +108,9 @@
"</cacheloader>\n" +
"</config>";
- cache.setCacheLoaderConfiguration(XmlHelper.stringToElement(xml));
+ Configuration c = new Configuration();
+ cache.setConfiguration(c);
+ c.setCacheLoaderConfiguration(XmlHelper.stringToElement(xml));
cache.startService();
cache.put(fqn, key, value);
1.25 +6 -3 JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderTestsBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLoaderTestsBase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderTestsBase.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- CacheLoaderTestsBase.java 4 May 2006 23:11:07 -0000 1.24
+++ CacheLoaderTestsBase.java 20 Jul 2006 08:05:18 -0000 1.25
@@ -1,6 +1,7 @@
package org.jboss.cache.loader;
import org.jboss.cache.*;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.transaction.DummyTransactionManager;
import org.apache.commons.logging.Log;
@@ -15,7 +16,7 @@
/**
* Commons tests for all CacheLoaders
* @author Bela Ban
- * @version $Id: CacheLoaderTestsBase.java,v 1.24 2006/05/04 23:11:07 msurtani Exp $
+ * @version $Id: CacheLoaderTestsBase.java,v 1.25 2006/07/20 08:05:18 msurtani Exp $
*/
abstract public class CacheLoaderTestsBase extends AbstractCacheLoaderTestBase {
@@ -37,8 +38,10 @@
super.setUp();
log.debug("\nTest " + getName() + "\n");
cache=new TreeCache();
- cache.setCacheMode("local");
- cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
+ Configuration c = new Configuration();
+ cache.setConfiguration(c);
+ c.setCacheMode("local");
+ c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
configureCache();
cache.startService();
loader=cache.getCacheLoader();
1.3 +2 -2 JBossCache/tests/functional/org/jboss/cache/loader/JdbmCacheLoaderTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: JdbmCacheLoaderTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/JdbmCacheLoaderTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- JdbmCacheLoaderTest.java 1 Apr 2006 00:45:38 -0000 1.2
+++ JdbmCacheLoaderTest.java 20 Jul 2006 08:05:18 -0000 1.3
@@ -9,7 +9,7 @@
/**
* Tests {@link JdbmCacheLoader}.
* @author Elias Ross
- * @version $Id: JdbmCacheLoaderTest.java,v 1.2 2006/04/01 00:45:38 genman Exp $
+ * @version $Id: JdbmCacheLoaderTest.java,v 1.3 2006/07/20 08:05:18 msurtani Exp $
*/
public class JdbmCacheLoaderTest extends ExtendedCacheLoaderTestsBase {
@@ -42,7 +42,7 @@
}
}
- cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.jdbm.JdbmCacheLoader", "", false, true, false));
+ cache.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.jdbm.JdbmCacheLoader", "", false, true, false));
}
public static Test suite() {
1.4 +6 -6 JBossCache/tests/functional/org/jboss/cache/loader/SharedCacheLoaderTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SharedCacheLoaderTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/SharedCacheLoaderTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- SharedCacheLoaderTest.java 24 Jan 2006 17:27:25 -0000 1.3
+++ SharedCacheLoaderTest.java 20 Jul 2006 08:05:18 -0000 1.4
@@ -30,11 +30,11 @@
cache1 = new TreeCache();
cache2 = new TreeCache();
- cache1.setCacheMode(TreeCache.REPL_SYNC);
- cache2.setCacheMode(TreeCache.REPL_SYNC);
+ cache1.getConfiguration().setCacheMode("REPL_SYNC");
+ cache2.getConfiguration().setCacheMode("REPL_SYNC");
- cache1.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", DummyCacheLoader.class.getName(), "", false, false, true));
- cache2.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", DummyCacheLoader.class.getName(), "", false, false, true));
+ cache1.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", DummyCacheLoader.class.getName(), "", false, false, true));
+ cache2.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", DummyCacheLoader.class.getName(), "", false, false, true));
cache1.startService();
cache2.startService();
@@ -44,8 +44,8 @@
cache1.setCacheLoader(dummyCacheLoader);
cache2.setCacheLoader(dummyCacheLoader);
- findCacheStoreInterceptor(cache1).setCache(cache1);
- findCacheStoreInterceptor(cache2).setCache(cache2);
+ findCacheStoreInterceptor(cache1).setCache(cache1.getSPI());
+ findCacheStoreInterceptor(cache2).setCache(cache2.getSPI());
}
protected CacheStoreInterceptor findCacheStoreInterceptor(TreeCache cache)
More information about the jboss-cvs-commits
mailing list