[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/options/cachemodelocal ...
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/options/cachemodelocal
AsyncInvalidationOptLocksTest.java
AsyncInvalidationPessLocksTest.java
CacheModeLocalTestBase.java
Log:
Fixed some broken UTs to use the new xml parsers, cache factories, etc.
Revision Changes Path
1.4 +2 -2 JBossCache/tests/functional/org/jboss/cache/options/cachemodelocal/AsyncInvalidationOptLocksTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AsyncInvalidationOptLocksTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/options/cachemodelocal/AsyncInvalidationOptLocksTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- AsyncInvalidationOptLocksTest.java 5 May 2006 12:06:58 -0000 1.3
+++ AsyncInvalidationOptLocksTest.java 20 Jul 2006 09:03:54 -0000 1.4
@@ -6,14 +6,14 @@
*/
package org.jboss.cache.options.cachemodelocal;
-import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.misc.TestingUtil;
public class AsyncInvalidationOptLocksTest extends CacheModeLocalTestBase
{
public AsyncInvalidationOptLocksTest()
{
- cacheMode = TreeCache.INVALIDATION_ASYNC;
+ cacheMode = Configuration.CacheMode.INVALIDATION_ASYNC;
nodeLockingScheme = "OPTIMISTIC";
isInvalidation = true;
}
1.4 +2 -2 JBossCache/tests/functional/org/jboss/cache/options/cachemodelocal/AsyncInvalidationPessLocksTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AsyncInvalidationPessLocksTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/options/cachemodelocal/AsyncInvalidationPessLocksTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- AsyncInvalidationPessLocksTest.java 5 May 2006 12:06:58 -0000 1.3
+++ AsyncInvalidationPessLocksTest.java 20 Jul 2006 09:03:54 -0000 1.4
@@ -6,14 +6,14 @@
*/
package org.jboss.cache.options.cachemodelocal;
-import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.misc.TestingUtil;
public class AsyncInvalidationPessLocksTest extends CacheModeLocalTestBase
{
public AsyncInvalidationPessLocksTest()
{
- cacheMode = TreeCache.INVALIDATION_ASYNC;
+ cacheMode = Configuration.CacheMode.INVALIDATION_ASYNC;
nodeLockingScheme = "PESSIMISTIC";
isInvalidation = true;
}
1.4 +17 -12 JBossCache/tests/functional/org/jboss/cache/options/cachemodelocal/CacheModeLocalTestBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheModeLocalTestBase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/options/cachemodelocal/CacheModeLocalTestBase.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- CacheModeLocalTestBase.java 12 Jun 2006 20:24:32 -0000 1.3
+++ CacheModeLocalTestBase.java 20 Jul 2006 09:03:54 -0000 1.4
@@ -9,8 +9,9 @@
import junit.framework.Assert;
import junit.framework.TestCase;
import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
import org.jboss.cache.TreeCache;
-import org.jboss.cache.interceptors.Interceptor;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Option;
import javax.transaction.TransactionManager;
@@ -27,7 +28,7 @@
public abstract class CacheModeLocalTestBase extends TestCase
{
// to be subclassed.
- protected int cacheMode;
+ protected Configuration.CacheMode cacheMode;
protected String nodeLockingScheme;
/** set this to true if the implementing class plans to use an invalidating cache mode **/
protected boolean isInvalidation;
@@ -45,16 +46,20 @@
// force a tear down if the test runner didn't run one before (happens in IDEA)
if (cache1 != null || cache2 != null) tearDown();
- cache1 = new TreeCache("test", null, 1000);
- cache1.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
- cache1.setNodeLockingScheme( nodeLockingScheme );
- cache1.setCacheMode( cacheMode );
+ cache1 = new TreeCache();
+ cache1.getConfiguration().setClusterName("test");
+ cache1.getConfiguration().setInitialStateRetrievalTimeout(1000);
+ cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
+ cache1.getConfiguration().setNodeLockingScheme( nodeLockingScheme );
+ cache1.getConfiguration().setCacheMode( cacheMode );
cache1.startService();
- cache2 = new TreeCache("test", null, 1000);
- cache2.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
- cache2.setNodeLockingScheme(nodeLockingScheme);
- cache2.setCacheMode(cacheMode);
+ cache2 = new TreeCache();
+ cache2.getConfiguration().setClusterName("test");
+ cache2.getConfiguration().setInitialStateRetrievalTimeout(1000);
+ cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
+ cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
+ cache2.getConfiguration().setCacheMode(cacheMode);
cache2.startService();
localOverride = new Option();
@@ -159,7 +164,7 @@
{
// put some stuff in the cache first
// make sure we cleanup thread local vars.
- ((Interceptor) cache1.getInterceptors().get(0)).getInvocationContext().setOptionOverrides(null);
+ InvocationContext.getCurrent().setOptionOverrides(null);
cache1.put(fqn, key, "value");
delay();
Assert.assertEquals("value", cache1.get(fqn, key));
@@ -200,7 +205,7 @@
public void testRemoveKey() throws Exception
{
// put some stuff in the cache first
- ((Interceptor) cache1.getInterceptors().get(0)).getInvocationContext().setOptionOverrides(null);
+ InvocationContext.getCurrent().setOptionOverrides(null);
cache1.put(fqn, key, "value");
delay();
Assert.assertEquals("value", cache1.get(fqn, key));
More information about the jboss-cvs-commits
mailing list