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,6 +47,7 @@ public abstract class JMSClientTestSupport extends AmqpClientTestSupport {
|
|||
@After
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
try {
|
||||
for (Connection connection : jmsConnections) {
|
||||
try {
|
||||
connection.close();
|
||||
|
@ -51,6 +55,9 @@ public abstract class JMSClientTestSupport extends AmqpClientTestSupport {
|
|||
ignored.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.warn(e);
|
||||
}
|
||||
jmsConnections.clear();
|
||||
|
||||
super.tearDown();
|
||||
|
|
|
@ -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