@Override public void rollback() throws JMSException { next.rollback(); }
verify(txSession).rollback(); verify(txSession).close(); verify(nonTxSession).close();
/** * @throws JMSException */ public void rollback() throws JMSException { next.rollback(); }
@Override public void rollback() throws JMSException { next.rollback(); }
@Override public void rollback() throws JMSException { next.rollback(); }
@Override public void rollback() throws JMSException { next.rollback(); }
/** * Test that an attempt to call the <code>roolback()</code> method on a * <strong>non transacted</strong> <code>Session</code> throws a * <code>javax.jms.IllegalStateException</code>. */ public void testRollbackNonTransactedSession() { try { // senderSession has been created as non transacted in the setUp() method assertEquals(false, senderSession.getTransacted()); senderSession.rollback(); fail("Should raise an IllegalStateException, the session is not transacted.\n"); } catch (javax.jms.IllegalStateException e) { } catch (java.lang.IllegalStateException e) { fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n"); } catch (Exception e) { fail("Should raise a javax.jms.IllegalStateException, not a " + e); } }
/** * Test that a call to the <code>rollback()</code> method on a * <strong>transacted</strong> <code>Session</code> rollbacks all * the messages sent in the transaction. */ public void testRollbackTransactedSession() { try { // re-create senderSession as a transacted session senderSession = senderConnection.createQueueSession(true, 0); sender = senderSession.createSender(senderQueue); assertEquals(true, senderSession.getTransacted()); TextMessage message = senderSession.createTextMessage(); message.setText("testRollbackTransactedSession"); // send a message within a transacted session sender.send(message); // rollback the transaction -> the sent message shouldn't be received senderSession.rollback(); TextMessage m = (TextMessage) receiver.receiveNoWait(); // test that no message has been received assertEquals(null, m); } catch (Exception e) { fail(e); } }
/** * Test that an attempt to call the <code>roolback()</code> method on a * <strong>non transacted</strong> <code>Session</code> throws a * <code>javax.jms.IllegalStateException</code>. */ @Test public void testRollbackNonTransactedSession() { try { // senderSession has been created as non transacted in the setUp() method Assert.assertEquals(false, senderSession.getTransacted()); senderSession.rollback(); Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n"); } catch (javax.jms.IllegalStateException e) { } catch (java.lang.IllegalStateException e) { Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n"); } catch (Exception e) { Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e); } }
receiverSession.rollback();
/** * Test that a call to the <code>rollback()</code> method on a * <strong>transacted</strong> <code>Session</code> rollbacks all * the messages sent in the transaction. */ @Test public void testRollbackTransactedSession() { try { // re-create senderSession as a transacted session senderSession = senderConnection.createQueueSession(true, 0); sender = senderSession.createSender(senderQueue); Assert.assertEquals(true, senderSession.getTransacted()); TextMessage message = senderSession.createTextMessage(); message.setText("testRollbackTransactedSession"); // send a message within a transacted session sender.send(message); // rollback the transaction -> the sent message shouldn't be received senderSession.rollback(); TextMessage m = (TextMessage) receiver.receiveNoWait(); // test that no message has been received Assert.assertEquals(null, m); } catch (Exception e) { fail(e); } }
assertEquals(1, jmsxDeliveryCount); receiverSession.rollback();
receiverSession.rollback();
Assert.assertEquals(1, jmsxDeliveryCount); receiverSession.rollback();