diff --git a/cache-infinispan/pom.xml b/cache-infinispan/pom.xml index 2440d6c931..1ed78f52e7 100644 --- a/cache-infinispan/pom.xml +++ b/cache-infinispan/pom.xml @@ -17,7 +17,7 @@ Integration of Hibernate with Infinispan - 4.0.0.CR2 + 4.0.0-SNAPSHOT 1.8.0.2 2.2 3.4.GA 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 4e11450ce8..32873ad42c 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 @@ -189,39 +189,39 @@ public class ConcurrentWriteTest extends SingleNodeTestCase { } -// /** -// * TODO: This will fail until ISPN-??? has been fixed. -// * -// * @throws Exception -// */ -// public void testManyUsers() throws Throwable { -// try { -// // setup - create users -// for (int i = 0; i < USER_COUNT; i++) { -// Customer customer = createCustomer(0); -// getCustomerIDs().add(customer.getId()); -// } -// assertEquals("failed to create enough Customers", USER_COUNT, getCustomerIDs().size()); -// -// final ExecutorService executor = Executors.newFixedThreadPool(USER_COUNT); -// -// CyclicBarrier barrier = new CyclicBarrier(USER_COUNT + 1); -// List> futures = new ArrayList>(USER_COUNT); -// for (Integer customerId : getCustomerIDs()) { -// Future future = executor.submit(new UserRunner(customerId, barrier)); -// futures.add(future); -// Thread.sleep(LAUNCH_INTERVAL_MILLIS); // rampup -// } -//// barrier.await(); // wait for all threads to be ready -// barrier.await(45, TimeUnit.SECONDS); // wait for all threads to finish -// log.info("All threads finished, let's shutdown the executor and check whether any exceptions were reported"); -// for (Future future : futures) future.get(); -// log.info("All future gets checked"); -// } catch (Throwable t) { -// log.error("Error running test", t); -// throw t; -// } -// } + /** + * TODO: This will fail until ISPN-??? has been fixed. + * + * @throws Exception + */ + public void testManyUsers() throws Throwable { + try { + // setup - create users + for (int i = 0; i < USER_COUNT; i++) { + Customer customer = createCustomer(0); + getCustomerIDs().add(customer.getId()); + } + assertEquals("failed to create enough Customers", USER_COUNT, getCustomerIDs().size()); + + final ExecutorService executor = Executors.newFixedThreadPool(USER_COUNT); + + CyclicBarrier barrier = new CyclicBarrier(USER_COUNT + 1); + List> futures = new ArrayList>(USER_COUNT); + for (Integer customerId : getCustomerIDs()) { + Future future = executor.submit(new UserRunner(customerId, barrier)); + futures.add(future); + Thread.sleep(LAUNCH_INTERVAL_MILLIS); // rampup + } +// barrier.await(); // wait for all threads to be ready + barrier.await(45, TimeUnit.SECONDS); // wait for all threads to finish + log.info("All threads finished, let's shutdown the executor and check whether any exceptions were reported"); + for (Future future : futures) future.get(); + log.info("All future gets checked"); + } catch (Throwable t) { + log.error("Error running test", t); + throw t; + } + } public void cleanup() throws Exception { getCustomerIDs().clear();