[infinispan-commits] Infinispan SVN: r954 - in trunk/core/src/test/java/org/infinispan/loaders: dummy and 1 other directory.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Thu Oct 15 10:02:51 EDT 2009
Author: mircea.markus
Date: 2009-10-15 10:02:51 -0400 (Thu, 15 Oct 2009)
New Revision: 954
Modified:
trunk/core/src/test/java/org/infinispan/loaders/decorators/ChainingCacheLoaderTest.java
trunk/core/src/test/java/org/infinispan/loaders/dummy/DummyInMemoryCacheStore.java
Log:
fixed failing test
Modified: trunk/core/src/test/java/org/infinispan/loaders/decorators/ChainingCacheLoaderTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/decorators/ChainingCacheLoaderTest.java 2009-10-15 13:43:33 UTC (rev 953)
+++ trunk/core/src/test/java/org/infinispan/loaders/decorators/ChainingCacheLoaderTest.java 2009-10-15 14:02:51 UTC (rev 954)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -41,12 +40,12 @@
ChainingCacheStore store = new ChainingCacheStore();
CacheStoreConfig cfg;
store1 = new DummyInMemoryCacheStore();
- store1.init((cfg = new DummyInMemoryCacheStore.Cfg("instance1")), null, new TestObjectStreamMarshaller());
+ store1.init((cfg = new DummyInMemoryCacheStore.Cfg("ChainingCacheLoaderTest_instance1", false)), null, new TestObjectStreamMarshaller());
store.addCacheLoader(store1, cfg);
store2 = new DummyInMemoryCacheStore();
- store2.init((cfg = new DummyInMemoryCacheStore.Cfg("instance2")), null, new TestObjectStreamMarshaller());
+ store2.init((cfg = new DummyInMemoryCacheStore.Cfg("ChainingCacheLoaderTest_instance2", false)), null, new TestObjectStreamMarshaller());
// set store2 up for streaming
cfg.setFetchPersistentState(true);
store.addCacheLoader(store2, cfg);
Modified: trunk/core/src/test/java/org/infinispan/loaders/dummy/DummyInMemoryCacheStore.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/dummy/DummyInMemoryCacheStore.java 2009-10-15 13:43:33 UTC (rev 953)
+++ trunk/core/src/test/java/org/infinispan/loaders/dummy/DummyInMemoryCacheStore.java 2009-10-15 14:02:51 UTC (rev 954)
@@ -123,12 +123,15 @@
}
public void stop() {
- stores.remove(config.getStore());
+ if (config.isCleanBetweenRestarts()) {
+ stores.remove(config.getStore());
+ }
}
public static class Cfg extends AbstractCacheStoreConfig {
boolean debug;
String store = "__DEFAULT_STORE__";
+ boolean cleanBetweenRestarts = true;
public Cfg() {
setCacheLoaderClassName(DummyInMemoryCacheStore.class.getName());
@@ -139,6 +142,11 @@
setStore(name);
}
+ public Cfg(String name, boolean cleanBetweenRestarts) {
+ this(name);
+ this.cleanBetweenRestarts = cleanBetweenRestarts;
+ }
+
public boolean isDebug() {
return debug;
}
@@ -159,5 +167,9 @@
public Cfg clone() {
return (Cfg) super.clone();
}
+
+ public boolean isCleanBetweenRestarts() {
+ return cleanBetweenRestarts;
+ }
}
}
More information about the infinispan-commits
mailing list