Author: manik.surtani(a)jboss.com
Date: 2008-01-23 12:08:03 -0500 (Wed, 23 Jan 2008)
New Revision: 5204
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
Log:
Updated to use indirection to get transaction manager based on environment settings
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-01-23
16:43:44 UTC (rev 5203)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-01-23
17:08:03 UTC (rev 5204)
@@ -9,6 +9,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.interceptors.CacheMgmtInterceptor;
import org.jboss.cache.interceptors.CallInterceptor;
@@ -59,11 +60,9 @@
protected CacheSPI<Object, Object> createCacheUnstarted(boolean optimistic)
throws Exception
{
- CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new
DefaultCacheFactory().createCache(false);
- if (optimistic)
cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
-
cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
- cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
+ CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new
DefaultCacheFactory<Object,
Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL),
false);
+ if (optimistic)
cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
return cache;
}
Show replies by date