[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/loader ...
Manik Surtani
manik at jboss.org
Tue May 29 09:07:41 EDT 2007
User: msurtani
Date: 07/05/29 09:07:41
Modified: tests/functional/org/jboss/cache/loader
DummyInMemoryCacheLoader.java
Added: tests/functional/org/jboss/cache/loader
DummyInMemoryCacheLoaderTest.java
DummySharedInMemoryCacheLoader.java
Log:
created a dummy in memory CL to act as a stub for tests that assume the rpesence of a cache loader
Revision Changes Path
1.8 +3 -3 JBossCache/tests/functional/org/jboss/cache/loader/DummyInMemoryCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DummyInMemoryCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/DummyInMemoryCacheLoader.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- DummyInMemoryCacheLoader.java 29 May 2007 10:26:28 -0000 1.7
+++ DummyInMemoryCacheLoader.java 29 May 2007 13:07:41 -0000 1.8
@@ -26,9 +26,9 @@
*/
public class DummyInMemoryCacheLoader extends AbstractCacheLoader
{
- private Map<Fqn, DummyNode> nodes = new ConcurrentHashMap<Fqn, DummyNode>();
- private Log log = LogFactory.getLog(DummyInMemoryCacheLoader.class);
- private Map<Object, List<Modification>> transactions = new ConcurrentHashMap<Object, List<Modification>>();
+ protected Map<Fqn, DummyNode> nodes = new ConcurrentHashMap<Fqn, DummyNode>();
+ protected Log log = LogFactory.getLog(DummyInMemoryCacheLoader.class);
+ protected Map<Object, List<Modification>> transactions = new ConcurrentHashMap<Object, List<Modification>>();
public void setConfig(IndividualCacheLoaderConfig config)
{
1.1 date: 2007/05/29 13:07:41; author: msurtani; state: Exp;JBossCache/tests/functional/org/jboss/cache/loader/DummyInMemoryCacheLoaderTest.java
Index: DummyInMemoryCacheLoaderTest.java
===================================================================
package org.jboss.cache.loader;
/**
* Odd that we need a test for a test class, but if we intend to use the {@link org.jboss.cache.loader.DummyInMemoryCacheLoader} as a cache
* loader stub then we need to make sure it behaves as a valid cache loader.
*/
public class DummyInMemoryCacheLoaderTest extends CacheLoaderTestsBase
{
protected void configureCache() throws Exception
{
cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.DummyInMemoryCacheLoader", "", false, true, false));
}
}
1.1 date: 2007/05/29 13:07:41; author: msurtani; state: Exp;JBossCache/tests/functional/org/jboss/cache/loader/DummySharedInMemoryCacheLoader.java
Index: DummySharedInMemoryCacheLoader.java
===================================================================
package org.jboss.cache.loader;
import org.jboss.cache.Fqn;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* An extension of the {@link org.jboss.cache.loader.DummyInMemoryCacheLoader} that uses static maps for data, children,
* etc. so it can be shared across instances, emulating a shared database or filesystem cache loader.
*
* @author <a href="mailto:manik at jboss.org">Manik Surtani</a>
* @since 2.0.0
*/
public class DummySharedInMemoryCacheLoader extends DummyInMemoryCacheLoader
{
protected static final Map<Fqn, DummyNode> SHARED_NODES_MAP = new ConcurrentHashMap<Fqn, DummyNode>();
public DummySharedInMemoryCacheLoader()
{
nodes = SHARED_NODES_MAP;
}
}
More information about the jboss-cvs-commits
mailing list