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 org.apache.qpid.jms.JmsConnectionFactory;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
public abstract class JMSClientTestSupport extends AmqpClientTestSupport {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(JMSClientTestSupport.class);
|
||||
|
||||
protected LinkedList<Connection> jmsConnections = new LinkedList<>();
|
||||
|
||||
@Before
|
||||
|
@ -44,12 +47,16 @@ public abstract class JMSClientTestSupport extends AmqpClientTestSupport {
|
|||
@After
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
for (Connection connection : jmsConnections) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (Throwable ignored) {
|
||||
ignored.printStackTrace();
|
||||
try {
|
||||
for (Connection connection : jmsConnections) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (Throwable ignored) {
|
||||
ignored.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.warn(e);
|
||||
}
|
||||
jmsConnections.clear();
|
||||
|
||||
|
|
|
@ -193,6 +193,8 @@ public class JMSTransactionTest extends JMSClientTestSupport {
|
|||
|
||||
session.rollback();
|
||||
|
||||
Wait.waitFor(() -> MSG_COUNT == queueView.getConsumerCount());
|
||||
|
||||
assertEquals(MSG_COUNT, queueView.getMessageCount());
|
||||
|
||||
// Consume again..check we receive all the messages.
|
||||
|
|
Loading…
Reference in New Issue