You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/01/23 22:21:23 UTC
svn commit: r1437739 -
/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/OnePrefetchAsyncConsumerTest.java
Author: tabish
Date: Wed Jan 23 21:21:23 2013
New Revision: 1437739
URL: http://svn.apache.org/viewvc?rev=1437739&view=rev
Log:
On my old dual core Macbook this test sometimes fails because the listener has a four second wait and the test only allocates five seconds for processing of the messages to complete after the producer transaction commit is called.
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/OnePrefetchAsyncConsumerTest.java
Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/OnePrefetchAsyncConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/OnePrefetchAsyncConsumerTest.java?rev=1437739&r1=1437738&r2=1437739&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/OnePrefetchAsyncConsumerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/OnePrefetchAsyncConsumerTest.java Wed Jan 23 21:21:23 2013
@@ -70,7 +70,7 @@ public class OnePrefetchAsyncConsumerTes
long done = System.currentTimeMillis() + getMaxTestTime();
synchronized (testMutex) {
while (!testMutex.testCompleted && System.currentTimeMillis() < done) {
- testMutex.wait(TimeUnit.SECONDS.toMillis(5));
+ testMutex.wait(TimeUnit.SECONDS.toMillis(10));
}
}
@@ -84,6 +84,7 @@ public class OnePrefetchAsyncConsumerTes
return new ActiveMQConnectionFactory(broker.getTransportConnectors().get(0).getPublishableConnectString());
}
+ @Override
protected void setUp() throws Exception {
setAutoFail(true);
bindAddress = "tcp://localhost:0";
@@ -98,12 +99,14 @@ public class OnePrefetchAsyncConsumerTes
connection.start();
}
+ @Override
protected void tearDown() throws Exception {
connectionConsumer.close();
connection.close();
super.tearDown();
}
+ @Override
protected BrokerService createBroker() throws Exception {
BrokerService answer = super.createBroker();
PolicyMap policyMap = new PolicyMap();
@@ -130,7 +133,8 @@ public class OnePrefetchAsyncConsumerTes
serverSession = new TestServerSession(this);
}
- public ServerSession getServerSession() throws JMSException {
+ @Override
+ public ServerSession getServerSession() throws JMSException {
synchronized (this) {
if (serverSessionInUse) {
LOG.info("asked for session while in use, not serialised delivery");
@@ -155,14 +159,17 @@ public class OnePrefetchAsyncConsumerTes
session.setMessageListener(new TestMessageListener());
}
- public Session getSession() throws JMSException {
+ @Override
+ public Session getSession() throws JMSException {
return session;
}
- public void start() throws JMSException {
+ @Override
+ public void start() throws JMSException {
// use a separate thread to process the message asynchronously
new Thread() {
- public void run() {
+ @Override
+ public void run() {
// let the session deliver the message
session.run();
@@ -187,6 +194,7 @@ public class OnePrefetchAsyncConsumerTes
}
private class TestMessageListener implements MessageListener {
+ @Override
public void onMessage(Message message) {
try {
String text = ((TextMessage)message).getText();