use of org.jpos.transaction.participant.Forward in project jPOS by jpos.
the class TransactionManagerTest method testPrepareThrowsNullPointerException3.
@Test
public void testPrepareThrowsNullPointerException3() throws Throwable {
List<TransactionParticipant> members = new ArrayList();
List<TransactionParticipant> arrayList = new ArrayList();
arrayList.add(new Forward());
LogEvent evt = new LogEvent();
try {
transactionManager.prepare(1, 100L, Boolean.FALSE, members, arrayList.iterator(), false, evt, null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertEquals("evt.payLoad.size()", 1, evt.getPayLoad().size());
assertEquals("evt.payLoad.get(0)", " prepare: org.jpos.transaction.participant.Forward ABORTED", evt.getPayLoad().get(0));
assertNull("ex.getMessage()", ex.getMessage());
assertNull("transactionManager.psp", transactionManager.psp);
assertNull("transactionManager.groups", transactionManager.groups);
assertEquals("(ArrayList) members.size()", 0, members.size());
}
}
use of org.jpos.transaction.participant.Forward in project jPOS by jpos.
the class TransactionManagerTest method testAbort3.
@Test
public void testAbort3() throws Throwable {
LogEvent evt = new LogEvent("testTransactionManagerTag", Integer.valueOf(2));
transactionManager.abort(1, 100L, Boolean.TRUE, members, members.add(new Forward()), evt, null);
assertEquals("evt.payLoad.size()", 2, evt.getPayLoad().size());
assertEquals("evt.payLoad.get(1)", " abort: org.jpos.transaction.participant.Forward", evt.getPayLoad().get(1));
}
Aggregations