JBoss Cache SVN: r6100 - core/trunk/src/main/java/org/jboss/cache/config.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-27 12:00:32 -0400 (Fri, 27 Jun 2008)
New Revision: 6100
Modified:
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
Log:
Typo
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-06-27 15:37:00 UTC (rev 6099)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-06-27 16:00:32 UTC (rev 6100)
@@ -96,7 +96,7 @@
*/
public boolean isInvalidation()
{
- return this == INVALIDATION_SYNC || this == INVALIDATION_SYNC;
+ return this == INVALIDATION_SYNC || this == INVALIDATION_ASYNC;
}
public boolean isSynchronous()
16 years, 6 months
JBoss Cache SVN: r6099 - core/branches/2.2.X/src/test/java/org/jboss/cache/commands/write.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-27 11:37:00 -0400 (Fri, 27 Jun 2008)
New Revision: 6099
Modified:
core/branches/2.2.X/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java
Log:
Fixed test
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java 2008-06-27 15:16:41 UTC (rev 6098)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java 2008-06-27 15:37:00 UTC (rev 6099)
@@ -1,16 +1,17 @@
package org.jboss.cache.commands.write;
-import static org.easymock.EasyMock.*;
+import static org.easymock.EasyMock.createStrictControl;
+import static org.easymock.EasyMock.expect;
import org.easymock.IMocksControl;
-import org.testng.annotations.Test;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
import org.jboss.cache.commands.read.AbstractDataCommandTest;
+import org.jboss.cache.mock.MockNodesFixture;
import org.jboss.cache.notifications.Notifier;
-import org.jboss.cache.mock.MockNodesFixture;
-import org.jboss.cache.DataContainer;
-import org.jboss.cache.Fqn;
+import org.testng.annotations.Test;
+import java.util.ArrayList;
import java.util.List;
-import java.util.ArrayList;
/**
* tester class for {@link EvictCommand}
@@ -39,7 +40,7 @@
public void testResidentNodesEviction()
{
nodes.abNode.setResident(true);
- expect(container.peek(testFqn, false,false)).andReturn(nodes.abNode);
+ expect(container.peek(testFqn, false, true)).andReturn(nodes.abNode);
control.replay();
assert Boolean.TRUE == command.perform(ctx);
control.verify();
@@ -47,7 +48,7 @@
public void testSimpleEviction()
{
- expect(container.peek(testFqn, false,false)).andReturn(nodes.abNode);
+ expect(container.peek(testFqn, false, true)).andReturn(nodes.abNode);
notifier.notifyNodeEvicted(testFqn, true, ctx);
expect(container.evict(testFqn)).andReturn(true);
notifier.notifyNodeEvicted(testFqn, false, ctx);
@@ -62,7 +63,7 @@
nodesToEvict.add(nodes.a);
nodesToEvict.add(nodes.ab);
command.setRecursive(true);
- expect(container.peek(testFqn, false,false)).andReturn(nodes.aNode);
+ expect(container.peek(testFqn, false, true)).andReturn(nodes.aNode);
expect(container.getNodesForEviction(testFqn, true)).andReturn(nodesToEvict);
control.checkOrder(false);
16 years, 6 months
JBoss Cache SVN: r6098 - core/trunk/src/main/java/org/jboss/cache/lock.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-27 11:16:41 -0400 (Fri, 27 Jun 2008)
New Revision: 6098
Modified:
core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java
Log:
Vague support for some APIs.
Modified: core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java 2008-06-27 14:23:54 UTC (rev 6097)
+++ core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java 2008-06-27 15:16:41 UTC (rev 6098)
@@ -12,11 +12,13 @@
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.invocation.InvocationContextContainer;
+import static org.jboss.cache.lock.LockType.READ;
import org.jboss.cache.util.concurrent.locks.OwnableReentrantLock;
import javax.transaction.TransactionManager;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.Set;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -75,16 +77,10 @@
internalFqns = cache.getInternalFqns();
}
-
- protected void assertIsWriteLock(LockType lockType)
+ public boolean lock(Fqn fqn, LockType lockType, Object owner) throws InterruptedException
{
- if (lockType != LockType.WRITE)
- throw new UnsupportedOperationException(getClass().getName() + " only supports write locks.");
- }
+ if (lockType == READ) return true; // we don't support read locks. TODO: enforce this with an assertion
- public boolean lock(Fqn fqn, LockType lockType, Object owner) throws InterruptedException
- {
- assertIsWriteLock(lockType);
if (trace) log.trace("Attempting to lock " + fqn);
Lock lock = lockContainer.getLock(fqn);
return lock.tryLock(lockAcquisitionTimeout, MILLISECONDS);
@@ -92,7 +88,8 @@
public boolean lock(Fqn fqn, LockType lockType, Object owner, long timeoutMillis) throws InterruptedException
{
- assertIsWriteLock(lockType);
+ if (lockType == READ) return true; // we don't support read locks. TODO: enforce this with an assertion
+
if (trace) log.trace("Attempting to lock " + fqn);
Lock lock = lockContainer.getLock(fqn);
return lock.tryLock(timeoutMillis, MILLISECONDS);
@@ -100,7 +97,8 @@
public boolean lockAndRecord(Fqn fqn, LockType lockType, InvocationContext ctx) throws InterruptedException
{
- assertIsWriteLock(lockType);
+ if (lockType == READ) return true; // we don't support read locks. TODO: enforce this with an assertion
+
if (trace) log.trace("Attempting to lock " + fqn);
Lock lock = lockContainer.getLock(fqn);
if (lock.tryLock(ctx.getLockAcquisitionTimeout(lockAcquisitionTimeout), MILLISECONDS))
@@ -186,25 +184,25 @@
public boolean lockAll(NodeSPI node, LockType lockType, Object owner) throws InterruptedException
{
- assertIsWriteLock(lockType);
+ if (lockType == READ) return true; // we don't support read locks. TODO: enforce this with an assertion
return lockRecursively(node, lockAcquisitionTimeout, false, null);
}
public boolean lockAll(NodeSPI node, LockType lockType, Object owner, long timeout) throws InterruptedException
{
- assertIsWriteLock(lockType);
+ if (lockType == READ) return true; // we don't support read locks. TODO: enforce this with an assertion
return lockRecursively(node, timeout, false, null);
}
public boolean lockAll(NodeSPI node, LockType lockType, Object owner, long timeout, boolean excludeInternalFqns) throws InterruptedException
{
- assertIsWriteLock(lockType);
+ if (lockType == READ) return true; // we don't support read locks. TODO: enforce this with an assertion
return lockRecursively(node, timeout, excludeInternalFqns, null);
}
public boolean lockAllAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx) throws InterruptedException
{
- assertIsWriteLock(lockType);
+ if (lockType == READ) return true; // we don't support read locks. TODO: enforce this with an assertion
return lockRecursively(node, ctx.getLockAcquisitionTimeout(lockAcquisitionTimeout), false, ctx);
}
@@ -232,7 +230,7 @@
public boolean ownsLock(Fqn fqn, LockType lockType, Object owner)
{
- assertIsWriteLock(lockType);
+ if (lockType == READ) return false; // we don't support read locks. TODO: enforce this with an assertion
return lockContainer.ownsLock(fqn, owner);
}
@@ -248,18 +246,32 @@
public boolean isLocked(NodeSPI n, LockType lockType)
{
- assertIsWriteLock(lockType);
+ if (lockType == READ) return false; // we don't support read locks. TODO: enforce this with an assertion
return lockContainer.isLocked(n.getFqn());
}
public Object getWriteOwner(Fqn f)
{
- throw new UnsupportedOperationException("Not supported in this impl.");
+ if (lockContainer.isLocked(f))
+ {
+ Lock l = lockContainer.getLock(f);
+
+ if (l instanceof OwnableReentrantLock)
+ {
+ return ((OwnableReentrantLock) l).getOwner();
+ }
+ else
+ {
+ // cannot determine owner.
+ return null;
+ }
+ }
+ else return null;
}
public Collection<Object> getReadOwners(Fqn f)
{
- throw new UnsupportedOperationException("Not supported in this impl.");
+ return Collections.emptySet();
}
public String printLockInfo(NodeSPI node)
16 years, 6 months
JBoss Cache SVN: r6097 - in core/trunk/src/test/java/org/jboss/cache/api: optimistic and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-27 10:23:54 -0400 (Fri, 27 Jun 2008)
New Revision: 6097
Added:
core/trunk/src/test/java/org/jboss/cache/api/optimistic/DeletedChildResurrectionOptimisticTest.java
Modified:
core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java
Log:
Better organisation of tests
Modified: core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java 2008-06-27 14:19:48 UTC (rev 6096)
+++ core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java 2008-06-27 14:23:54 UTC (rev 6097)
@@ -6,6 +6,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.util.TestingUtil;
import org.testng.annotations.AfterMethod;
@@ -33,12 +34,15 @@
private static final String VALUE = "value";
private static final String K2 = "k2";
private static final String V2 = "v2";
+ protected NodeLockingScheme nodeLockingScheme = NodeLockingScheme.PESSIMISTIC;
@BeforeMethod(alwaysRun = true)
public void setUp()
{
cache = new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true), false);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
+ cache.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ cache.start();
}
@AfterMethod(alwaysRun = true)
@@ -47,59 +51,8 @@
TestingUtil.killCaches(cache);
}
- /**
- * Tests whether the deleted child re-appears if the parent node is re-added
- * via a simple node.addChild(parentFqn) call. Pessimistic locking case.
- *
- * @throws Exception
- */
- public void testDeletedChildResurrectionPessimistic1() throws Exception
+ public void testDeletedChildResurrection1() throws Exception
{
- deletedChildResurrectionTest1(Configuration.NodeLockingScheme.PESSIMISTIC);
- }
-
- /**
- * Tests whether the deleted child re-appears if the parent node is re-added
- * via a simple node.addChild(parentFqn) call. Optimistic locking case.
- *
- * @throws Exception
- */
- public void testDeletedChildResurrectionOptimistic1() throws Exception
- {
- deletedChildResurrectionTest1(Configuration.NodeLockingScheme.OPTIMISTIC);
- }
-
- /**
- * Tests whether the deleted child re-appears if the parent node is re-added
- * via a node.addChild(differentChildofParentFqn) call. Pessimistic locking case.
- *
- * @throws Exception
- */
- public void testDeletedChildResurrectionPessimistic2() throws Exception
- {
- deletedChildResurrectionTest2(Configuration.NodeLockingScheme.PESSIMISTIC);
- }
-
- /**
- * Tests whether the deleted child re-appears if the parent node is re-added
- * via a node.addChild(differentChildofParentFqn) call. Optimistic locking case.
- *
- * @throws Exception
- */
- public void testDeletedChildResurrectionOptimistic2() throws Exception
- {
- deletedChildResurrectionTest2(Configuration.NodeLockingScheme.OPTIMISTIC);
- }
-
- /**
- * Tests whether, in a single tx, deleting a parent node with an pre-existing
- * child and then inserting a different child under the parent Fqn results
- * in the pre-existing child remaining in the cache after tx commit.
- */
- private void deletedChildResurrectionTest1(Configuration.NodeLockingScheme lockingScheme) throws Exception
- {
- cache.getConfiguration().setNodeLockingScheme(lockingScheme);
- cache.start();
CacheSPI spi = (CacheSPI) cache;
Node<Object, Object> root = cache.getRoot();
@@ -123,10 +76,8 @@
* child and then inserting a different child under the parent Fqn results
* in the pre-existing child remaining in the cache after tx commit.
*/
- private void deletedChildResurrectionTest2(Configuration.NodeLockingScheme lockingScheme) throws Exception
+ public void testDeletedChildResurrection2() throws Exception
{
- cache.getConfiguration().setNodeLockingScheme(lockingScheme);
- cache.start();
Node<Object, Object> root = cache.getRoot();
TransactionManager txManager = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
Added: core/trunk/src/test/java/org/jboss/cache/api/optimistic/DeletedChildResurrectionOptimisticTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/optimistic/DeletedChildResurrectionOptimisticTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/optimistic/DeletedChildResurrectionOptimisticTest.java 2008-06-27 14:23:54 UTC (rev 6097)
@@ -0,0 +1,14 @@
+package org.jboss.cache.api.optimistic;
+
+import org.jboss.cache.api.DeletedChildResurrectionTest;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "optimistic"})
+public class DeletedChildResurrectionOptimisticTest extends DeletedChildResurrectionTest
+{
+ public DeletedChildResurrectionOptimisticTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.OPTIMISTIC;
+ }
+}
16 years, 6 months
JBoss Cache SVN: r6096 - in core/trunk/src/test/java/org/jboss/cache/api: nodevalidity and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-27 10:19:48 -0400 (Fri, 27 Jun 2008)
New Revision: 6096
Added:
core/trunk/src/test/java/org/jboss/cache/api/optimistic/
core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheAPIOptimisticTest.java
core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheSPIOptimisticTest.java
core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeAPIOptimisticTest.java
core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeMoveOptimisticTest.java
core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeReplicatedMoveOptimisticTest.java
core/trunk/src/test/java/org/jboss/cache/api/optimistic/SyncReplOptimisticTest.java
core/trunk/src/test/java/org/jboss/cache/api/optimistic/SyncReplTxOptimisticTest.java
Modified:
core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java
core/trunk/src/test/java/org/jboss/cache/api/CacheSPITest.java
core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java
core/trunk/src/test/java/org/jboss/cache/api/DestroyedCacheAPITest.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/NodeSPITest.java
core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java
core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java
core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java
core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/InvalidatedOptNodeValidityTest.java
core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/InvalidatedPessNodeValidityTest.java
core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/LocalOptNodeValidityTest.java
core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/LocalPessNodeValidityTest.java
core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/ReplicatedOptNodeValidityTest.java
core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/ReplicatedPessNodeValidityTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticInvalidationAsyncTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticInvalidationSyncTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticReplAsyncTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticReplSyncTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticInvalidationAsyncTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticInvalidationSyncTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticReplAsyncTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticReplSyncTest.java
Log:
Better organisation of tests
Modified: core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -32,7 +32,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
*/
-@Test(groups = "functional")
+@Test(groups = {"functional", "pessimistic"})
public class CacheAPITest
{
private Cache<String, String> cache;
Modified: core/trunk/src/test/java/org/jboss/cache/api/CacheSPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/CacheSPITest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/CacheSPITest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -2,10 +2,11 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.util.TestingUtil;
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;
+import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.util.internals.ViewChangeListener;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
@@ -15,13 +16,13 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
-@Test(groups = "functional")
+@Test(groups = {"functional", "pessimistic"})
public class CacheSPITest
{
private CacheSPI<Object, Object> cache1;
private CacheSPI<Object, Object> cache2;
- protected boolean optimistic = false;
+ protected NodeLockingScheme nodeLockingScheme = NodeLockingScheme.PESSIMISTIC;
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
@@ -30,8 +31,8 @@
Configuration conf2 = UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC);
- conf1.setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
- conf2.setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
+ conf1.setNodeLockingScheme(nodeLockingScheme);
+ conf2.setNodeLockingScheme(nodeLockingScheme);
cache1 = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(conf1, false);
cache2 = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(conf2, false);
Modified: core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -22,7 +22,7 @@
* @author Brian Stansberry
* @since 2.1.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class DeletedChildResurrectionTest
{
private Cache<Object, Object> cache;
@@ -106,7 +106,7 @@
TransactionManager txManager = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
root.addChild(A_B).put(KEY, VALUE);
- cache.put(A, "key","value");
+ cache.put(A, "key", "value");
txManager.begin();
root.removeChild(A);
root.addChild(A);
Modified: core/trunk/src/test/java/org/jboss/cache/api/DestroyedCacheAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/DestroyedCacheAPITest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/DestroyedCacheAPITest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -25,7 +25,7 @@
* @author Brian Stansberry
*/
-@Test(groups = "functional")
+@Test(groups = {"functional", "pessimistic"})
public class DestroyedCacheAPITest
{
private Cache<String, String> 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-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -30,7 +30,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.0.0
*/
-@Test(groups = "functional")
+@Test(groups = {"functional", "pessimistic"})
public class NodeAPITest
{
private Node<Object, Object> rootNode;
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -9,8 +9,8 @@
import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.parsing.XmlConfigHelper;
import org.jboss.cache.config.parsing.element.LoadersElementParser;
-import org.jboss.cache.config.parsing.XmlConfigHelper;
import org.jboss.cache.loader.DummyInMemoryCacheLoader;
import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.*;
@@ -30,6 +30,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.0.0
*/
+@Test(groups = {"functional", "pessimistic"})
public class NodeMoveAPITest
{
protected final Log log = LogFactory.getLog(getClass());
@@ -533,14 +534,14 @@
protected CacheLoaderConfig getSingleCacheLoaderConfig(boolean passivation, String preload, String cacheloaderClass, String properties, boolean async, boolean fetchPersistentState, boolean shared, boolean purgeOnStartup) throws Exception
{
String xml =
- " <loaders passivation=\"" + passivation + "\" shared=\"" + shared + "\">\n" +
+ " <loaders passivation=\"" + passivation + "\" shared=\"" + shared + "\">\n" +
" <preload>\n" +
" <node fqn=\"" + preload + "\"/>\n" +
" </preload>\n" +
" <loader class=\"" + cacheloaderClass + "\" async=\"" + async + "\" fetchPersistentState=\"" + fetchPersistentState + "\"\n" +
" purgeOnStartup=\"" + purgeOnStartup + "\">\n" +
" <properties>\n" +
- properties +
+ properties +
" </properties>\n" +
" </loader>\n" +
" </loaders>";
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -24,7 +24,7 @@
import javax.transaction.TransactionManager;
-@Test(groups = {"functional", "jgroups"})
+@Test(groups = {"functional", "jgroups", "pessimistic"})
public class NodeReplicatedMoveTest
{
protected Node<Object, Object> rootNode, nodeA, nodeB, nodeC, nodeD, nodeE;
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeSPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeSPITest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeSPITest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -9,13 +9,12 @@
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import java.util.Map;
import java.util.Set;
/**
* Tests NodeSPI specific APIs.
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class NodeSPITest
{
private CacheSPI<Object, Object> cache;
Modified: core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -4,12 +4,12 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
-import org.jboss.cache.util.internals.EvictionController;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.EvictionConfig;
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.eviction.LRUConfiguration;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.util.internals.EvictionController;
import static org.testng.Assert.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -23,7 +23,7 @@
* @author <a href="mailto:mircea.markus@jboss.com">Mircea Markus</a>
* @since 2.1.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class ResidentNodesTest
{
private CacheSPI<Object, Object> cache;
Modified: core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -13,7 +13,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.config.Configuration.CacheMode;
-import org.jboss.cache.config.Option;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.util.TestingUtil;
@@ -28,18 +28,25 @@
/**
* @author <a href="mailto:manik@jboss.org">Manik Surtani (manik(a)jboss.org)</a>
*/
-@Test(groups = {"functional", "jgroups"})
+@Test(groups = {"functional", "jgroups", "pessimistic"})
public class SyncReplTest
{
private CacheSPI<Object, Object> cache1, cache2;
+ protected NodeLockingScheme nodeLockingScheme = NodeLockingScheme.PESSIMISTIC;
@BeforeMethod(alwaysRun = true)
public void setUp()
{
System.out.println("*** In setUp()");
- cache1 = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC));
- cache2 = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC));
+ cache1 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
+ cache2 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
+ cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+
+ cache1.start();
+ cache2.start();
+
TestingUtil.blockUntilViewsReceived(new Cache[]{cache1, cache2}, 5000);
System.out.println("*** Finished setUp()");
}
@@ -139,7 +146,6 @@
control = ctx.copy();
control.reset();
- control.setOptionOverrides(new Option());
assertEquals("Should be equal", control, ctx);
}
Modified: core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -13,6 +13,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.util.TestingUtil;
@@ -35,19 +36,29 @@
/**
* @author <a href="mailto:manik@jboss.org">Manik Surtani (manik(a)jboss.org)</a>
*/
-@Test(groups = {"functional", "jgroups", "transaction"})
+@Test(groups = {"functional", "jgroups", "transaction", "pessimistic"})
public class SyncReplTxTest
{
private List<CacheSPI<Object, Object>> caches;
+ protected NodeLockingScheme nodeLockingScheme = NodeLockingScheme.PESSIMISTIC;
@BeforeMethod(alwaysRun = true)
public void setUp()
{
System.out.println("*** In setUp()");
caches = new ArrayList<CacheSPI<Object, Object>>();
- caches.add((CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC)));
- caches.add((CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC)));
+ CacheSPI<Object, Object> cache1 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
+ CacheSPI<Object, Object> cache2 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
+ cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+
+ cache1.start();
+ cache2.start();
+
+ caches.add(cache1);
+ caches.add(cache2);
+
TestingUtil.blockUntilViewsReceived(caches.toArray(new Cache[0]), 5000);
System.out.println("*** Finished setUp()");
}
Modified: core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/InvalidatedOptNodeValidityTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/InvalidatedOptNodeValidityTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/InvalidatedOptNodeValidityTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -9,7 +9,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.1.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "optimistic"})
public class InvalidatedOptNodeValidityTest extends InvalidatedPessNodeValidityTest
{
public InvalidatedOptNodeValidityTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/InvalidatedPessNodeValidityTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/InvalidatedPessNodeValidityTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/InvalidatedPessNodeValidityTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -15,7 +15,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.1.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class InvalidatedPessNodeValidityTest extends NodeValidityTestBase
{
protected DummyInMemoryCacheLoader loader;
Modified: core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/LocalOptNodeValidityTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/LocalOptNodeValidityTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/LocalOptNodeValidityTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -3,15 +3,14 @@
import org.testng.annotations.Test;
/**
- *
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.1.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "optimistic"})
public class LocalOptNodeValidityTest extends LocalPessNodeValidityTest
{
public LocalOptNodeValidityTest()
{
- optimistic = true;
+ optimistic = true;
}
}
\ No newline at end of file
Modified: core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/LocalPessNodeValidityTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/LocalPessNodeValidityTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/LocalPessNodeValidityTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -11,7 +11,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.1.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class LocalPessNodeValidityTest extends NodeValidityTestBase
{
private Cache<String, String> cache;
Modified: core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/ReplicatedOptNodeValidityTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/ReplicatedOptNodeValidityTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/ReplicatedOptNodeValidityTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -3,11 +3,10 @@
import org.testng.annotations.Test;
/**
- *
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.1.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "optimistic"})
public class ReplicatedOptNodeValidityTest extends ReplicatedPessNodeValidityTest
{
public ReplicatedOptNodeValidityTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/ReplicatedPessNodeValidityTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/ReplicatedPessNodeValidityTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/ReplicatedPessNodeValidityTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -10,7 +10,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.1.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class ReplicatedPessNodeValidityTest extends NodeValidityTestBase
{
protected Cache<String, String> createObserver()
Copied: core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheAPIOptimisticTest.java (from rev 6083, core/trunk/src/test/java/org/jboss/cache/api/CacheAPIOptimisticTest.java)
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheAPIOptimisticTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheAPIOptimisticTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -0,0 +1,20 @@
+package org.jboss.cache.api.optimistic;
+
+import org.jboss.cache.api.CacheAPITest;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+
+/**
+ * Optimistically locked version of {@link org.jboss.cache.api.CacheAPITest}
+ */
+@Test(groups = {"functional", "optimistic"})
+public class CacheAPIOptimisticTest extends CacheAPITest
+{
+ @Override
+ protected NodeLockingScheme getNodeLockingScheme()
+ {
+ return NodeLockingScheme.OPTIMISTIC;
+ }
+
+}
Property changes on: core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheAPIOptimisticTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheSPIOptimisticTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheSPIOptimisticTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/optimistic/CacheSPIOptimisticTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -0,0 +1,14 @@
+package org.jboss.cache.api.optimistic;
+
+import org.jboss.cache.api.CacheSPITest;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "optimistic"})
+public class CacheSPIOptimisticTest extends CacheSPITest
+{
+ public CacheSPIOptimisticTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.OPTIMISTIC;
+ }
+}
Copied: core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeAPIOptimisticTest.java (from rev 6083, core/trunk/src/test/java/org/jboss/cache/api/NodeAPIOptimisticTest.java)
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeAPIOptimisticTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeAPIOptimisticTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -0,0 +1,34 @@
+package org.jboss.cache.api.optimistic;
+
+import org.jboss.cache.api.NodeAPITest;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
+import org.jboss.cache.interceptors.PessimisticLockInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
+import org.testng.annotations.Test;
+
+/**
+ * An optimistic version of {@link org.jboss.cache.api.NodeAPITest}
+ */
+@Test(groups = {"functional", "optimistic"})
+public class NodeAPIOptimisticTest extends NodeAPITest
+{
+ protected NodeLockingScheme getNodeLockingScheme()
+ {
+ return NodeLockingScheme.OPTIMISTIC;
+ }
+
+ protected void assertNodeLockingScheme()
+ {
+ assert cache.getConfiguration().getNodeLockingScheme() == NodeLockingScheme.OPTIMISTIC;
+ boolean interceptorChainOK = false;
+
+ for (CommandInterceptor i : cache.getInterceptorChain())
+ {
+ if (i instanceof PessimisticLockInterceptor) assert false : "Not an optimistic locking chain!!";
+ if (i instanceof OptimisticNodeInterceptor) interceptorChainOK = true;
+ }
+
+ assert interceptorChainOK : "Not an optimistic locking chain!!";
+ }
+}
Property changes on: core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeAPIOptimisticTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeMoveOptimisticTest.java (from rev 6083, core/trunk/src/test/java/org/jboss/cache/api/NodeMoveOptimisticTest.java)
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeMoveOptimisticTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeMoveOptimisticTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.api.optimistic;
+
+import org.jboss.cache.api.NodeMoveAPITest;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "optimistic"})
+public class NodeMoveOptimisticTest extends NodeMoveAPITest
+{
+ public NodeMoveOptimisticTest()
+ {
+ optimistic = true;
+ }
+
+ public void testLocks()
+ {
+ // no op
+ }
+
+ public void testLocksDeepMove()
+ {
+ // no op
+ }
+
+ @Override
+ @Test(groups = {"functional"})
+ public void testWithCacheloaders() throws Exception
+ {
+ super.testWithCacheloaders(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ @Override
+ @Test(groups = {"functional"})
+ public void testWithPassivation() throws Exception
+ {
+ super.testWithPassivation(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+}
Property changes on: core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeMoveOptimisticTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeReplicatedMoveOptimisticTest.java (from rev 6083, core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveOptimisticTest.java)
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeReplicatedMoveOptimisticTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeReplicatedMoveOptimisticTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -0,0 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.api.optimistic;
+
+import org.jboss.cache.api.NodeReplicatedMoveTest;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "optimistic"})
+public class NodeReplicatedMoveOptimisticTest extends NodeReplicatedMoveTest
+{
+ public NodeReplicatedMoveOptimisticTest()
+ {
+ optimistic = true;
+ }
+}
Property changes on: core/trunk/src/test/java/org/jboss/cache/api/optimistic/NodeReplicatedMoveOptimisticTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: core/trunk/src/test/java/org/jboss/cache/api/optimistic/SyncReplOptimisticTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/optimistic/SyncReplOptimisticTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/optimistic/SyncReplOptimisticTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -0,0 +1,14 @@
+package org.jboss.cache.api.optimistic;
+
+import org.jboss.cache.api.SyncReplTest;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "jgroups", "optimistic"})
+public class SyncReplOptimisticTest extends SyncReplTest
+{
+ public SyncReplOptimisticTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.OPTIMISTIC;
+ }
+}
Added: core/trunk/src/test/java/org/jboss/cache/api/optimistic/SyncReplTxOptimisticTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/optimistic/SyncReplTxOptimisticTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/optimistic/SyncReplTxOptimisticTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -0,0 +1,14 @@
+package org.jboss.cache.api.optimistic;
+
+import org.jboss.cache.api.SyncReplTxTest;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "jgroups", "transaction", "optimistic"})
+public class SyncReplTxOptimisticTest extends SyncReplTxTest
+{
+ public SyncReplTxOptimisticTest()
+ {
+ nodeLockingScheme = NodeLockingScheme.OPTIMISTIC;
+ }
+}
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticInvalidationAsyncTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticInvalidationAsyncTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticInvalidationAsyncTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -11,11 +11,11 @@
/**
* Test putForExternalRead with optimistic locking and INVALIDATION_ASYNC.
- *
+ *
* @author Brian Stansberry
* @version $Revision$
*/
-@Test (groups = {"functional"})
+@Test(groups = {"functional", "optimistic"})
public class PFEROptimisticInvalidationAsyncTest extends PutForExternalReadTestBase
{
public PFEROptimisticInvalidationAsyncTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticInvalidationSyncTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticInvalidationSyncTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticInvalidationSyncTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -11,11 +11,11 @@
/**
* Test putForExternalRead with optimistic locking and INVALIDATION_SYNC.
- *
+ *
* @author Brian Stansberry
* @version $Revision$
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "optimistic"})
public class PFEROptimisticInvalidationSyncTest extends PutForExternalReadTestBase
{
public PFEROptimisticInvalidationSyncTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticReplAsyncTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticReplAsyncTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticReplAsyncTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -3,7 +3,7 @@
import org.jboss.cache.config.Configuration;
import org.testng.annotations.Test;
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "optimistic"})
public class PFEROptimisticReplAsyncTest extends PutForExternalReadTestBase
{
public PFEROptimisticReplAsyncTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticReplSyncTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticReplSyncTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFEROptimisticReplSyncTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -3,7 +3,7 @@
import org.jboss.cache.config.Configuration;
import org.testng.annotations.Test;
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "optimistic"})
public class PFEROptimisticReplSyncTest extends PutForExternalReadTestBase
{
public PFEROptimisticReplSyncTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticInvalidationAsyncTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticInvalidationAsyncTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticInvalidationAsyncTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -11,11 +11,11 @@
/**
* Test putForExternalRead with pessimistic locking and INVALIDATION_SYNC.
- *
+ *
* @author Brian Stansberry
* @version $Revision$
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class PFERPessimisticInvalidationAsyncTest extends PutForExternalReadTestBase
{
public PFERPessimisticInvalidationAsyncTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticInvalidationSyncTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticInvalidationSyncTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticInvalidationSyncTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -7,19 +7,21 @@
package org.jboss.cache.api.pfer;
import org.jboss.cache.config.Configuration;
+import org.testng.annotations.Test;
/**
* Test putForExternalRead with pessimistic locking and INVALIDATION_ASYNC.
- *
+ *
* @author Brian Stansberry
* @version $Revision$
*/
+@Test(groups = {"functional", "pessimistic"})
public class PFERPessimisticInvalidationSyncTest extends PutForExternalReadTestBase
{
public PFERPessimisticInvalidationSyncTest()
{
optimistic = false;
cacheMode = Configuration.CacheMode.INVALIDATION_SYNC;
- }
-
+ }
+
}
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticReplAsyncTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticReplAsyncTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticReplAsyncTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -3,7 +3,7 @@
import org.jboss.cache.config.Configuration;
import org.testng.annotations.Test;
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class PFERPessimisticReplAsyncTest extends PutForExternalReadTestBase
{
public PFERPessimisticReplAsyncTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticReplSyncTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticReplSyncTest.java 2008-06-27 13:39:30 UTC (rev 6095)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticReplSyncTest.java 2008-06-27 14:19:48 UTC (rev 6096)
@@ -3,7 +3,7 @@
import org.jboss.cache.config.Configuration;
import org.testng.annotations.Test;
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class PFERPessimisticReplSyncTest extends PutForExternalReadTestBase
{
public PFERPessimisticReplSyncTest()
16 years, 6 months
JBoss Cache SVN: r6095 - in core/trunk/src: test/resources/META-INF/conf-test and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-27 09:39:30 -0400 (Fri, 27 Jun 2008)
New Revision: 6095
Added:
core/trunk/src/main/resources/all-elements-file-3.x.xml
core/trunk/src/main/resources/config-samples/
Removed:
core/trunk/src/main/resources/META-INF/
core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml
Log:
renamed resources/META-INF to resources/config-samples
Copied: core/trunk/src/main/resources/all-elements-file-3.x.xml (from rev 6083, core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml)
===================================================================
--- core/trunk/src/main/resources/all-elements-file-3.x.xml (rev 0)
+++ core/trunk/src/main/resources/all-elements-file-3.x.xml 2008-06-27 13:39:30 UTC (rev 6095)
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscache>
+
+ <locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
+ nodeLockingScheme="Optimistic"/>
+
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
+ syncRollbackPhase="true" syncCommitPhase="true"/>
+
+ <!-- serialization related configuration, used for replication and cache loading -->
+ <serialization objectInputStreamPoolSize="10" objectOutputStreamPoolSize="20" version="5.1.0"
+ marshallerClass="some.Clazz" useLazyDeserialization="true" useRegionBasedMarshalling="false"/>
+
+ <!-- either replication or invalidation tags will be present, not both -->
+ <replication>
+ <sync replTimeout="15421"/>
+ <buddy enabled="true" poolName="myBuddyPoolReplicationGroup" communicationTimeout="2000">
+ <dataGravitation auto="true" removeOnFind="true" searchBackupTrees="true"/>
+ <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+ <properties>
+ numBuddies = 1
+ ignoreColocatedBuddies = true
+ </properties>
+ </locator>
+ </buddy>
+ </replication>
+
+ <!-- either replication or invalidation tags will be present, not both -->
+ <invalidation>
+ <!-- either sync or async will be present, not both -->
+ <async useReplQueue="false" replQueueInterval="12" replQueueMaxElements="12345"/>
+ <sync replTimeout="15421"/>
+ </invalidation>
+
+ <startup fetchInMemoryState="true" stateRetrievalTimeout="1524" inactiveOnStartup="true"/>
+ <shutdown hookBehavior="REGISTER"/>
+
+ <jmxStatistics enabled="false"/>
+
+ <transport clusterName="JBossCache-Cluster" multiplexerStack="file_name">
+ <jgroupsConfig>
+ <PING timeout="2000" num_initial_members="3"/>
+ <MERGE2 max_interval="30000" min_interval="10000"/>
+ <FD_SOCK/>
+ <FD timeout="10000" max_tries="5" shun="true"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+ retransmit_timeout="300,600,1200,2400,4800"
+ discard_delivered_msgs="true"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="400000"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
+ view_bundling="true" view_ack_collection_timeout="5000"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+ <pbcast.FLUSH timeout="0"/>
+ </jgroupsConfig>
+ </transport>
+
+ <eviction wakeUpInterval="5">
+ <defaults policyClass="org.jboss.cache.eviction.LRUPolicy" eventQueueSize="200000"/>
+ <root>
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </root>
+ <region name="/org/jboss/data">
+ <attribute name="timeToLive">1002</attribute>
+ </region>
+ <region name="/org/jboss/xyz" policyClass="org.jboss.cache.eviction.MRUPolicy" eventQueueSize="21">
+ <attribute name="maxNodes">2103</attribute>
+ <attribute name="minTimeToLive">22</attribute>
+ </region>
+ </eviction>
+
+ <loaders passivation="false" shared="false">
+ <preload>
+ <node fqn="/a/b/c"/>
+ <node fqn="/f/r/s"/>
+ </preload>
+
+ <!-- we can now have multiple cache loaders, which get chained -->
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="true" fetchPersistentState="true"
+ ignoreModifications="true" purgeOnStartup="true">
+ <properties>
+ cache.jdbc.table.name=jbosscache
+ cache.jdbc.table.create=true
+ cache.jdbc.table.drop=true
+ </properties>
+ <singletonStore enabled="false" class="org.jboss.cache.loader.SingletonStoreCacheLoader">
+ <properties>
+ pushStateWhenCoordinator=true
+ pushStateWhenCoordinatorTimeout=20000
+ </properties>
+ </singletonStore>
+ </loader>
+ </loaders>
+
+ <!-- this is new behavior added within 3.x only. it support configuring custom interceptors through configurations -->
+ <customInterceptors>
+ <interceptor class="com.myCompany.MyInterceptor1">
+ <properties>
+ x=y
+ i=10
+ </properties>
+ <position first="true"/>
+ </interceptor>
+ <interceptor class="com.myCompany.MyInterceptor2">
+ <position last="true"/>
+ </interceptor>
+ <interceptor class="com.myCompany.MyInterceptor3">
+ <position index="3"/>
+ </interceptor>
+ <interceptor class="com.myCompany.MyInterceptor4">
+ <position before="org.jboss.cache.interceptors.CallInterceptor"/>
+ </interceptor>
+ <interceptor class="com.myCompany.MyInterceptor5">
+ <position after="org.jboss.cache.interceptors.CallInterceptor"/>
+ </interceptor>
+ </customInterceptors>
+</jbosscache>
Copied: core/trunk/src/main/resources/config-samples (from rev 6083, core/trunk/src/main/resources/META-INF)
Deleted: core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml
===================================================================
--- core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml 2008-06-27 13:38:52 UTC (rev 6094)
+++ core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml 2008-06-27 13:39:30 UTC (rev 6095)
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbosscache>
-
- <locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
- nodeLockingScheme="Optimistic"/>
-
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
- syncRollbackPhase="true" syncCommitPhase="true"/>
-
- <!-- serialization related configuration, used for replication and cache loading -->
- <serialization objectInputStreamPoolSize="10" objectOutputStreamPoolSize="20" version="5.1.0"
- marshallerClass="some.Clazz" useLazyDeserialization="true" useRegionBasedMarshalling="false"/>
-
- <!-- either replication or invalidation tags will be present, not both -->
- <replication>
- <sync replTimeout="15421"/>
- <buddy enabled="true" poolName="myBuddyPoolReplicationGroup" communicationTimeout="2000">
- <dataGravitation auto="true" removeOnFind="true" searchBackupTrees="true"/>
- <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
- <properties>
- numBuddies = 1
- ignoreColocatedBuddies = true
- </properties>
- </locator>
- </buddy>
- </replication>
-
- <!-- either replication or invalidation tags will be present, not both -->
- <invalidation>
- <!-- either sync or async will be present, not both -->
- <async useReplQueue="false" replQueueInterval="12" replQueueMaxElements="12345"/>
- <sync replTimeout="15421"/>
- </invalidation>
-
- <startup fetchInMemoryState="true" stateRetrievalTimeout="1524" inactiveOnStartup="true"/>
- <shutdown hookBehavior="REGISTER"/>
-
- <jmxStatistics enabled="false"/>
-
- <transport clusterName="JBossCache-Cluster" multiplexerStack="file_name">
- <jgroupsConfig>
- <PING timeout="2000" num_initial_members="3"/>
- <MERGE2 max_interval="30000" min_interval="10000"/>
- <FD_SOCK/>
- <FD timeout="10000" max_tries="5" shun="true"/>
- <VERIFY_SUSPECT timeout="1500"/>
- <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
- view_bundling="true" view_ack_collection_timeout="5000"/>
- <FRAG2 frag_size="60000"/>
- <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
- <pbcast.FLUSH timeout="0"/>
- </jgroupsConfig>
- </transport>
-
- <eviction wakeUpInterval="5">
- <defaults policyClass="org.jboss.cache.eviction.LRUPolicy" eventQueueSize="200000"/>
- <root>
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLive">1000</attribute>
- </root>
- <region name="/org/jboss/data">
- <attribute name="timeToLive">1002</attribute>
- </region>
- <region name="/org/jboss/xyz" policyClass="org.jboss.cache.eviction.MRUPolicy" eventQueueSize="21">
- <attribute name="maxNodes">2103</attribute>
- <attribute name="minTimeToLive">22</attribute>
- </region>
- </eviction>
-
- <loaders passivation="false" shared="false">
- <preload>
- <node fqn="/a/b/c"/>
- <node fqn="/f/r/s"/>
- </preload>
-
- <!-- we can now have multiple cache loaders, which get chained -->
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="true" fetchPersistentState="true"
- ignoreModifications="true" purgeOnStartup="true">
- <properties>
- cache.jdbc.table.name=jbosscache
- cache.jdbc.table.create=true
- cache.jdbc.table.drop=true
- </properties>
- <singletonStore enabled="false" class="org.jboss.cache.loader.SingletonStoreCacheLoader">
- <properties>
- pushStateWhenCoordinator=true
- pushStateWhenCoordinatorTimeout=20000
- </properties>
- </singletonStore>
- </loader>
- </loaders>
-
- <!-- this is new behavior added within 3.x only. it support configuring custom interceptors through configurations -->
- <customInterceptors>
- <interceptor class="com.myCompany.MyInterceptor1">
- <properties>
- x=y
- i=10
- </properties>
- <position first="true"/>
- </interceptor>
- <interceptor class="com.myCompany.MyInterceptor2">
- <position last="true"/>
- </interceptor>
- <interceptor class="com.myCompany.MyInterceptor3">
- <position index="3"/>
- </interceptor>
- <interceptor class="com.myCompany.MyInterceptor4">
- <position before="org.jboss.cache.interceptors.CallInterceptor"/>
- </interceptor>
- <interceptor class="com.myCompany.MyInterceptor5">
- <position after="org.jboss.cache.interceptors.CallInterceptor"/>
- </interceptor>
- </customInterceptors>
-</jbosscache>
16 years, 6 months
JBoss Cache SVN: r6094 - in core/trunk/src/main/docbook: tutorial/en and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-27 09:38:52 -0400 (Fri, 27 Jun 2008)
New Revision: 6094
Modified:
core/trunk/src/main/docbook/faq/en/master.xml
core/trunk/src/main/docbook/tutorial/en/master.xml
core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml
Log:
renamed resources/META-INF to resources/config-samples
Modified: core/trunk/src/main/docbook/faq/en/master.xml
===================================================================
--- core/trunk/src/main/docbook/faq/en/master.xml 2008-06-27 12:41:45 UTC (rev 6093)
+++ core/trunk/src/main/docbook/faq/en/master.xml 2008-06-27 13:38:52 UTC (rev 6094)
@@ -313,7 +313,7 @@
<literal>all</literal>
configuration whereby the
necessary jars are present). Under the standalone package
- <literal>resources/META-INF</literal>
+ <literal>resources/config-samples</literal>
directory , there are example
configuration files for different cache modes that can be used to
deploy JBoss Cache as well.
Modified: core/trunk/src/main/docbook/tutorial/en/master.xml
===================================================================
--- core/trunk/src/main/docbook/tutorial/en/master.xml 2008-06-27 12:41:45 UTC (rev 6093)
+++ core/trunk/src/main/docbook/tutorial/en/master.xml 2008-06-27 13:38:52 UTC (rev 6094)
@@ -93,7 +93,7 @@
<listitem>
<para>
- <literal>META-INF/replSync-service.xml</literal>
+ <literal>config-samples/replSync-service.xml</literal>
. Cache configuration file used for this tutorial.
</para>
</listitem>
Modified: core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml 2008-06-27 12:41:45 UTC (rev 6093)
+++ core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml 2008-06-27 13:38:52 UTC (rev 6094)
@@ -253,7 +253,7 @@
<literal>MultiplexerStack</literal>
are used.
See the various *-service.xml files in the source distribution
- <literal>resources/META-INF</literal>
+ <literal>resources/config-samples</literal>
folder for examples.
See the
<ulink url="http://www.jgroups.org">JGroups documentation</ulink>
16 years, 6 months
JBoss Cache SVN: r6093 - core/trunk/src/test/java/org/jboss/cache/passivation.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-27 08:41:45 -0400 (Fri, 27 Jun 2008)
New Revision: 6093
Modified:
core/trunk/src/test/java/org/jboss/cache/passivation/PassivationToFileCacheLoaderTest.java
Log:
Typo
Modified: core/trunk/src/test/java/org/jboss/cache/passivation/PassivationToFileCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/PassivationToFileCacheLoaderTest.java 2008-06-27 12:28:47 UTC (rev 6092)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/PassivationToFileCacheLoaderTest.java 2008-06-27 12:41:45 UTC (rev 6093)
@@ -9,7 +9,7 @@
* @author <a href="mailto:{hmesha@novell.com}">{Hany Mesha}</a>
* @version $Id$
*/
-@Test(groups ="funtional")
+@Test(groups = "functional")
public class PassivationToFileCacheLoaderTest extends PassivationTestsBase
{
protected void configureCache() throws Exception
16 years, 6 months
JBoss Cache SVN: r6092 - core/trunk/src/main/java/org/jboss/cache/commands/write.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-27 08:28:47 -0400 (Fri, 27 Jun 2008)
New Revision: 6092
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
Log:
NPE in rollback
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-06-27 12:17:15 UTC (rev 6091)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-06-27 12:28:47 UTC (rev 6092)
@@ -104,13 +104,15 @@
private void move(Fqn toMoveFqn, Fqn newParentFqn, boolean skipNotifications, InvocationContext ctx)
{
// the actual move algorithm.
- NodeSPI newParent = ctx.lookUpNode(newParentFqn);
+ // ctx *could* be null if this is a rollback!!! Sucks big time.
+ NodeSPI newParent = ctx == null ? dataContainer.peek(newParentFqn) : ctx.lookUpNode(newParentFqn);
if (newParent == null)
{
throw new NodeNotExistsException("New parent node " + newParentFqn + " does not exist when attempting to move node!!");
}
- NodeSPI node = ctx.lookUpNode(toMoveFqn);
+ // ctx *could* be null if this is a rollback!!! Sucks big time.
+ NodeSPI node = ctx == null ? dataContainer.peek(toMoveFqn) : ctx.lookUpNode(toMoveFqn);
if (node == null)
{
16 years, 6 months
JBoss Cache SVN: r6091 - core/trunk/src/test/java/org/jboss/cache/lock.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-27 08:17:15 -0400 (Fri, 27 Jun 2008)
New Revision: 6091
Modified:
core/trunk/src/test/java/org/jboss/cache/lock/MVCCLockManagerTest.java
Log:
Fixed broken test
Modified: core/trunk/src/test/java/org/jboss/cache/lock/MVCCLockManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/MVCCLockManagerTest.java 2008-06-27 12:17:04 UTC (rev 6090)
+++ core/trunk/src/test/java/org/jboss/cache/lock/MVCCLockManagerTest.java 2008-06-27 12:17:15 UTC (rev 6091)
@@ -3,6 +3,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.UnversionedNode;
+import org.jboss.cache.factories.context.MVCCContextFactory;
import org.jboss.cache.invocation.InvocationContextContainer;
import org.jboss.cache.invocation.NodeInvocationDelegate;
import static org.jboss.cache.lock.LockType.READ;
@@ -24,6 +25,7 @@
public void setUp()
{
icc = new InvocationContextContainer();
+ icc.injectContextFactory(new MVCCContextFactory());
lm = new MVCCLockManager();
TransactionManager tm = getTransactionManager();
lm.injectDataContainer(null, null, tm, icc);
16 years, 6 months