[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/optimistic ...
Manik Surtani
msurtani at jboss.com
Thu Jul 20 06:54:01 EDT 2006
User: msurtani
Date: 06/07/20 06:54:01
Modified: tests/functional/org/jboss/cache/optimistic
FullStackInterceptorTest.java MockInterceptor.java
NodeInterceptorGetChildrenNamesTest.java
NodeInterceptorGetKeysTest.java
OptimisticCreateIfNotExistsInterceptorTest.java
ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
Log:
Fixed some broken UTs to use the new xml parsers, cache factories, etc.
Revision Changes Path
1.18 +2 -1 JBossCache/tests/functional/org/jboss/cache/optimistic/FullStackInterceptorTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FullStackInterceptorTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/FullStackInterceptorTest.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- FullStackInterceptorTest.java 4 Jan 2006 23:33:06 -0000 1.17
+++ FullStackInterceptorTest.java 20 Jul 2006 10:54:01 -0000 1.18
@@ -4,6 +4,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.loader.SamplePojo;
import org.jboss.cache.transaction.DummyTransactionManager;
@@ -651,7 +652,7 @@
protected TreeCache createSyncReplicatedCache() throws Exception
{
- return createReplicatedCache("temp" + groupIncreaser, TreeCache.REPL_SYNC);
+ return createReplicatedCache("temp" + groupIncreaser, Configuration.CacheMode.REPL_SYNC);
}
public void testPuts() throws Exception
1.4 +1 -1 JBossCache/tests/functional/org/jboss/cache/optimistic/MockInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MockInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/MockInterceptor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- MockInterceptor.java 14 Dec 2005 15:40:24 -0000 1.3
+++ MockInterceptor.java 20 Jul 2006 10:54:01 -0000 1.4
@@ -22,7 +22,7 @@
public void setCache(TreeCache cache)
{
- super.setCache(cache);
+ super.setCache(cache.getSPI());
}
1.7 +17 -17 JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeInterceptorGetChildrenNamesTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- NodeInterceptorGetChildrenNamesTest.java 26 Jan 2006 20:36:29 -0000 1.6
+++ NodeInterceptorGetChildrenNamesTest.java 20 Jul 2006 10:54:01 -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");
@@ -87,8 +87,8 @@
Transaction tx2 = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx2);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx2));
+ InvocationContext.getCurrent().setTransaction(tx2);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx2));
assertEquals(0, cache.getChildrenNames("/").size());
mgr.commit();
@@ -103,11 +103,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);
@@ -120,8 +120,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));
assertEquals(null, dummy.getCalled());
@@ -154,11 +154,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);
@@ -171,8 +171,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 +17 -17 JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorGetKeysTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeInterceptorGetKeysTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorGetKeysTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- NodeInterceptorGetKeysTest.java 26 Jan 2006 20:36:29 -0000 1.6
+++ NodeInterceptorGetKeysTest.java 20 Jul 2006 10:54:01 -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");
@@ -86,8 +86,8 @@
Transaction tx2 = mgr.getTransaction();
// inject InvocationContext
- cache.getInvocationContext().setTransaction(tx2);
- cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx2));
+ InvocationContext.getCurrent().setTransaction(tx2);
+ InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx2));
assertNull(cache.get("/one/two", "key1"));
mgr.commit();
@@ -102,11 +102,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);
@@ -119,8 +119,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));
assertEquals(null, dummy.getCalled());
@@ -151,11 +151,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);
@@ -168,8 +168,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.8 +10 -10 JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticCreateIfNotExistsInterceptorTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticCreateIfNotExistsInterceptorTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticCreateIfNotExistsInterceptorTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- OptimisticCreateIfNotExistsInterceptorTest.java 16 May 2006 22:42:27 -0000 1.7
+++ OptimisticCreateIfNotExistsInterceptorTest.java 20 Jul 2006 10:54:01 -0000 1.8
@@ -53,8 +53,8 @@
workspace = entry.getTransactionWorkSpace();
// set invocation context elements
- cache.getInvocationContext().setGlobalTransaction(gtx);
- cache.getInvocationContext().setTransaction(tx);
+ InvocationContext.getCurrent().setGlobalTransaction(gtx);
+ InvocationContext.getCurrent().setTransaction(tx);
}
public void testNodeCreation() throws Exception
@@ -64,9 +64,9 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(dummy);
@@ -100,9 +100,9 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(dummy);
@@ -126,8 +126,8 @@
txManager.commit();
// we should now remove stuff from the InvocationCtx
- cache.getInvocationContext().setGlobalTransaction(null);
- cache.getInvocationContext().setTransaction(null);
+ InvocationContext.getCurrent().setGlobalTransaction(null);
+ InvocationContext.getCurrent().setTransaction(null);
try
{
@@ -152,9 +152,9 @@
final TreeCache cache = createCacheWithListener(listener);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- interceptor.setCache(cache);
+ interceptor.setCache(cache.getSPI());
MockInterceptor dummy = new MockInterceptor();
- dummy.setCache(cache);
+ dummy.setCache(cache.getSPI());
interceptor.setNext(dummy);
cache.setInterceptorChain(interceptor);
1.13 +1 -0 JBossCache/tests/functional/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- ThreadedOptimisticCreateIfNotExistsInterceptorTest.java 20 Jul 2006 10:31:45 -0000 1.12
+++ ThreadedOptimisticCreateIfNotExistsInterceptorTest.java 20 Jul 2006 10:54:01 -0000 1.13
@@ -11,6 +11,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.OptimisticTransactionEntry;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.InvocationContext;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.interceptors.Interceptor;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
More information about the jboss-cvs-commits
mailing list