From 0dd7973aa2500c77dc726d795c7d5fd0a92a5e5c Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Thu, 24 Sep 2009 16:34:56 +0000 Subject: [PATCH] merging http://fisheye6.atlassian.com/changelog/activemq/trunk?cs=818013 git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-5.3@818541 13f79535-47bb-0310-9956-ffa450edef68 --- .../broker/region/cursors/StoreBasedCursorTest.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/StoreBasedCursorTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/StoreBasedCursorTest.java index 1a9c150e14..ec0a5cf6fd 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/StoreBasedCursorTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/StoreBasedCursorTest.java @@ -90,7 +90,8 @@ public class StoreBasedCursorTest extends TestCase { systemUsage.getMemoryUsage().setLimit(systemLimit); PolicyEntry policy = new PolicyEntry(); - policy.setMemoryLimit(memoryLimit); + policy.setProducerFlowControl(true); + policy.setUseCache(true); PolicyMap pMap = new PolicyMap(); pMap.setDefaultEntry(policy); broker.setDestinationPolicy(pMap); @@ -112,13 +113,15 @@ public class StoreBasedCursorTest extends TestCase { start(); MessageProducer producer = session.createProducer(queue); producer.setDeliveryMode(deliveryMode); + int i =0; try { - for (int i = 0; i < 200; i++) { + for (i = 0; i < 200; i++) { TextMessage message = session.createTextMessage(createMessageText(i)); producer.send(message); } } catch (javax.jms.ResourceAllocationException e) { - fail(e.getMessage() + ". percentUsage = " + broker.getSystemUsage().getMemoryUsage().getPercentUsage()); + e.printStackTrace(); + fail(e.getMessage() + " num msgs = " + i + ". percentUsage = " + broker.getSystemUsage().getMemoryUsage().getPercentUsage()); } stop(); } @@ -130,8 +133,8 @@ public class StoreBasedCursorTest extends TestCase { } public void testUseCachePersistent() throws Exception { - int limit = memoryLimit / 3; - configureBroker(limit, limit); + int limit = memoryLimit / 2; + configureBroker(limit, memoryLimit); sendMessages(DeliveryMode.PERSISTENT); }