Session session = c.createSession(true, Session.SESSION_TRANSACTED);
MessageConsumer consumer = session.createConsumer(dest);
proxy.pause();
// writes should back up... writeTimeout will kick in a abort the connection
TimeUnit.SECONDS.sleep(10);
proxy.goOn();
assertNotNull("can receive buffered messages", consumer.receive(500));
try {
session.commit();
fail("expect commit to fail as server has aborted writeTimeout connection");
} catch (JMSException expected) {