Author: manik.surtani(a)jboss.com
Date: 2008-07-03 16:25:29 -0400 (Thu, 03 Jul 2008)
New Revision: 6169
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/CacheLoaderTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/PassivationTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/StateTransferConcurrencyTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/StateTransferTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheLoaderTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/PassivationTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/StateTransferConcurrencyTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/StateTransferTest.java
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java
core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java
Log:
Added more MVCC tests
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/CacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/CacheLoaderTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/CacheLoaderTest.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -0,0 +1,18 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.loader.DummyInMemoryCacheLoaderTest;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "mvcc"})
+public class CacheLoaderTest extends DummyInMemoryCacheLoaderTest
+{
+ @Override
+ protected void configureCache() throws Exception
+ {
+ super.configureCache();
+ cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.MVCC);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+}
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/PassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/PassivationTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/PassivationTest.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -0,0 +1,22 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.config.CacheLoaderConfig;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.loader.DummySharedInMemoryCacheLoader;
+import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.passivation.PassivationTestsBase;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "mvcc"})
+public class PassivationTest extends PassivationTestsBase
+{
+ @Override
+ protected void configureCache() throws Exception
+ {
+ cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.MVCC);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ CacheLoaderConfig clc = getSingleCacheLoaderConfig("",
DummySharedInMemoryCacheLoader.class.getName(), "", false, true, false);
+ clc.setPassivation(true);
+ cache.getConfiguration().setCacheLoaderConfig(clc);
+ }
+}
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/StateTransferConcurrencyTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/StateTransferConcurrencyTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/StateTransferConcurrencyTest.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -0,0 +1,17 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "mvcc"})
+public class StateTransferConcurrencyTest extends
org.jboss.cache.statetransfer.StateTransferConcurrencyTest
+{
+ @Override
+ protected void additionalConfiguration(Configuration c)
+ {
+ c.setNodeLockingScheme(NodeLockingScheme.MVCC);
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+}
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/StateTransferTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/StateTransferTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/StateTransferTest.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -0,0 +1,18 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.statetransfer.StateTransfer200Test;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "mvcc"})
+public class StateTransferTest extends StateTransfer200Test
+{
+ @Override
+ protected void additionalConfiguration(Configuration c)
+ {
+ c.setNodeLockingScheme(NodeLockingScheme.MVCC);
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+}
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheLoaderTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheLoaderTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheLoaderTest.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -0,0 +1,18 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.loader.DummyInMemoryCacheLoaderTest;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "mvcc"})
+public class CacheLoaderTest extends DummyInMemoryCacheLoaderTest
+{
+ @Override
+ protected void configureCache() throws Exception
+ {
+ super.configureCache();
+ cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.MVCC);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+}
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/PassivationTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/PassivationTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/PassivationTest.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -0,0 +1,22 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.config.CacheLoaderConfig;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.loader.DummySharedInMemoryCacheLoader;
+import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.passivation.PassivationTestsBase;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "mvcc"})
+public class PassivationTest extends PassivationTestsBase
+{
+ @Override
+ protected void configureCache() throws Exception
+ {
+ cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.MVCC);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ CacheLoaderConfig clc = getSingleCacheLoaderConfig("",
DummySharedInMemoryCacheLoader.class.getName(), "", false, true, false);
+ clc.setPassivation(true);
+ cache.getConfiguration().setCacheLoaderConfig(clc);
+ }
+}
\ No newline at end of file
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/StateTransferConcurrencyTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/StateTransferConcurrencyTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/StateTransferConcurrencyTest.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -0,0 +1,17 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "mvcc"})
+public class StateTransferConcurrencyTest extends
org.jboss.cache.statetransfer.StateTransferConcurrencyTest
+{
+ @Override
+ protected void additionalConfiguration(Configuration c)
+ {
+ c.setNodeLockingScheme(NodeLockingScheme.MVCC);
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+}
\ No newline at end of file
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/StateTransferTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/StateTransferTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/StateTransferTest.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -0,0 +1,18 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.statetransfer.StateTransfer200Test;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "mvcc"})
+public class StateTransferTest extends StateTransfer200Test
+{
+ @Override
+ protected void additionalConfiguration(Configuration c)
+ {
+ c.setNodeLockingScheme(NodeLockingScheme.MVCC);
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+}
\ No newline at end of file
Modified: core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java 2008-07-03
20:11:52 UTC (rev 6168)
+++ core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -45,7 +45,7 @@
abstract public class CacheLoaderTestsBase extends AbstractCacheLoaderTestBase
{
private static final Log log = LogFactory.getLog(CacheLoaderTestsBase.class);
- CacheSPI<Object, Object> cache;
+ protected CacheSPI<Object, Object> cache;
CacheLoader loader = null;
static final Fqn<String> FQN = Fqn.fromString("/key");
private static final Fqn SUBTREE_FQN = Fqn.fromRelativeElements(FQN,
"subtree");
Modified: core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java 2008-07-03
20:11:52 UTC (rev 6168)
+++
core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -9,23 +9,19 @@
import org.jboss.cache.Modification;
import org.jboss.cache.Node;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.config.CacheLoaderConfig;
-import org.jboss.cache.config.parsing.XmlConfigurationParser;
+import org.jboss.cache.loader.AbstractCacheLoaderTestBase;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.cache.config.parsing.XmlConfigHelper;
+import org.jboss.cache.util.TestingUtil;
import org.jboss.util.stream.MarshalledValueInputStream;
import org.jboss.util.stream.MarshalledValueOutputStream;
import static org.testng.AssertJUnit.*;
-import static org.jboss.cache.factories.UnitTestCacheConfigurationFactory.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import org.w3c.dom.Element;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -44,13 +40,13 @@
* @version $Id$
*/
@Test(groups = "functional")
-abstract public class PassivationTestsBase
+abstract public class PassivationTestsBase extends AbstractCacheLoaderTestBase
{
Log log = LogFactory.getLog(getClass());
//Cache Loader fields
- CacheSPI<Object, Object> cache;
+ protected CacheSPI<Object, Object> cache;
CacheLoader loader = null;
static final Fqn<String> FQN = Fqn.fromString("/key");
Modified:
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java 2008-07-03
20:11:52 UTC (rev 6168)
+++
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java 2008-07-03
20:25:29 UTC (rev 6169)
@@ -127,6 +127,7 @@
CacheMode mode = sync ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
Configuration c = UnitTestCacheConfigurationFactory.createConfiguration(mode);
+
if (sync)
{
c.setSyncRollbackPhase(true);
@@ -145,12 +146,9 @@
{
configureCacheLoader(c, cacheLoaderClass, cacheID, cacheLoaderAsync,
fetchPersistentState);
}
- // tree.setConfiguration(c);
- //c.setLockAcquisitionTimeout(60000);
- //c.setSyncReplTimeout(60000);
+
+ additionalConfiguration(c);
CacheSPI<Object, Object> tree = (CacheSPI<Object, Object>) new
DefaultCacheFactory().createCache(c, false);
- //c.setLockAcquisitionTimeout(60000); // a whole minute?!?? Lots of state to tfr?
- //c.setSyncReplTimeout(60000);
configureMultiplexer(tree);
// Put the cache in the map before starting, so if it fails in
@@ -166,6 +164,11 @@
return tree;
}
+ protected void additionalConfiguration(Configuration c)
+ {
+ // to be overridden
+ }
+
protected void createAndActivateRegion(CacheSPI<Object, Object> c, Fqn f)
{
Region r = c.getRegion(f, true);