mirror of https://github.com/apache/activemq.git
Increased timeout to fix AMQ-4854
This commit is contained in:
parent
50ec158e25
commit
982b728f24
|
@ -31,10 +31,20 @@ import javax.jms.Session;
|
|||
import javax.jms.TextMessage;
|
||||
|
||||
import org.apache.activemq.broker.BrokerService;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.TestName;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class JmsRollbackRedeliveryTest /*extends AutoFailTestSupport*/ {
|
||||
@Rule
|
||||
public TestName testName = new TestName();
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(JmsRollbackRedeliveryTest.class);
|
||||
final int nbMessages = 10;
|
||||
final String destinationName = "Destination";
|
||||
|
@ -43,41 +53,53 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
|
|||
boolean rollback = true;
|
||||
BrokerService broker;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
setAutoFail(true);
|
||||
super.setUp();
|
||||
//setAutoFail(true);
|
||||
//super.setUp();
|
||||
|
||||
LOG.info(">>>> Starting " + testName.getMethodName());
|
||||
broker = new BrokerService();
|
||||
broker.setPersistent(false);
|
||||
broker.setUseJmx(false);
|
||||
broker.start();
|
||||
broker.waitUntilStarted();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
//super.tearDown();
|
||||
if (broker != null) {
|
||||
broker.stop();
|
||||
broker.waitUntilStopped();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRedelivery() throws Exception {
|
||||
doTestRedelivery(brokerUrl, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRedeliveryWithInterleavedProducer() throws Exception {
|
||||
doTestRedelivery(brokerUrl, true);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRedeliveryWithPrefetch0() throws Exception {
|
||||
doTestRedelivery(brokerUrl + "?jms.prefetchPolicy.queuePrefetch=0", true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRedeliveryWithPrefetch1() throws Exception {
|
||||
doTestRedelivery(brokerUrl + "?jms.prefetchPolicy.queuePrefetch=1", true);
|
||||
}
|
||||
|
||||
public void doTestRedelivery(String brokerUrl, boolean interleaveProducer) throws Exception {
|
||||
|
||||
LOG.info(">>>> entering doTestRedelivery interleaveProducer is " + interleaveProducer);
|
||||
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(brokerUrl);
|
||||
|
||||
Connection connection = connectionFactory.createConnection();
|
||||
|
@ -116,6 +138,7 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRedeliveryOnSingleConsumer() throws Exception {
|
||||
|
||||
ConnectionFactory connectionFactory =
|
||||
|
@ -150,6 +173,8 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRedeliveryOnSingleSession() throws Exception {
|
||||
|
||||
ConnectionFactory connectionFactory =
|
||||
|
@ -185,6 +210,7 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
|
|||
}
|
||||
|
||||
// AMQ-1593
|
||||
@Test
|
||||
public void testValidateRedeliveryCountOnRollback() throws Exception {
|
||||
|
||||
final int numMessages = 1;
|
||||
|
@ -216,6 +242,7 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
|
|||
}
|
||||
|
||||
// AMQ-1593
|
||||
@Test
|
||||
public void testValidateRedeliveryCountOnRollbackWithPrefetch0() throws Exception {
|
||||
|
||||
final int numMessages = 1;
|
||||
|
@ -260,6 +287,7 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
|
|||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRedeliveryPropertyWithNoRollback() throws Exception {
|
||||
final int numMessages = 1;
|
||||
ConnectionFactory connectionFactory =
|
||||
|
|
Loading…
Reference in New Issue