[jbosscache-commits] JBoss Cache SVN: r6648 - in core/trunk/src/test/java/org/jboss/cache: mgmt and 1 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Sep 1 01:13:33 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-09-01 01:13:32 -0400 (Mon, 01 Sep 2008)
New Revision: 6648

Modified:
   core/trunk/src/test/java/org/jboss/cache/commands/read/ExistsCommandTest.java
   core/trunk/src/test/java/org/jboss/cache/mgmt/TxTest.java
   core/trunk/src/test/java/org/jboss/cache/replicated/SyncCacheListenerTest.java
Log:
Fixed broken tests

Modified: core/trunk/src/test/java/org/jboss/cache/commands/read/ExistsCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/read/ExistsCommandTest.java	2008-09-01 04:29:13 UTC (rev 6647)
+++ core/trunk/src/test/java/org/jboss/cache/commands/read/ExistsCommandTest.java	2008-09-01 05:13:32 UTC (rev 6648)
@@ -1,6 +1,8 @@
 package org.jboss.cache.commands.read;
 
-import static org.easymock.EasyMock.*;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.invocation.MVCCInvocationContext;
+import org.jboss.cache.mock.NodeSpiMock;
 import org.testng.annotations.Test;
 
 /**
@@ -22,13 +24,12 @@
 
    public void testPerform()
    {
-      expect(container.exists(testFqn)).andReturn(false);
-      replay(container);
-      assert !((Boolean) command.perform(null));
-      reset(container);
+      InvocationContext ctx = new MVCCInvocationContext();
+      ctx.putLookedUpNode(testFqn, null);
+      assert !((Boolean) command.perform(ctx));
 
-      expect(container.exists(testFqn)).andReturn(true);
-      replay(container);
-      assert Boolean.TRUE == command.perform(null);
+      ctx.putLookedUpNode(testFqn, new NodeSpiMock(testFqn));
+
+      assert Boolean.TRUE == command.perform(ctx);
    }
 }

Modified: core/trunk/src/test/java/org/jboss/cache/mgmt/TxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mgmt/TxTest.java	2008-09-01 04:29:13 UTC (rev 6647)
+++ core/trunk/src/test/java/org/jboss/cache/mgmt/TxTest.java	2008-09-01 05:13:32 UTC (rev 6648)
@@ -5,6 +5,7 @@
 import org.jboss.cache.Fqn;
 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.interceptors.TxInterceptor;
 import static org.testng.AssertJUnit.*;
@@ -213,6 +214,7 @@
       CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
       cache.getConfiguration().setUseRegionBasedMarshalling(false);
       cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
+      cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
       cache.getConfiguration().setExposeManagementStatistics(true);
       cache.getConfiguration().setClusterName(clusterName);
       cache.create();

Modified: core/trunk/src/test/java/org/jboss/cache/replicated/SyncCacheListenerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/replicated/SyncCacheListenerTest.java	2008-09-01 04:29:13 UTC (rev 6647)
+++ core/trunk/src/test/java/org/jboss/cache/replicated/SyncCacheListenerTest.java	2008-09-01 05:13:32 UTC (rev 6648)
@@ -13,6 +13,7 @@
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.lock.IsolationLevel;
 import org.jboss.cache.notifications.annotation.CacheListener;
 import org.jboss.cache.notifications.annotation.NodeModified;
@@ -77,7 +78,10 @@
       cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
       cache1.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
       cache2.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
+      cache1.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
+      cache2.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
 
+
       cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       /*




More information about the jbosscache-commits mailing list