On a slow machine this test can take a lot longer, so increase the wait time accordingly.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1085119 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2011-03-24 20:31:26 +00:00
parent 751ba900ae
commit 08bd791c5d
1 changed files with 5 additions and 3 deletions

View File

@ -29,6 +29,8 @@ import javax.jms.Session;
public class StoreUsageTest extends EmbeddedBrokerTestSupport {
final int WAIT_TIME_MILLS = 20*1000;
@Override
protected BrokerService createBroker() throws Exception {
BrokerService broker = super.createBroker();
@ -51,17 +53,17 @@ public class StoreUsageTest extends EmbeddedBrokerTestSupport {
producer.start();
// wait for the producer to block
Thread.sleep(5000);
Thread.sleep(WAIT_TIME_MILLS / 2);
broker.getAdminView().setStoreLimit(1024 * 1024);
Thread.sleep(5000);
Thread.sleep(WAIT_TIME_MILLS);
Wait.waitFor(new Wait.Condition() {
public boolean isSatisified() throws Exception {
return producer.getSentCount() == producer.getMessageCount();
}
}, 5000);
}, WAIT_TIME_MILLS * 2);
assertEquals("Producer didn't send all messages", producer.getMessageCount(), producer.getSentCount());