Author: galder.zamarreno(a)jboss.com
Date: 2009-12-09 13:20:38 -0500 (Wed, 09 Dec 2009)
New Revision: 18184
Modified:
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java
Log:
[HHH-4520] (Infinispan second level cache integration can cache stale collection data)
testManyUsers now enabled after ISPN-277 was fixed.
Modified:
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java
===================================================================
---
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java 2009-12-09
16:18:33 UTC (rev 18183)
+++
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java 2009-12-09
18:20:38 UTC (rev 18184)
@@ -61,7 +61,7 @@
*/
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 @@
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();
Modified:
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java
===================================================================
---
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java 2009-12-09
16:18:33 UTC (rev 18183)
+++
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java 2009-12-09
18:20:38 UTC (rev 18184)
@@ -34,7 +34,10 @@
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 @@
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());
}
Show replies by date