use of org.jpos.util.LogEvent in project jPOS by jpos.
the class TransactionManagerTest method testAbortThrowsNullPointerException.
@Test
public void testAbortThrowsNullPointerException() throws Throwable {
LogEvent evt = new LogEvent("testTransactionManagerTag");
try {
transactionManager.abort(1, 100L, new NotActiveException("testTransactionManagerParam1"), members, members.add(null), evt, null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertEquals("(ArrayList) members.size()", 1, members.size());
}
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BSHTransactionParticipantTest method testExecuteMethodThrowsEvalError.
@Test
public void testExecuteMethodThrowsEvalError() throws Throwable {
BSHTransactionParticipant bSHGroupSelector = new BSHGroupSelector();
try {
bSHGroupSelector.executeMethod(new BSHMethod("testBSHTransactionParticipantBshData", false), 100L, new CharConversionException(), new LogEvent(), "sh.evalOnly");
fail("Expected EvalError to be thrown");
} catch (EvalError ex) {
assertEquals("ex.getMessage()", "Class or variable not found: sh.evalOnly", ex.getMessage());
assertEquals("ex.getMessage()", "Class or variable not found: sh.evalOnly", ex.getMessage());
}
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BSHTransactionParticipantTest method testExecuteMethodThrowsFileNotFoundException.
@Test
public void testExecuteMethodThrowsFileNotFoundException() throws Throwable {
BSHTransactionParticipant source = new BSHTransactionParticipant();
try {
source.executeMethod(new BSHMethod("testBSHTransactionParticipantBshData", true), 100L, new CharConversionException(), new LogEvent(source, "testBSHTransactionParticipantTag"), "testBSHTransactionParticipantResultName");
fail("Expected FileNotFoundException to be thrown");
} catch (FileNotFoundException ex) {
assertEquals("ex.getClass()", FileNotFoundException.class, ex.getClass());
}
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BSHTransactionParticipantTest method testExecuteMethodThrowsNullPointerException.
@Test
public void testExecuteMethodThrowsNullPointerException() throws Throwable {
BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant();
try {
bSHTransactionParticipant.executeMethod(null, 100L, new StringBuffer(), new LogEvent("testBSHTransactionParticipantTag", Integer.valueOf(0)), "testBSHTransactionParticipantResultName");
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class DUKPTTest method test_DUKPT.
private void test_DUKPT(String keyName, KeySerialNumber ksn, byte[] pinUnderDukpt, String pan, boolean tdes) throws Exception {
LogEvent evt = log.createInfo("test_DUKPT " + ksn);
evt.addMessage(ksn);
EncryptedPIN pin = new EncryptedPIN(pinUnderDukpt, SMAdapter.FORMAT01, pan);
SecureDESKey bdk = (SecureDESKey) ks.getKey(keyName);
evt.addMessage(pin);
evt.addMessage(ksn);
evt.addMessage(bdk);
EncryptedPIN pinUnderLMK = sm.importPIN(pin, ksn, bdk, tdes);
evt.addMessage(pinUnderLMK);
evt.addMessage("<decrypted-pin>" + sm.decryptPIN(pinUnderLMK) + "</decrypted-pin>");
Logger.log(evt);
}
Aggregations