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 { public void setUp() throws Exception {
super.setUp(); super.setUp();
System.setProperty("org.apache.activemq.transport.AbstractInactivityMonitor.keepAliveTime", "5"); System.setProperty("org.apache.activemq.transport.AbstractInactivityMonitor.keepAliveTime", "5");
factory = new ActiveMQConnectionFactory(getConnectionUrl()); createFactories();
xaFactory = new ActiveMQXAConnectionFactory(getConnectionUrl());
SimpleString coreQueue = new SimpleString(queueName); SimpleString coreQueue = new SimpleString(queueName);
this.server.createQueue(coreQueue, RoutingType.ANYCAST, coreQueue, null, false, false, -1, false, true); this.server.createQueue(coreQueue, RoutingType.ANYCAST, coreQueue, null, false, false, -1, false, true);
testQueues.put(queueName, coreQueue); 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() { protected String getConnectionUrl() {
return urlString; return urlString;
} }

View File

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

View File

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