Author: bstansberry(a)jboss.com
Date: 2008-02-27 12:48:50 -0500 (Wed, 27 Feb 2008)
New Revision: 14369
Modified:
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/CacheTestCaseBase.java
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/DualNodeTestCaseBase.java
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/PessimisticEntityReplicationTest.java
Log:
Refactor configuration of TransactionFactory
Modified:
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/CacheTestCaseBase.java
===================================================================
---
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/CacheTestCaseBase.java 2008-02-27
17:47:36 UTC (rev 14368)
+++
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/CacheTestCaseBase.java 2008-02-27
17:48:50 UTC (rev 14369)
@@ -69,8 +69,11 @@
cfg.setProperty(Environment.USE_QUERY_CACHE,
String.valueOf(getUseQueryCache()));
cfg.setProperty(Environment.CONNECTION_PROVIDER,
getConnectionProviderClass().getName());
cfg.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY,
getTransactionManagerLookupClass().getName());
-// cfg.setProperty( Environment.TRANSACTION_STRATEGY,
CMTTransactionFactory.class.getName() );
+ Class transactionFactory = getTransactionFactoryClass();
+ if (transactionFactory != null)
+ cfg.setProperty( Environment.TRANSACTION_STRATEGY,
transactionFactory.getName() );
+
configureCacheFactory(cfg);
}
@@ -96,6 +99,10 @@
protected Class getTransactionManagerLookupClass() {
return org.hibernate.test.tm.TransactionManagerLookupImpl.class;
}
+
+ protected Class getTransactionFactoryClass() {
+ return null;
+ }
@Override
public void afterConfigurationBuilt(Mappings mappings, Dialect dialect) {
Modified:
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/DualNodeTestCaseBase.java
===================================================================
---
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/DualNodeTestCaseBase.java 2008-02-27
17:47:36 UTC (rev 14368)
+++
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/DualNodeTestCaseBase.java 2008-02-27
17:48:50 UTC (rev 14369)
@@ -26,6 +26,7 @@
import org.hibernate.test.cache.jbc2.functional.util.DualNodeTestUtil;
import org.hibernate.test.cache.jbc2.functional.util.DualNodeTransactionManagerLookup;
import org.hibernate.test.cache.jbc2.functional.util.TestCacheInstanceManager;
+import org.hibernate.transaction.CMTTransactionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -94,6 +95,11 @@
@Override
protected Class getTransactionManagerLookupClass() {
return DualNodeTransactionManagerLookup.class;
+ }
+
+ @Override
+ protected Class getTransactionFactoryClass() {
+ return CMTTransactionFactory.class;
}
@Override
Modified:
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/PessimisticEntityReplicationTest.java
===================================================================
---
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/PessimisticEntityReplicationTest.java 2008-02-27
17:47:36 UTC (rev 14368)
+++
core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/PessimisticEntityReplicationTest.java 2008-02-27
17:48:50 UTC (rev 14369)
@@ -68,18 +68,7 @@
{
super(name);
}
-
-
-
- @Override
- public void configure(Configuration cfg)
- {
- cfg.setProperty( Environment.TRANSACTION_STRATEGY,
CMTTransactionFactory.class.getName() );
- super.configure(cfg);
- }
-
-
@Override
protected Class<? extends RegionFactory> getCacheRegionFactory()
{
Show replies by date