diff --git a/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java b/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java index 32873ad42c..596b4737e0 100644 --- a/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java +++ b/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java @@ -61,7 +61,7 @@ import org.infinispan.util.logging.LogFactory; */ public class ConcurrentWriteTest extends SingleNodeTestCase { private static final Log log = LogFactory.getLog(ConcurrentWriteTest.class); - + private static final boolean trace = log.isTraceEnabled(); /** * when USER_COUNT==1, tests pass, when >4 tests fail */ @@ -423,15 +423,21 @@ public class ConcurrentWriteTest extends SingleNodeTestCase { for (int i = 0; i < ITERATION_COUNT && !TERMINATE_ALL_USERS; i++) { if (contactExists()) throw new IllegalStateException("contact already exists before add, customerId=" + customerId); + if (trace) log.trace("Add contact for customer " + customerId); addContact(customerId); + if (trace) log.trace("Added contact"); thinkRandomTime(); if (!contactExists()) throw new IllegalStateException("contact missing after successful add, customerId=" + customerId); thinkRandomTime(); + if (trace) log.trace("Read all customers' first contact"); // read everyone's contacts readEveryonesFirstContact(); + if (trace) log.trace("Read completed"); thinkRandomTime(); + if (trace) log.trace("Remove contact of customer" + customerId); removeContact(customerId); + if (trace) log.trace("Removed contact"); if (contactExists()) throw new IllegalStateException("contact still exists after successful remove call, customerId=" + customerId); thinkRandomTime(); diff --git a/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java b/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java index df89b91a57..b44a31477d 100644 --- a/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java +++ b/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java @@ -34,7 +34,10 @@ public abstract class SingleNodeTestCase extends FunctionalTestCase { protected TransactionManager getTransactionManager() { try { - return getTransactionManagerLookupClass().newInstance().getTransactionManager(null); + if (getTransactionManagerLookupClass() == null) + return null; + else + return getTransactionManagerLookupClass().newInstance().getTransactionManager(null); } catch (Exception e) { log.error("Error", e); throw new RuntimeException(e); @@ -81,7 +84,9 @@ public abstract class SingleNodeTestCase extends FunctionalTestCase { cfg.setProperty(Environment.USE_QUERY_CACHE, String.valueOf(getUseQueryCache())); cfg.setProperty(Environment.CACHE_REGION_FACTORY, getCacheRegionFactory().getName()); cfg.setProperty(Environment.CONNECTION_PROVIDER, getConnectionProviderClass().getName()); - cfg.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, getTransactionManagerLookupClass().getName()); + if (getTransactionManagerLookupClass() != null) { + cfg.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, getTransactionManagerLookupClass().getName()); + } cfg.setProperty(Environment.TRANSACTION_STRATEGY, getTransactionFactoryClass().getName()); }