NO-JIRA Simple test fixes

This commit is contained in:
Clebert Suconic 2019-07-19 17:51:04 -04:00
parent 1c6dea80dd
commit 200b3e1033
2 changed files with 8 additions and 7 deletions

View File

@ -300,13 +300,13 @@ public class TransportConstants {
public static final int DEFAULT_SHUTDOWN_TIMEOUT = parseDefaultVariable("DEFAULT_SHUTDOWN_TIMEOUT", 3_000);
private static int parseDefaultVariable(String variableName, int defaultValue) {
String variable = System.getProperty(TransportConstants.class.getName() + "." + variableName);
if (variable != null) {
try {
try {
String variable = System.getProperty(TransportConstants.class.getName() + "." + variableName);
if (variable != null) {
return Integer.parseInt(variable);
} catch (Throwable ignored) {
logger.debug(ignored);
}
} catch (Throwable ignored) {
logger.debug(ignored);
}
return defaultValue;

View File

@ -28,6 +28,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
import org.apache.activemq.artemis.core.server.impl.AddressInfo;
import org.apache.activemq.artemis.utils.UUIDGenerator;
import org.apache.activemq.artemis.utils.Wait;
import org.junit.Test;
public class AmqpMessageRoutingTest extends JMSClientTestSupport {
@ -100,8 +101,8 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport {
sendMessages("multicast://" + addressA, 1);
assertEquals(0, server.locateQueue(SimpleString.toSimpleString(queueA)).getMessageCount());
assertEquals(2, server.locateQueue(SimpleString.toSimpleString(queueC)).getMessageCount() + server.locateQueue(SimpleString.toSimpleString(queueB)).getMessageCount());
Wait.assertEquals(0, server.locateQueue(SimpleString.toSimpleString(queueA))::getMessageCount);
Wait.assertEquals(2, () -> (server.locateQueue(SimpleString.toSimpleString(queueC)).getMessageCount() + server.locateQueue(SimpleString.toSimpleString(queueB)).getMessageCount()));
}
@Test(timeout = 60000)