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()