[jbosscache-commits] JBoss Cache SVN: r6619 - core/trunk/src/test/java/org/jboss/cache/marshall.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Aug 26 06:45:29 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-08-26 06:45:29 -0400 (Tue, 26 Aug 2008)
New Revision: 6619

Modified:
   core/trunk/src/test/java/org/jboss/cache/marshall/AsyncReplTest.java
   core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBase.java
   core/trunk/src/test/java/org/jboss/cache/marshall/InvalidRegionForStateTransferTest.java
   core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
   core/trunk/src/test/java/org/jboss/cache/marshall/SyncReplTest.java
Log:
Fixed broken tests to use Pess locking instead of MVCC

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/AsyncReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/AsyncReplTest.java	2008-08-26 10:39:49 UTC (rev 6618)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/AsyncReplTest.java	2008-08-26 10:45:29 UTC (rev 6619)
@@ -15,6 +15,7 @@
 import org.jboss.cache.Region;
 import org.jboss.cache.commands.legacy.write.PessPutKeyValueCommand;
 import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.marshall.data.Address;
 import org.jboss.cache.marshall.data.Person;
@@ -79,6 +80,7 @@
    private CacheSPI<Object, Object> createCache(String name)
    {
       CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_ASYNC), false);
+      cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
       cache.getConfiguration().setClusterName(name);
       // Use marshaller
       cache.getConfiguration().setUseLazyDeserialization(useMarshalledValues);

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBase.java	2008-08-26 10:39:49 UTC (rev 6618)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBase.java	2008-08-26 10:45:29 UTC (rev 6619)
@@ -10,8 +10,8 @@
 import org.jboss.cache.RegionManager;
 import org.jboss.cache.RegionManagerImpl;
 import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.commands.legacy.write.PessPutKeyValueCommand;
 import org.jboss.cache.commands.remote.ReplicateCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.factories.ComponentRegistry;
 import org.jboss.cache.invocation.CacheInvocationDelegate;
@@ -113,7 +113,7 @@
    public void testMethodCall() throws Exception
    {
       Fqn fqn = Fqn.fromElements(3, false);
-      ReplicableCommand cmd = new PessPutKeyValueCommand(null, fqn, "key", "value");
+      ReplicableCommand cmd = new PutKeyValueCommand(null, fqn, "key", "value");
       byte[] asBytes = marshaller.objectToByteBuffer(cmd);
       Object o2 = marshaller.objectFromByteBuffer(asBytes);
 
@@ -126,7 +126,7 @@
    public void testNestedMethodCall() throws Exception
    {
       Fqn fqn = Fqn.fromElements(3, false);
-      ReplicableCommand cmd = new PessPutKeyValueCommand(null, fqn, "key", "value");
+      ReplicableCommand cmd = new PutKeyValueCommand(null, fqn, "key", "value");
       ReplicableCommand replicateCmd = new ReplicateCommand(cmd);
       byte[] asBytes = marshaller.objectToByteBuffer(replicateCmd);
       Object o2 = marshaller.objectFromByteBuffer(asBytes);
@@ -216,12 +216,12 @@
       Fqn f = Fqn.fromElements("BlahBlah", 3, false);
       String k = "key", v = "value";
 
-      ReplicableCommand cmd = new PessPutKeyValueCommand(null, f, k, v);
+      ReplicableCommand cmd = new PutKeyValueCommand(null, f, k, v);
       ReplicableCommand replCmd = new ReplicateCommand(cmd);
 
       calls.add(replCmd);
 
-      cmd = new PessPutKeyValueCommand(null, f, k, v);
+      cmd = new PutKeyValueCommand(null, f, k, v);
       replCmd = new ReplicateCommand(cmd);
 
       calls.add(replCmd);

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/InvalidRegionForStateTransferTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/InvalidRegionForStateTransferTest.java	2008-08-26 10:39:49 UTC (rev 6618)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/InvalidRegionForStateTransferTest.java	2008-08-26 10:45:29 UTC (rev 6619)
@@ -4,10 +4,11 @@
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.Region;
+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.jboss.cache.util.internals.ReplicationListener;
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -34,7 +35,7 @@
    public void setUp() throws CloneNotSupportedException
    {
       c1 = new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_ASYNC), false);
-
+      c1.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
       String jgroupsCfg = c1.getConfiguration().getClusterConfig();
 
       // make sure we use STATE_TRANSFER and not STREAMING_STATE_TRANSFER, so the same thread pool is used for incoming calls and ST

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java	2008-08-26 10:39:49 UTC (rev 6618)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java	2008-08-26 10:45:29 UTC (rev 6619)
@@ -12,6 +12,7 @@
 import org.jboss.cache.commands.read.GravitateDataCommand;
 import org.jboss.cache.commands.remote.ClusteredGetCommand;
 import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.util.TestingUtil;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.AfterMethod;
@@ -42,6 +43,7 @@
    public void setUp() throws Exception
    {
       cache1 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(false);
+      cache1.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
       cache1.getConfiguration().setUseLazyDeserialization(useMarshalledValues);
       cache1.getConfiguration().setUseRegionBasedMarshalling(!useMarshalledValues);
       cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
@@ -49,6 +51,7 @@
       cache1.start();
 
       cache2 = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(false);
+      cache2.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
       cache2.getConfiguration().setUseLazyDeserialization(useMarshalledValues);
       cache2.getConfiguration().setUseRegionBasedMarshalling(!useMarshalledValues);
       cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/SyncReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/SyncReplTest.java	2008-08-26 10:39:49 UTC (rev 6618)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/SyncReplTest.java	2008-08-26 10:45:29 UTC (rev 6619)
@@ -14,6 +14,7 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.Region;
 import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.marshall.data.Address;
 import org.jboss.cache.marshall.data.Person;
@@ -68,6 +69,7 @@
    private CacheSPI<Object, Object> createCache(String name)
    {
       CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
+      cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
       cache.getConfiguration().setClusterName(name);
       // Use marshaller
       cache.getConfiguration().setUseLazyDeserialization(useMarshalledValues);




More information about the jbosscache-commits mailing list