Search in sources :

Example 1 with HasEntry

use of org.jpos.transaction.participant.HasEntry in project jPOS by jpos.

the class TransactionManagerTest method testPrepare10.

@Test
public void testPrepare10() throws Throwable {
    HasEntry hasEntry = new HasEntry();
    AbstractList<TransactionParticipant> arrayList = new ArrayList();
    arrayList.add(new Debug());
    int result = transactionManager.prepare(1, 100L, new NotActiveException("testTransactionManagerParam1"), members, arrayList.iterator(), members.add(hasEntry), null, null);
    assertEquals(2, members.size(), "(ArrayList) members.size()");
    assertSame(hasEntry, members.get(0), "(ArrayList) members.get(0)");
    assertEquals(0, result, "result");
}
Also used : BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) HasEntry(org.jpos.transaction.participant.HasEntry) ArrayList(java.util.ArrayList) NotActiveException(java.io.NotActiveException) Debug(org.jpos.transaction.participant.Debug) CheckPoint(org.jpos.transaction.participant.CheckPoint) Test(org.junit.jupiter.api.Test)

Example 2 with HasEntry

use of org.jpos.transaction.participant.HasEntry in project jPOS by jpos.

the class TransactionManagerTest method testPrepare8.

@Test
public void testPrepare8() throws Throwable {
    AbstractList<TransactionParticipant> arrayList = new ArrayList(1000);
    arrayList.add(new HasEntry());
    LogEvent evt = new LogEvent();
    int result = transactionManager.prepare(1, 100L, Boolean.TRUE, new ArrayList(), arrayList.iterator(), false, evt, null);
    assertEquals(3, evt.getPayLoad().size(), "evt.payLoad.size()");
    assertEquals(TransactionConstants.PREPARED, result, "result");
}
Also used : BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) LogEvent(org.jpos.util.LogEvent) HasEntry(org.jpos.transaction.participant.HasEntry) ArrayList(java.util.ArrayList) CheckPoint(org.jpos.transaction.participant.CheckPoint) Test(org.junit.jupiter.api.Test)

Aggregations

ArrayList (java.util.ArrayList)2 BSHTransactionParticipant (org.jpos.transaction.participant.BSHTransactionParticipant)2 CheckPoint (org.jpos.transaction.participant.CheckPoint)2 HasEntry (org.jpos.transaction.participant.HasEntry)2 Test (org.junit.jupiter.api.Test)2 NotActiveException (java.io.NotActiveException)1 Debug (org.jpos.transaction.participant.Debug)1 LogEvent (org.jpos.util.LogEvent)1