[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/loader ...
Manik Surtani
msurtani at jboss.com
Wed Jul 19 04:29:19 EDT 2006
User: msurtani
Date: 06/07/19 04:29:19
Modified: tests/functional/org/jboss/cache/loader BdbjeTest.java
CacheLoaderManagerTest.java DummyCacheLoader.java
ExtendedCacheLoaderTestsBase.java
InterceptorSynchronizationTest.java
TcpCacheLoaderTest.java
Log:
Migration to new CacheLoader interface
Revision Changes Path
1.4 +4 -4 JBossCache/tests/functional/org/jboss/cache/loader/BdbjeTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BdbjeTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/BdbjeTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- BdbjeTest.java 20 Jan 2006 13:01:07 -0000 1.3
+++ BdbjeTest.java 19 Jul 2006 08:29:19 -0000 1.4
@@ -20,7 +20,7 @@
* directory. Any scratch directory will do, but beware that all files in
* the directory will be deleted by setUp().</p>
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class BdbjeTest extends TestCase {
@@ -120,7 +120,7 @@
instantiateLoader();
/* Initialize and start the loader. */
- loader.setCache(treeCache);
+ loader.setCache(treeCache.getSPI());
Properties props=new Properties();
props.setProperty("location", configStr);
loader.setConfig(props);
@@ -731,7 +731,7 @@
private void checkPreCreateExceptions()
throws Exception {
- loader.setCache(new TreeCache());
+ loader.setCache(new TreeCache().getSPI());
loader.setConfig(null);
try {
loader.start();
@@ -747,7 +747,7 @@
fail();
} catch (IllegalStateException expected) {}
- loader.setCache(new TreeCache());
+ loader.setCache(new TreeCache().getSPI());
props=new Properties();
props.setProperty("location", "directory_that_does_not_exist");
loader.setConfig(props);
1.10 +4 -4 JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderManagerTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLoaderManagerTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderManagerTest.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- CacheLoaderManagerTest.java 27 Apr 2006 15:46:25 -0000 1.9
+++ CacheLoaderManagerTest.java 19 Jul 2006 08:29:19 -0000 1.10
@@ -75,7 +75,7 @@
mgr.setConfig(cfg, null);
cl = mgr.getCacheLoader();
- Assert.assertEquals(AsyncExtendedCacheLoader.class, cl.getClass());
+ Assert.assertEquals(AsyncCacheLoader.class, cl.getClass());
}
public void testSingleCacheLoaderPassivation() throws Exception
@@ -101,7 +101,7 @@
mgr.setConfig(cfg, null);
cl = mgr.getCacheLoader();
- Assert.assertEquals(AsyncExtendedCacheLoader.class, cl.getClass());
+ Assert.assertEquals(AsyncCacheLoader.class, cl.getClass());
}
public void testSingleCacheLoaderFromXml() throws Exception
@@ -120,7 +120,7 @@
mgr.setConfig(confXml, null);
cl = mgr.getCacheLoader();
- Assert.assertEquals(AsyncExtendedCacheLoader.class, cl.getClass());
+ Assert.assertEquals(AsyncCacheLoader.class, cl.getClass());
}
public void testSingleCacheLoaderPassivationFromXml() throws Exception
@@ -195,7 +195,7 @@
mgr.setConfig(strToElement(conf), null);
cl = mgr.getCacheLoader();
- Assert.assertEquals(AsyncExtendedCacheLoader.class, cl.getClass());
+ Assert.assertEquals(AsyncCacheLoader.class, cl.getClass());
}
public void testChainingCacheLoader() throws Exception
1.3 +19 -5 JBossCache/tests/functional/org/jboss/cache/loader/DummyCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DummyCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/DummyCacheLoader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- DummyCacheLoader.java 21 Mar 2006 17:25:16 -0000 1.2
+++ DummyCacheLoader.java 19 Jul 2006 08:29:19 -0000 1.3
@@ -6,17 +6,22 @@
*/
package org.jboss.cache.loader;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.Fqn;
+import org.jboss.cache.Modification;
+import org.jboss.cache.TreeCache;
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
/**
* Dummy cache loader that captures the number of times each method is called.
*
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
*/
-public class DummyCacheLoader implements CacheLoader
+public class DummyCacheLoader extends AbstractCacheLoader
{
private int getChildrenNamesCount = 0, getCount = 0, putCount = 0, existsCount = 0, removeCount = 0;
private Map m_transactions = new HashMap();
@@ -152,7 +157,7 @@
* @param modifications A List<Modification> of modifications
* @throws Exception
*/
- public void put(List modifications) throws Exception
+ public void put(List<Modification> modifications) throws Exception
{
putCount++;
}
@@ -201,7 +206,7 @@
* we won't get a {@link #commit(Object)} or {@link #rollback(Object)} method call later
* @throws Exception
*/
- public void prepare(Object tx, List modifications, boolean one_phase) throws Exception
+ public void prepare(Object tx, List<Modification> modifications, boolean one_phase) throws Exception
{
if (one_phase) {
put(modifications);
@@ -262,6 +267,15 @@
{
}
+ public byte[] loadState(Fqn subtree) throws Exception
+ {
+ return new byte[0];
+ }
+
+ public void storeState(byte[] state, Fqn subtree) throws Exception
+ {
+ }
+
public void create() throws Exception
{
}
1.5 +2 -2 JBossCache/tests/functional/org/jboss/cache/loader/ExtendedCacheLoaderTestsBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ExtendedCacheLoaderTestsBase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/ExtendedCacheLoaderTestsBase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- ExtendedCacheLoaderTestsBase.java 24 May 2006 05:47:43 -0000 1.4
+++ ExtendedCacheLoaderTestsBase.java 19 Jul 2006 08:29:19 -0000 1.5
@@ -27,7 +27,7 @@
static final Fqn BUDDY_PLUS_SUBTREE_FQN = new Fqn(BUDDY_BASE, SUBTREE_FQN);
- ExtendedCacheLoader extendedLoader=null;
+ CacheLoader extendedLoader=null;
/**
* Create a new ExtendedCacheLoaderTestsBase.
@@ -40,7 +40,7 @@
protected void setUp() throws Exception {
super.setUp();
- extendedLoader= (ExtendedCacheLoader) loader;
+ extendedLoader = loader;
}
/**
1.2 +16 -11 JBossCache/tests/functional/org/jboss/cache/loader/InterceptorSynchronizationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InterceptorSynchronizationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/InterceptorSynchronizationTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- InterceptorSynchronizationTest.java 29 Mar 2006 20:16:39 -0000 1.1
+++ InterceptorSynchronizationTest.java 19 Jul 2006 08:29:19 -0000 1.2
@@ -4,6 +4,7 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.Modification;
import java.util.*;
@@ -70,16 +71,11 @@
* @author paulsmith
*
*/
- public class TestSlowCacheLoader implements CacheLoader {
-
+ public class TestSlowCacheLoader extends AbstractCacheLoader
+ {
public void setConfig(Properties arg0) {
}
-
- public void setCache(TreeCache arg0) {
-
- }
-
public Set getChildrenNames(Fqn arg0) throws Exception {
return null;
}
@@ -105,8 +101,8 @@
}
- public void put(List arg0) throws Exception {
-
+ public void put(List<Modification> modifications) throws Exception
+ {
}
public Object remove(Fqn arg0, Object arg1) throws Exception {
@@ -121,8 +117,8 @@
}
- public void prepare(Object arg0, List arg1, boolean arg2) throws Exception {
-
+ public void prepare(Object tx, List<Modification> modifications, boolean one_phase) throws Exception
+ {
}
public void commit(Object arg0) throws Exception {
@@ -140,6 +136,15 @@
}
+ public byte[] loadState(Fqn subtree) throws Exception
+ {
+ return new byte[0];
+ }
+
+ public void storeState(byte[] state, Fqn subtree) throws Exception
+ {
+ }
+
public void create() throws Exception {
}
1.5 +2 -2 JBossCache/tests/functional/org/jboss/cache/loader/TcpCacheLoaderTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TcpCacheLoaderTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/TcpCacheLoaderTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- TcpCacheLoaderTest.java 27 Jan 2006 15:47:17 -0000 1.4
+++ TcpCacheLoaderTest.java 19 Jul 2006 08:29:19 -0000 1.5
@@ -7,7 +7,7 @@
/**
* Tests the TcpDelegatingCacheLoader
* @author Bela Ban
- * @version $Id: TcpCacheLoaderTest.java,v 1.4 2006/01/27 15:47:17 msurtani Exp $
+ * @version $Id: TcpCacheLoaderTest.java,v 1.5 2006/07/19 08:29:19 msurtani Exp $
*/
public class TcpCacheLoaderTest extends CacheLoaderTestsBase {
static TcpCacheServer cache_server=null;
@@ -46,7 +46,7 @@
protected void configureCache() throws Exception {
cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("",
- "org.jboss.cache.loader.tcp.TcpDelegatingCacheLoader",
+ "org.jboss.cache.loader.TcpDelegatingCacheLoader",
"host=127.0.0.1\nport=12121", false, true, false));
}
More information about the jboss-cvs-commits
mailing list