NO-JIRA: trivial test fixes on AMQP
This commit is contained in:
parent
5e6687e0e2
commit
ac97d6f057
|
@ -24,11 +24,14 @@ import javax.jms.ExceptionListener;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
|
|
||||||
import org.apache.qpid.jms.JmsConnectionFactory;
|
import org.apache.qpid.jms.JmsConnectionFactory;
|
||||||
|
import org.jboss.logging.Logger;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
public abstract class JMSClientTestSupport extends AmqpClientTestSupport {
|
public abstract class JMSClientTestSupport extends AmqpClientTestSupport {
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(JMSClientTestSupport.class);
|
||||||
|
|
||||||
protected LinkedList<Connection> jmsConnections = new LinkedList<>();
|
protected LinkedList<Connection> jmsConnections = new LinkedList<>();
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@ -44,6 +47,7 @@ public abstract class JMSClientTestSupport extends AmqpClientTestSupport {
|
||||||
@After
|
@After
|
||||||
@Override
|
@Override
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
|
try {
|
||||||
for (Connection connection : jmsConnections) {
|
for (Connection connection : jmsConnections) {
|
||||||
try {
|
try {
|
||||||
connection.close();
|
connection.close();
|
||||||
|
@ -51,6 +55,9 @@ public abstract class JMSClientTestSupport extends AmqpClientTestSupport {
|
||||||
ignored.printStackTrace();
|
ignored.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.warn(e);
|
||||||
|
}
|
||||||
jmsConnections.clear();
|
jmsConnections.clear();
|
||||||
|
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
|
|
|
@ -193,6 +193,8 @@ public class JMSTransactionTest extends JMSClientTestSupport {
|
||||||
|
|
||||||
session.rollback();
|
session.rollback();
|
||||||
|
|
||||||
|
Wait.waitFor(() -> MSG_COUNT == queueView.getConsumerCount());
|
||||||
|
|
||||||
assertEquals(MSG_COUNT, queueView.getMessageCount());
|
assertEquals(MSG_COUNT, queueView.getMessageCount());
|
||||||
|
|
||||||
// Consume again..check we receive all the messages.
|
// Consume again..check we receive all the messages.
|
||||||
|
|
Loading…
Reference in New Issue