Author: manik.surtani(a)jboss.com
Date: 2008-07-01 10:27:02 -0400 (Tue, 01 Jul 2008)
New Revision: 6144
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/CacheAPIMVCCTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/DeletedChildResurrectionMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeAPIMVCCTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeMoveMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeReplicatedMoveMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/SyncReplMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/SyncReplTxMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheAPIMVCCTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/DeletedChildResurrectionMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeMoveMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeReplicatedMoveMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/SyncReplMvccTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/SyncReplTxMvccTest.java
Removed:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/CacheAPIMVCCTest.java
core/trunk/src/test/java/org/jboss/cache/api/mvcc/DeletedChildResurrectionMvccTest.java
Modified:
core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java
core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java
core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java
core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java
core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java
Log:
Added more MVCC tests
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java 2008-07-01
13:58:17 UTC (rev 6143)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -1,7 +1,9 @@
package org.jboss.cache.mvcc;
import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
import org.jboss.cache.NodeFactory;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.invocation.NodeInvocationDelegate;
import org.jboss.cache.optimistic.DataVersion;
@@ -50,13 +52,22 @@
protected void updateNode(DataContainer container, NodeFactory nf)
{
- // TODO: Deal with removes and moves
// TODO: Deal with creating - what if children is null?
- log.error("Backup is of type " + backup.getClass().getSimpleName());
- log.error("Node is of type " + node.getClass().getSimpleName());
- ((NodeReference) backup).setDelegate(((NodeReference) node).getDelegate());
- node = backup;
+ if (isDeleted())
+ {
+ Fqn fqn = getFqn();
+ NodeSPI parent = container.peek(fqn);
+ if (parent != null)
+ {
+ parent.removeChildDirect(fqn.getLastElement());
+ }
+ }
+ else
+ {
+ ((NodeReference) backup).setDelegate(((NodeReference) node).getDelegate());
+ node = backup;
+ }
}
public void rollbackUpdate()
Modified: core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java 2008-07-01 13:58:17 UTC
(rev 6143)
+++ core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java 2008-07-01 14:27:02 UTC
(rev 6144)
@@ -6,6 +6,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.Region;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
@@ -15,6 +16,7 @@
import org.jboss.cache.notifications.event.Event;
import org.jboss.cache.transaction.GenericTransactionManagerLookup;
import org.jboss.cache.util.CachePrinter;
+import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -35,7 +37,7 @@
@Test(groups = {"functional", "pessimistic"})
public class CacheAPITest
{
- private Cache<String, String> cache;
+ private CacheSPI<String, String> cache;
final List<String> events = new ArrayList<String>();
@BeforeMethod(alwaysRun = true)
@@ -43,16 +45,22 @@
{
// start a single cache instance
CacheFactory<String, String> cf = new DefaultCacheFactory<String,
String>();
- cache = cf.createCache("configs/local-tx.xml", false);
- cache.getConfiguration().setNodeLockingScheme(getNodeLockingScheme());
+ cache = (CacheSPI<String, String>)
cf.createCache("configs/local-tx.xml", false);
+ configure(cache.getConfiguration());
cache.start();
events.clear();
}
+ protected void configure(Configuration c)
+ {
+ c.setNodeLockingScheme(getNodeLockingScheme());
+ }
+
+
@AfterMethod(alwaysRun = true)
public void tearDown()
{
- if (cache != null) cache.stop();
+ TestingUtil.killCaches(cache);
}
protected NodeLockingScheme getNodeLockingScheme()
@@ -160,6 +168,10 @@
assertFalse(cache.getRoot().hasChild(fqn));
assertEquals(false, cache.removeNode(fqn));
+ // remove should REALLY remove though and not just mark as deleted/invalid.
+ NodeSPI n = cache.peek(fqn, true, true);
+ assert n == null;
+
System.out.println("Cache: " + CachePrinter.printCacheDetails(cache));
// Check that it's removed if it has a child
Modified: core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java 2008-07-01
13:58:17 UTC (rev 6143)
+++
core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -42,6 +42,7 @@
cache = new DefaultCacheFactory<Object,
Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL,
true), false);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
cache.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ configure(cache.getConfiguration());
cache.start();
}
@@ -51,6 +52,11 @@
TestingUtil.killCaches(cache);
}
+ protected void configure(Configuration c)
+ {
+ // to be overridden
+ }
+
public void testDeletedChildResurrection1() throws Exception
{
CacheSPI spi = (CacheSPI) cache;
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java 2008-07-01 13:58:17 UTC
(rev 6143)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java 2008-07-01 14:27:02 UTC
(rev 6144)
@@ -4,6 +4,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
import static org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC;
import org.jboss.cache.interceptors.MVCCLockingInterceptor;
@@ -48,11 +49,17 @@
// start a single cache instance
cache = (CacheSPI<Object, Object>) new
DefaultCacheFactory().createCache("configs/local-tx.xml", false);
cache.getConfiguration().setNodeLockingScheme(getNodeLockingScheme());
+ configure(cache.getConfiguration());
cache.start();
rootNode = cache.getRoot();
tm = cache.getTransactionManager();
}
+ protected void configure(Configuration c)
+ {
+ // to be overridden
+ }
+
@AfterMethod(alwaysRun = true)
public void tearDown()
{
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java 2008-07-01 13:58:17
UTC (rev 6143)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java 2008-07-01 14:27:02
UTC (rev 6144)
@@ -8,6 +8,7 @@
import org.jboss.cache.Node;
import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.config.CacheLoaderConfig;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.config.parsing.XmlConfigHelper;
import org.jboss.cache.config.parsing.element.LoadersElementParser;
@@ -49,6 +50,7 @@
// start a single cache instance
cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object,
Object>().createCache("configs/local-tx.xml", false);
cache.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ configure(cache.getConfiguration());
cache.start();
rootNode = cache.getRoot();
tm = cache.getTransactionManager();
@@ -60,6 +62,11 @@
TestingUtil.killCaches(cache);
}
+ protected void configure(Configuration c)
+ {
+ // to be overridden
+ }
+
@Test(groups = {"functional"})
public void testBasicMove()
{
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2008-07-01
13:58:17 UTC (rev 6143)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -45,6 +45,7 @@
cache1.getConfiguration().setSyncCommitPhase(true);
cache1.getConfiguration().setSyncRollbackPhase(true);
cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ configure(cache1.getConfiguration());
cache1.start();
rootNode = cache1.getRoot();
tm = cache1.getTransactionManager();
@@ -54,6 +55,7 @@
cache2.getConfiguration().setSyncCommitPhase(true);
cache2.getConfiguration().setSyncRollbackPhase(true);
cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ configure(cache2.getConfiguration());
cache2.start();
}
@@ -65,6 +67,11 @@
if (rootNode != null) rootNode = null;
}
+ protected void configure(Configuration c)
+ {
+ // to be overridden
+ }
+
public void testReplicatability()
{
nodeA = rootNode.addChild(A);
Modified: core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java 2008-07-01 13:58:17 UTC
(rev 6143)
+++ core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java 2008-07-01 14:27:02 UTC
(rev 6144)
@@ -12,6 +12,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
@@ -44,6 +45,9 @@
cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ configure(cache1.getConfiguration());
+ configure(cache2.getConfiguration());
+
cache1.start();
cache2.start();
@@ -58,6 +62,11 @@
if (cache2 != null) cache2.stop();
}
+ protected void configure(Configuration c)
+ {
+ // to be overridden
+ }
+
public void testBasicOperation()
{
assertClusterSize("Should only be 2 caches in the cluster!!!", 2);
Modified: core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java 2008-07-01 13:58:17
UTC (rev 6143)
+++ core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java 2008-07-01 14:27:02
UTC (rev 6144)
@@ -12,6 +12,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
@@ -53,6 +54,9 @@
cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ configure(cache1.getConfiguration());
+ configure(cache2.getConfiguration());
+
cache1.start();
cache2.start();
@@ -102,6 +106,11 @@
System.out.println("*** Finished tearDown()");
}
+ protected void configure(Configuration c)
+ {
+ // to be overridden
+ }
+
private TransactionManager beginTransaction(Cache<Object, Object> cache) throws
NotSupportedException, SystemException
{
TransactionManager mgr =
cache.getConfiguration().getRuntimeConfig().getTransactionManager();
Deleted: core/trunk/src/test/java/org/jboss/cache/api/mvcc/CacheAPIMVCCTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/CacheAPIMVCCTest.java 2008-07-01
13:58:17 UTC (rev 6143)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/CacheAPIMVCCTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -1,20 +0,0 @@
-package org.jboss.cache.api.mvcc;
-
-import org.jboss.cache.api.CacheAPITest;
-import org.jboss.cache.config.Configuration.NodeLockingScheme;
-import org.testng.annotations.Test;
-
-
-/**
- * MVCC version of {@link org.jboss.cache.api.CacheAPITest}
- */
-@Test(groups = {"functional", "mvcc"})
-public class CacheAPIMVCCTest extends CacheAPITest
-{
- @Override
- protected NodeLockingScheme getNodeLockingScheme()
- {
- return NodeLockingScheme.MVCC;
- }
-
-}
\ No newline at end of file
Deleted:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/DeletedChildResurrectionMvccTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/DeletedChildResurrectionMvccTest.java 2008-07-01
13:58:17 UTC (rev 6143)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/DeletedChildResurrectionMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -1,14 +0,0 @@
-package org.jboss.cache.api.mvcc;
-
-import org.jboss.cache.api.DeletedChildResurrectionTest;
-import org.jboss.cache.config.Configuration.NodeLockingScheme;
-import org.testng.annotations.Test;
-
-@Test(groups = {"functional", "mvcc"})
-public class DeletedChildResurrectionMvccTest extends DeletedChildResurrectionTest
-{
- public DeletedChildResurrectionMvccTest()
- {
- nodeLockingScheme = NodeLockingScheme.MVCC;
- }
-}
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/CacheAPIMVCCTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/CacheAPIMVCCTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/CacheAPIMVCCTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,29 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.api.CacheAPITest;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
+
+
+/**
+ * MVCC version of {@link org.jboss.cache.api.CacheAPITest}
+ */
+@Test(groups = {"functional", "mvcc"})
+public class CacheAPIMVCCTest extends CacheAPITest
+{
+ @Override
+ protected void configure(Configuration c)
+ {
+ super.configure(c);
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+
+ @Override
+ protected NodeLockingScheme getNodeLockingScheme()
+ {
+ return NodeLockingScheme.MVCC;
+ }
+
+}
\ No newline at end of file
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/DeletedChildResurrectionMvccTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/DeletedChildResurrectionMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/DeletedChildResurrectionMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,22 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.api.DeletedChildResurrectionTest;
+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 DeletedChildResurrectionMvccTest extends DeletedChildResurrectionTest
+{
+ public DeletedChildResurrectionMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+}
\ No newline at end of file
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeAPIMVCCTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeAPIMVCCTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeAPIMVCCTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,45 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.api.NodeAPITest;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.interceptors.MVCCLockingInterceptor;
+import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
+import org.jboss.cache.interceptors.PessimisticLockInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
+
+/**
+ * An MVCC version of {@link org.jboss.cache.api.NodeAPITest}
+ */
+@Test(groups = {"functional", "mvcc"})
+public class NodeAPIMVCCTest extends NodeAPITest
+{
+ protected NodeLockingScheme getNodeLockingScheme()
+ {
+ return NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+
+ protected void assertNodeLockingScheme()
+ {
+ assert cache.getConfiguration().getNodeLockingScheme() == NodeLockingScheme.MVCC;
+ boolean interceptorChainOK = false;
+
+ for (CommandInterceptor i : cache.getInterceptorChain())
+ {
+ if (i instanceof PessimisticLockInterceptor) assert false : "Not an MVCC
locking chain!!";
+ if (i instanceof OptimisticNodeInterceptor) assert false : "Not an MVCC
locking chain!!";
+ if (i instanceof MVCCLockingInterceptor) interceptorChainOK = true;
+
+ }
+
+ assert interceptorChainOK : "Not an MVCC locking chain!!";
+ }
+}
\ No newline at end of file
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeMoveMvccTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeMoveMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeMoveMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at
gnu.org.
+ */
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.api.NodeMoveAPITest;
+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 NodeMoveMvccTest extends NodeMoveAPITest
+{
+ public NodeMoveMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+}
\ No newline at end of file
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeReplicatedMoveMvccTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeReplicatedMoveMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeReplicatedMoveMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at
gnu.org.
+ */
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.api.NodeReplicatedMoveTest;
+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 NodeReplicatedMoveMvccTest extends NodeReplicatedMoveTest
+{
+ public NodeReplicatedMoveMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+}
\ No newline at end of file
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/SyncReplMvccTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/SyncReplMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/SyncReplMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,22 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.api.SyncReplTest;
+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", "jgroups", "mvcc"})
+public class SyncReplMvccTest extends SyncReplTest
+{
+ public SyncReplMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+}
\ No newline at end of file
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/SyncReplTxMvccTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/SyncReplTxMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/SyncReplTxMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,22 @@
+package org.jboss.cache.api.mvcc.read_committed;
+
+import org.jboss.cache.api.SyncReplTxTest;
+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", "jgroups", "transaction",
"mvcc"})
+public class SyncReplTxMvccTest extends SyncReplTxTest
+{
+ public SyncReplTxMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ }
+}
\ No newline at end of file
Copied:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheAPIMVCCTest.java
(from rev 6142, core/trunk/src/test/java/org/jboss/cache/api/mvcc/CacheAPIMVCCTest.java)
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheAPIMVCCTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheAPIMVCCTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,29 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.api.CacheAPITest;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
+
+
+/**
+ * MVCC version of {@link org.jboss.cache.api.CacheAPITest}
+ */
+@Test(groups = {"functional", "mvcc"})
+public class CacheAPIMVCCTest extends CacheAPITest
+{
+ @Override
+ protected void configure(Configuration c)
+ {
+ super.configure(c);
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+
+ @Override
+ protected NodeLockingScheme getNodeLockingScheme()
+ {
+ return NodeLockingScheme.MVCC;
+ }
+
+}
\ No newline at end of file
Property changes on:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/CacheAPIMVCCTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/DeletedChildResurrectionMvccTest.java
(from rev 6142,
core/trunk/src/test/java/org/jboss/cache/api/mvcc/DeletedChildResurrectionMvccTest.java)
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/DeletedChildResurrectionMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/DeletedChildResurrectionMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,22 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.api.DeletedChildResurrectionTest;
+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 DeletedChildResurrectionMvccTest extends DeletedChildResurrectionTest
+{
+ public DeletedChildResurrectionMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+}
Copied:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java
(from rev 6142, core/trunk/src/test/java/org/jboss/cache/api/mvcc/NodeAPIMVCCTest.java)
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,45 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.api.NodeAPITest;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.interceptors.MVCCLockingInterceptor;
+import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
+import org.jboss.cache.interceptors.PessimisticLockInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
+
+/**
+ * An MVCC version of {@link org.jboss.cache.api.NodeAPITest}
+ */
+@Test(groups = {"functional", "mvcc"})
+public class NodeAPIMVCCTest extends NodeAPITest
+{
+ protected NodeLockingScheme getNodeLockingScheme()
+ {
+ return NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+
+ protected void assertNodeLockingScheme()
+ {
+ assert cache.getConfiguration().getNodeLockingScheme() == NodeLockingScheme.MVCC;
+ boolean interceptorChainOK = false;
+
+ for (CommandInterceptor i : cache.getInterceptorChain())
+ {
+ if (i instanceof PessimisticLockInterceptor) assert false : "Not an MVCC
locking chain!!";
+ if (i instanceof OptimisticNodeInterceptor) assert false : "Not an MVCC
locking chain!!";
+ if (i instanceof MVCCLockingInterceptor) interceptorChainOK = true;
+
+ }
+
+ assert interceptorChainOK : "Not an MVCC locking chain!!";
+ }
+}
\ No newline at end of file
Property changes on:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeMoveMvccTest.java
(from rev 6142, core/trunk/src/test/java/org/jboss/cache/api/mvcc/NodeMoveMvccTest.java)
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeMoveMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeMoveMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at
gnu.org.
+ */
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.api.NodeMoveAPITest;
+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 NodeMoveMvccTest extends NodeMoveAPITest
+{
+ public NodeMoveMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+}
Copied:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeReplicatedMoveMvccTest.java
(from rev 6142,
core/trunk/src/test/java/org/jboss/cache/api/mvcc/NodeReplicatedMoveMvccTest.java)
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeReplicatedMoveMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeReplicatedMoveMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at
gnu.org.
+ */
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.api.NodeReplicatedMoveTest;
+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 NodeReplicatedMoveMvccTest extends NodeReplicatedMoveTest
+{
+ public NodeReplicatedMoveMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+}
Copied:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/SyncReplMvccTest.java
(from rev 6142, core/trunk/src/test/java/org/jboss/cache/api/mvcc/SyncReplMvccTest.java)
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/SyncReplMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/SyncReplMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,22 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.api.SyncReplTest;
+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", "jgroups", "mvcc"})
+public class SyncReplMvccTest extends SyncReplTest
+{
+ public SyncReplMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+}
Copied:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/SyncReplTxMvccTest.java
(from rev 6142,
core/trunk/src/test/java/org/jboss/cache/api/mvcc/SyncReplTxMvccTest.java)
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/SyncReplTxMvccTest.java
(rev 0)
+++
core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/SyncReplTxMvccTest.java 2008-07-01
14:27:02 UTC (rev 6144)
@@ -0,0 +1,22 @@
+package org.jboss.cache.api.mvcc.repeatable_read;
+
+import org.jboss.cache.api.SyncReplTxTest;
+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", "jgroups", "transaction",
"mvcc"})
+public class SyncReplTxMvccTest extends SyncReplTxTest
+{
+ public SyncReplTxMvccTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.MVCC;
+ }
+
+ @Override
+ protected void configure(Configuration c)
+ {
+ c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ }
+}