Search in sources :

Example 1 with BSHTransactionParticipant

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

the class SimpleLogSourceTest method testWarning.

@Test
public void testWarning() throws Throwable {
    new BSHTransactionParticipant().warning("testSimpleLogSourceDetail", "");
    assertTrue(true, "Test completed without Exception");
}
Also used : BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) Test(org.junit.jupiter.api.Test)

Example 2 with BSHTransactionParticipant

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

the class SimpleLogSourceTest method testInfo1.

@Test
public void testInfo1() throws Throwable {
    new BSHTransactionParticipant().info("testSimpleLogSourceDetail", "testString");
    assertTrue(true, "Test completed without Exception");
}
Also used : BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) Test(org.junit.jupiter.api.Test)

Example 3 with BSHTransactionParticipant

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

the class SimpleLogSourceTest method testError.

@Test
public void testError() throws Throwable {
    new BSHTransactionParticipant().error("testSimpleLogSourceDetail", Integer.valueOf(0));
    assertTrue(true, "Test completed without Exception");
}
Also used : BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) Test(org.junit.jupiter.api.Test)

Example 4 with BSHTransactionParticipant

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

the class TransactionManagerTest method testPrepare7.

@Test
public void testPrepare7() throws Throwable {
    transactionManager = new TransactionManager();
    List<TransactionParticipant> members = new ArrayList();
    List<TransactionParticipant> arrayList = new ArrayList();
    BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant();
    boolean abort = arrayList.add(bSHTransactionParticipant);
    LogEvent evt = new LogEvent();
    int result = transactionManager.prepare(1, 100L, Boolean.FALSE, members, arrayList.iterator(), abort, evt, null);
    assertEquals(1, members.size(), "(ArrayList) members.size()");
    assertSame(bSHTransactionParticipant, members.get(0), "(ArrayList) members.get(0)");
    assertEquals(1, evt.getPayLoad().size(), "evt.payLoad.size()");
    assertEquals("prepareForAbort: org.jpos.transaction.participant.BSHTransactionParticipant", evt.getPayLoad().get(0), "evt.payLoad.get(0)");
    assertEquals(0, result, "result");
}
Also used : BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) LogEvent(org.jpos.util.LogEvent) ArrayList(java.util.ArrayList) CheckPoint(org.jpos.transaction.participant.CheckPoint) Test(org.junit.jupiter.api.Test)

Example 5 with BSHTransactionParticipant

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

the class QFactory2Test method testSetConfiguration3.

@Test
public void testSetConfiguration3() throws Throwable {
    String[] args = new String[0];
    Element e = new Element("testQFactoryName", "testQFactoryPrefix", "testQFactoryUri");
    Q2 q2 = new Q2(args);
    new QFactory(null, q2).setConfiguration(new BSHTransactionParticipant(), e);
    assertEquals("testQFactoryName", e.getName(), "e.getName()");
    q2.stop();
}
Also used : BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) Element(org.jdom2.Element) Test(org.junit.jupiter.api.Test)

Aggregations

BSHTransactionParticipant (org.jpos.transaction.participant.BSHTransactionParticipant)7 Test (org.junit.jupiter.api.Test)6 ArrayList (java.util.ArrayList)1 Element (org.jdom2.Element)1 ConfigurationException (org.jpos.core.ConfigurationException)1 CheckPoint (org.jpos.transaction.participant.CheckPoint)1 LogEvent (org.jpos.util.LogEvent)1 Test (org.junit.Test)1