Search in sources :

Example 6 with Debug

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

the class TransactionManagerTest method testPrepareForAbort2.

@Test
public void testPrepareForAbort2() throws Throwable {
    int result = transactionManager.prepareForAbort(new Debug(), 100L, Boolean.FALSE);
    assertEquals("result", 129, result);
}
Also used : CheckPoint(org.jpos.transaction.participant.CheckPoint) Debug(org.jpos.transaction.participant.Debug) Test(org.junit.Test)

Example 7 with Debug

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

the class TransactionManagerTest method testAbort4.

@Test
public void testAbort4() throws Throwable {
    members.add(new Debug());
    LogEvent evt = new LogEvent("testTransactionManagerTag");
    transactionManager.abort(1, 100L, "", members, false, evt, null);
    assertEquals("evt.payLoad.size()", 1, evt.getPayLoad().size());
    assertEquals("evt.payLoad.get(0)", "          abort: org.jpos.transaction.participant.Debug", evt.getPayLoad().get(0));
}
Also used : LogEvent(org.jpos.util.LogEvent) Debug(org.jpos.transaction.participant.Debug) Test(org.junit.Test)

Example 8 with Debug

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

the class TransactionManagerTest method testCommit3.

@Test
public void testCommit3() throws Throwable {
    members.add(new Debug());
    LogEvent evt = new LogEvent();
    transactionManager.commit(1, 100L, Boolean.FALSE, members, false, evt, null);
    assertEquals("evt.payLoad.size()", 1, evt.getPayLoad().size());
    assertEquals("evt.payLoad.get(0)", "         commit: org.jpos.transaction.participant.Debug", evt.getPayLoad().get(0));
}
Also used : LogEvent(org.jpos.util.LogEvent) Debug(org.jpos.transaction.participant.Debug) Test(org.junit.Test)

Example 9 with Debug

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

the class LogTest method testCreateFatal1.

@Test
public void testCreateFatal1() throws Throwable {
    LogEvent result = new Debug().createFatal();
    assertNull("result.getRealm()", result.getRealm());
}
Also used : Debug(org.jpos.transaction.participant.Debug) Test(org.junit.Test)

Example 10 with Debug

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

the class LogTest method testError.

@Test
public void testError() throws Throwable {
    new Debug().error(new Object());
    assertTrue("Test completed without Exception", true);
}
Also used : Debug(org.jpos.transaction.participant.Debug) Test(org.junit.Test)

Aggregations

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