{
// Create a session in auto acknowledge mode. This problem shows up in auto acknowledge if the client acks
// message at the end of the onMessage method, after a close has been sent.
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
ThreadTestCoordinator tt = new ThreadTestCoordinator(2);
tt.addTestThread(testThread1, 0);
tt.addTestThread(testThread2, 1);
tt.setDeadlockTimeout(500);
tt.run();
String errorMessage = tt.joinAndRetrieveMessages();
// Print any error messages or exceptions.
log.debug(errorMessage);
if (!tt.getExceptions().isEmpty())
{
for (Exception e : tt.getExceptions())
{
log.debug("Exception thrown during test thread: ", e);
}
}