ARTEMIS-883 fixing tests

This commit is contained in:
Clebert Suconic 2016-12-21 11:40:06 -05:00
parent 81df93ebcf
commit 8941f2b15d
3 changed files with 18 additions and 4 deletions

View File

@ -65,8 +65,7 @@ public class BasicOpenWireTest extends OpenWireTestBase {
public void setUp() throws Exception {
super.setUp();
System.setProperty("org.apache.activemq.transport.AbstractInactivityMonitor.keepAliveTime", "5");
factory = new ActiveMQConnectionFactory(getConnectionUrl());
xaFactory = new ActiveMQXAConnectionFactory(getConnectionUrl());
createFactories();
SimpleString coreQueue = new SimpleString(queueName);
this.server.createQueue(coreQueue, RoutingType.ANYCAST, coreQueue, null, false, false, -1, false, true);
testQueues.put(queueName, coreQueue);
@ -84,6 +83,11 @@ public class BasicOpenWireTest extends OpenWireTestBase {
}
}
protected void createFactories() {
factory = new ActiveMQConnectionFactory(getConnectionUrl());
xaFactory = new ActiveMQXAConnectionFactory(getConnectionUrl());
}
protected String getConnectionUrl() {
return urlString;
}

View File

@ -282,7 +282,7 @@ public class ProducerFlowControlTest extends BasicOpenWireTest {
protected void waitForBlockedOrResourceLimit(final AtomicBoolean done) throws InterruptedException {
while (true) {
Thread.sleep(2000);
Thread.sleep(100);
System.out.println("check done: " + done.get() + " ex: " + gotResourceException.get());
// the producer is blocked once the done flag stays true or there is a
// resource exception

View File

@ -28,7 +28,9 @@ import javax.jms.StreamMessage;
import javax.jms.TextMessage;
import java.nio.charset.StandardCharsets;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQMessageProducer;
import org.apache.activemq.ActiveMQXAConnectionFactory;
import org.apache.activemq.artemis.tests.integration.openwire.BasicOpenWireTest;
import org.apache.activemq.command.ActiveMQDestination;
import org.junit.Before;
@ -50,12 +52,20 @@ public class CompressedInteropTest extends BasicOpenWireTest {
@Before
@Override
public void setUp() throws Exception {
factory.setUseCompression(true);
super.setUp();
connection.start();
assertTrue(connection.isUseCompression());
}
@Override
protected void createFactories() {
super.createFactories();
factory.setUseCompression(true);
xaFactory.setUseCompression(true);
}
@Test
public void testCoreReceiveOpenWireCompressedMessages() throws Exception {
//TextMessage