mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-5.3@818541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1c121bcded
commit
0dd7973aa2
|
@ -90,7 +90,8 @@ public class StoreBasedCursorTest extends TestCase {
|
||||||
systemUsage.getMemoryUsage().setLimit(systemLimit);
|
systemUsage.getMemoryUsage().setLimit(systemLimit);
|
||||||
|
|
||||||
PolicyEntry policy = new PolicyEntry();
|
PolicyEntry policy = new PolicyEntry();
|
||||||
policy.setMemoryLimit(memoryLimit);
|
policy.setProducerFlowControl(true);
|
||||||
|
policy.setUseCache(true);
|
||||||
PolicyMap pMap = new PolicyMap();
|
PolicyMap pMap = new PolicyMap();
|
||||||
pMap.setDefaultEntry(policy);
|
pMap.setDefaultEntry(policy);
|
||||||
broker.setDestinationPolicy(pMap);
|
broker.setDestinationPolicy(pMap);
|
||||||
|
@ -112,13 +113,15 @@ public class StoreBasedCursorTest extends TestCase {
|
||||||
start();
|
start();
|
||||||
MessageProducer producer = session.createProducer(queue);
|
MessageProducer producer = session.createProducer(queue);
|
||||||
producer.setDeliveryMode(deliveryMode);
|
producer.setDeliveryMode(deliveryMode);
|
||||||
|
int i =0;
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < 200; i++) {
|
for (i = 0; i < 200; i++) {
|
||||||
TextMessage message = session.createTextMessage(createMessageText(i));
|
TextMessage message = session.createTextMessage(createMessageText(i));
|
||||||
producer.send(message);
|
producer.send(message);
|
||||||
}
|
}
|
||||||
} catch (javax.jms.ResourceAllocationException e) {
|
} 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();
|
stop();
|
||||||
}
|
}
|
||||||
|
@ -130,8 +133,8 @@ public class StoreBasedCursorTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testUseCachePersistent() throws Exception {
|
public void testUseCachePersistent() throws Exception {
|
||||||
int limit = memoryLimit / 3;
|
int limit = memoryLimit / 2;
|
||||||
configureBroker(limit, limit);
|
configureBroker(limit, memoryLimit);
|
||||||
sendMessages(DeliveryMode.PERSISTENT);
|
sendMessages(DeliveryMode.PERSISTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue