[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/optimistic ...
Manik Surtani
msurtani at jboss.com
Thu Jul 20 05:03:54 EDT 2006
User: msurtani
Date: 06/07/20 05:03:54
Modified: tests/functional/org/jboss/cache/optimistic
AbstractOptimisticTestCase.java
AsyncFullStackInterceptorTest.java CacheTest.java
MockFailureInterceptor.java
NodeInterceptorPutEraseTest.java
NodeInterceptorPutMapTest.java
NodeInterceptorRemoveDataTest.java
OpLockingInterceptorTest.java
OptimisticReplicationInterceptorTest.java
OptimisticVersioningTest.java
OptimisticWithPassivationTest.java
Log:
Fixed some broken UTs to use the new xml parsers, cache factories, etc.
Revision Changes Path
1.34 +4 -4 JBossCache/tests/functional/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AbstractOptimisticTestCase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- AbstractOptimisticTestCase.java 20 Jul 2006 08:05:18 -0000 1.33
+++ AbstractOptimisticTestCase.java 20 Jul 2006 09:03:54 -0000 1.34
@@ -147,7 +147,7 @@
c.setClusterName("name");
c.setInitialStateRetrievalTimeout(5000);
c.setClusterConfig(getDefaultProperties());
- c.setCacheModeInt(Configuration.CacheMode.REPL_SYNC);
+ c.setCacheMode(Configuration.CacheMode.REPL_SYNC);
c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
cache.createService();
@@ -167,7 +167,7 @@
c.setInitialStateRetrievalTimeout(5000);
c.setClusterConfig(getDefaultProperties());
- c.setCacheModeInt(Configuration.CacheMode.LOCAL);
+ c.setCacheMode(Configuration.CacheMode.LOCAL);
c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
cache.createService();
@@ -208,7 +208,7 @@
c.setClusterName( name );
c.setInitialStateRetrievalTimeout(5000);
c.setClusterConfig(getDefaultProperties());
- c.setCacheModeInt(mode);
+ c.setCacheMode(mode);
if (mode == Configuration.CacheMode.REPL_SYNC)
{
// make sure commits and rollbacks are sync as well
@@ -246,7 +246,7 @@
c.setClusterName(name);
c.setInitialStateRetrievalTimeout(5000);
c.setClusterConfig(getDefaultProperties());
- c.setCacheModeInt(cacheMode);
+ c.setCacheMode(cacheMode);
c.setSyncCommitPhase(true);
c.setSyncRollbackPhase(true);
c.setNodeLockingScheme("OPTIMISTIC");
1.5 +2 -1 JBossCache/tests/functional/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AsyncFullStackInterceptorTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- AsyncFullStackInterceptorTest.java 5 May 2006 12:06:58 -0000 1.4
+++ AsyncFullStackInterceptorTest.java 20 Jul 2006 09:03:54 -0000 1.5
@@ -3,6 +3,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.*;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.transaction.DummyTransactionManager;
@@ -394,7 +395,7 @@
protected TreeCache createAsyncReplicatedCache() throws Exception
{
- return createReplicatedCache("temp" + groupIncreaser, TreeCache.REPL_ASYNC);
+ return createReplicatedCache("temp" + groupIncreaser, Configuration.CacheMode.REPL_ASYNC);
}
}
1.19 +20 -42 JBossCache/tests/functional/org/jboss/cache/optimistic/CacheTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/CacheTest.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- CacheTest.java 20 Jul 2006 08:05:18 -0000 1.18
+++ CacheTest.java 20 Jul 2006 09:03:54 -0000 1.19
@@ -8,6 +8,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.*;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.interceptors.*;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.marshall.MethodCallFactory;
@@ -151,13 +152,13 @@
TreeCache cache = createCacheWithListener();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
dummy.setCache(cache);
@@ -196,13 +197,13 @@
TreeCache cache = createCacheWithListener();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
dummy.setCache(cache);
@@ -237,42 +238,19 @@
remoteGtx.setAddress(new Address()
{
- public int compareTo(Object arg0)
- {
- return 0;
- }
-
- public void readFrom(DataInputStream arg0) throws IOException,
- IllegalAccessException, InstantiationException
- {
-
- }
+ public int compareTo(Object arg0){return 0;}
- public void writeTo(DataOutputStream arg0) throws IOException
- {
+ public void readFrom(DataInputStream arg0){}
- }
+ public void writeTo(DataOutputStream arg0){}
- public void readExternal(ObjectInput arg0) throws IOException,
- ClassNotFoundException
- {
+ public void readExternal(ObjectInput arg0){}
- }
+ public void writeExternal(ObjectOutput arg0){}
- public void writeExternal(ObjectOutput arg0) throws IOException
- {
+ public int size(){return 0;}
- }
-
- public int size()
- {
- return 0;
- }
-
- public boolean isMulticastAddress()
- {
- return false;
- }
+ public boolean isMulticastAddress(){return false;}
});
//hack the method call to make it have the remote gtx
@@ -317,8 +295,8 @@
{
- TreeCache cache = createReplicatedCache(TreeCache.REPL_SYNC);
- TreeCache cache2 = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
+ TreeCache cache2 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
DummyTransactionManager mgr = DummyTransactionManager.getInstance();
@@ -366,8 +344,8 @@
{
- TreeCache cache = createReplicatedCache(TreeCache.REPL_SYNC);
- TreeCache cache2 = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
+ TreeCache cache2 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
DummyTransactionManager mgr = DummyTransactionManager.getInstance();
1.3 +2 -3 JBossCache/tests/functional/org/jboss/cache/optimistic/MockFailureInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MockFailureInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/MockFailureInterceptor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- MockFailureInterceptor.java 14 Dec 2005 15:40:24 -0000 1.2
+++ MockFailureInterceptor.java 20 Jul 2006 09:03:54 -0000 1.3
@@ -1,6 +1,6 @@
package org.jboss.cache.optimistic;
-import org.jboss.cache.TreeCache;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.interceptors.Interceptor;
import org.jgroups.blocks.MethodCall;
@@ -19,10 +19,9 @@
{
- public void setCache(TreeCache cache)
+ public void setCache(CacheSPI cache)
{
super.setCache(cache);
-
}
1.7 +15 -15 JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorPutEraseTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeInterceptorPutEraseTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorPutEraseTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- NodeInterceptorPutEraseTest.java 26 Jan 2006 20:36:29 -0000 1.6
+++ NodeInterceptorPutEraseTest.java 20 Jul 2006 09:03:54 -0000 1.7
@@ -33,11 +33,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -50,8 +50,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
@@ -87,11 +87,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -104,8 +104,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
@@ -144,11 +144,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -161,8 +161,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
1.7 +15 -15 JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorPutMapTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeInterceptorPutMapTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorPutMapTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- NodeInterceptorPutMapTest.java 26 Jan 2006 20:36:29 -0000 1.6
+++ NodeInterceptorPutMapTest.java 20 Jul 2006 09:03:54 -0000 1.7
@@ -33,11 +33,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
@@ -51,8 +51,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
@@ -90,11 +90,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -107,8 +107,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
@@ -149,11 +149,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -166,8 +166,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
1.8 +20 -20 JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveDataTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeInterceptorRemoveDataTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveDataTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- NodeInterceptorRemoveDataTest.java 26 Jan 2006 20:36:29 -0000 1.7
+++ NodeInterceptorRemoveDataTest.java 20 Jul 2006 09:03:54 -0000 1.8
@@ -33,11 +33,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -50,8 +50,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
cache.removeData("/one/two");
@@ -84,11 +84,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -101,8 +101,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
Map temp = new HashMap();
@@ -141,11 +141,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -158,8 +158,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
@@ -201,11 +201,11 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -218,8 +218,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
1.11 +18 -18 JBossCache/tests/functional/org/jboss/cache/optimistic/OpLockingInterceptorTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OpLockingInterceptorTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/OpLockingInterceptorTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- OpLockingInterceptorTest.java 16 May 2006 22:42:27 -0000 1.10
+++ OpLockingInterceptorTest.java 20 Jul 2006 09:03:54 -0000 1.11
@@ -46,13 +46,13 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor lockingInterceptor = new OptimisticLockingInterceptor();
- lockingInterceptor.setCache(cache);
+ lockingInterceptor.setCache(cache.getSPI());
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
lockingInterceptor.setNext(interceptor);
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -65,8 +65,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
@@ -137,13 +137,13 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor lockingInterceptor = new OptimisticLockingInterceptor();
- lockingInterceptor.setCache(cache);
+ lockingInterceptor.setCache(cache.getSPI());
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
lockingInterceptor.setNext(interceptor);
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -156,8 +156,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
@@ -254,13 +254,13 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor lockingInterceptor = new OptimisticLockingInterceptor();
- lockingInterceptor.setCache(cache);
+ lockingInterceptor.setCache(cache.getSPI());
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
lockingInterceptor.setNext(interceptor);
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
@@ -273,8 +273,8 @@
Transaction tx = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
+ InvocationContext.getCurrent().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
Map temp = new HashMap();
1.13 +72 -71 JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticReplicationInterceptorTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- OptimisticReplicationInterceptorTest.java 16 May 2006 22:42:26 -0000 1.12
+++ OptimisticReplicationInterceptorTest.java 20 Jul 2006 09:03:54 -0000 1.13
@@ -10,6 +10,7 @@
import org.jboss.cache.OptimisticTransactionEntry;
import org.jboss.cache.TransactionTable;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.interceptors.*;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.marshall.MethodCallFactory;
@@ -46,15 +47,15 @@
final TreeCache cache = createCache();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -99,15 +100,15 @@
TreeCache cache = createCache();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -146,15 +147,15 @@
TreeCache cache = createCache();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -278,15 +279,15 @@
TreeCache cache = createCache();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
OptimisticNodeInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -426,15 +427,15 @@
TreeCache cache = createCache();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
OptimisticNodeInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -553,15 +554,15 @@
TreeCache cache = createCache();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
OptimisticNodeInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -674,15 +675,15 @@
TreeCache cache = createCache();
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
OptimisticNodeInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -820,19 +821,19 @@
{
- TreeCache cache = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
OptimisticNodeInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -842,19 +843,19 @@
cache.setInterceptorChain(txInterceptor);
- TreeCache cache2 = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache2 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
Interceptor txInterceptor2 = new TxInterceptor();
- txInterceptor2.setCache(cache2);
+ txInterceptor2.setCache(cache2.getSPI());
Interceptor replicationInterceptor2 = new OptimisticReplicationInterceptor();
- replicationInterceptor2.setCache(cache2);
+ replicationInterceptor2.setCache(cache2.getSPI());
Interceptor createInterceptor2 = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor2.setCache(cache2);
+ createInterceptor2.setCache(cache2.getSPI());
OptimisticNodeInterceptor nodeInterceptor2 = new OptimisticNodeInterceptor();
- nodeInterceptor2.setCache(cache2);
+ nodeInterceptor2.setCache(cache2.getSPI());
MockInterceptor dummy2 = new MockInterceptor();
- dummy2.setCache(cache2);
+ dummy2.setCache(cache2.getSPI());
txInterceptor2.setNext(replicationInterceptor2);
replicationInterceptor2.setNext(createInterceptor2);
@@ -913,19 +914,19 @@
{
- TreeCache cache = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
OptimisticNodeInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -935,22 +936,22 @@
cache.setInterceptorChain(txInterceptor);
- TreeCache cache2 = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache2 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
Interceptor txInterceptor2 = new TxInterceptor();
- txInterceptor2.setCache(cache2);
+ txInterceptor2.setCache(cache2.getSPI());
Interceptor replicationInterceptor2 = new OptimisticReplicationInterceptor();
- replicationInterceptor2.setCache(cache2);
+ replicationInterceptor2.setCache(cache2.getSPI());
Interceptor createInterceptor2 = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor2.setCache(cache2);
+ createInterceptor2.setCache(cache2.getSPI());
OptimisticNodeInterceptor nodeInterceptor2 = new OptimisticNodeInterceptor();
- nodeInterceptor2.setCache(cache2);
+ nodeInterceptor2.setCache(cache2.getSPI());
MockFailureInterceptor dummy2 = new MockFailureInterceptor();
List failures = new ArrayList();
failures.add(MethodDeclarations.optimisticPrepareMethod);
dummy2.setFailurelist(failures);
- dummy2.setCache(cache2);
+ dummy2.setCache(cache2.getSPI());
txInterceptor2.setNext(replicationInterceptor2);
replicationInterceptor2.setNext(createInterceptor2);
@@ -1017,23 +1018,23 @@
{
- TreeCache cache = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
Interceptor txInterceptor = new TxInterceptor();
- txInterceptor.setCache(cache);
+ txInterceptor.setCache(cache.getSPI());
Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
- replicationInterceptor.setCache(cache);
+ replicationInterceptor.setCache(cache.getSPI());
Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor.setCache(cache);
+ createInterceptor.setCache(cache.getSPI());
OptimisticNodeInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
- nodeInterceptor.setCache(cache);
+ nodeInterceptor.setCache(cache.getSPI());
MockFailureInterceptor dummy = new MockFailureInterceptor();
List failures = new ArrayList();
failures.add(MethodDeclarations.optimisticPrepareMethod);
dummy.setFailurelist(failures);
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
txInterceptor.setNext(replicationInterceptor);
replicationInterceptor.setNext(createInterceptor);
@@ -1043,20 +1044,20 @@
cache.setInterceptorChain(txInterceptor);
- TreeCache cache2 = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache2 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
Interceptor txInterceptor2 = new TxInterceptor();
- txInterceptor2.setCache(cache2);
+ txInterceptor2.setCache(cache2.getSPI());
Interceptor replicationInterceptor2 = new OptimisticReplicationInterceptor();
- replicationInterceptor2.setCache(cache2);
+ replicationInterceptor2.setCache(cache2.getSPI());
Interceptor createInterceptor2 = new OptimisticCreateIfNotExistsInterceptor();
- createInterceptor2.setCache(cache2);
+ createInterceptor2.setCache(cache2.getSPI());
OptimisticNodeInterceptor nodeInterceptor2 = new OptimisticNodeInterceptor();
- nodeInterceptor2.setCache(cache2);
+ nodeInterceptor2.setCache(cache2.getSPI());
MockInterceptor dummy2 = new MockInterceptor();
- dummy2.setCache(cache2);
+ dummy2.setCache(cache2.getSPI());
txInterceptor2.setNext(replicationInterceptor2);
1.4 +5 -4 JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticVersioningTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticVersioningTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticVersioningTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- OptimisticVersioningTest.java 14 Dec 2005 15:40:24 -0000 1.3
+++ OptimisticVersioningTest.java 20 Jul 2006 09:03:54 -0000 1.4
@@ -10,6 +10,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.OptimisticTreeNode;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.Configuration;
import javax.transaction.RollbackException;
import javax.transaction.Transaction;
@@ -29,8 +30,8 @@
public void testVersionPropagation() throws Exception
{
- TreeCache cache1 = createReplicatedCache(TreeCache.REPL_SYNC);
- TreeCache cache2 = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache1 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
+ TreeCache cache2 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
Fqn fqn = Fqn.fromString("/a/b");
String key = "key";
@@ -60,8 +61,8 @@
public void testTwoCachesUpdatingSimultaneously() throws Exception
{
- TreeCache cache1 = createReplicatedCache(TreeCache.REPL_SYNC);
- TreeCache cache2 = createReplicatedCache(TreeCache.REPL_SYNC);
+ TreeCache cache1 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
+ TreeCache cache2 = createReplicatedCache(Configuration.CacheMode.REPL_SYNC);
TransactionManager mgr1 = cache1.getTransactionManager();
TransactionManager mgr2 = cache2.getTransactionManager();
Transaction tx1, tx2;
1.11 +1 -1 JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticWithPassivationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticWithPassivationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticWithPassivationTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- OptimisticWithPassivationTest.java 25 Apr 2006 15:18:29 -0000 1.10
+++ OptimisticWithPassivationTest.java 20 Jul 2006 09:03:54 -0000 1.11
@@ -49,7 +49,7 @@
private TreeCache createLocalCache() throws Exception
{
TreeCache cache = createCacheUnstarted(false);
- cache.setCacheLoaderConfiguration(getCacheLoaderConfig(getTempDir()));
+ cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(getTempDir()));
cache.createService();
cache.startService();
More information about the jboss-cvs-commits
mailing list