use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class BSHFilterTest method testFilter1.
@Test
public void testFilter1() throws Throwable {
BSHFilter bSHFilter = new BSHFilter();
Configuration cfg = new SimpleConfiguration();
bSHFilter.setConfiguration(cfg);
ISOChannel channel = new CSChannel();
LogEvent evt = new LogEvent();
ISOVMsg result = (ISOVMsg) bSHFilter.filter(channel, m, evt);
assertSame("result", m, result);
assertSame("bSHFilter.cfg", cfg, bSHFilter.cfg);
}
use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class MSGTEST021Test method testValidate2.
@Test
public void testValidate2() throws Throwable {
ISOMsg m = new ISOVMsg(new ISOMsg("testMSGTEST02Mti"), new ISOVError("testMSGTEST02Description"));
m.set(1, "testMSGTEST02Value");
ISOMsg result = (ISOMsg) new MSGTEST02().validate(m);
assertSame("result", m, result);
}
use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class MSGTEST021Test method testValidate1.
@Test
public void testValidate1() throws Throwable {
MSGTEST02 mSGTEST02 = new MSGTEST02();
ISOVMsg m = mock(ISOVMsg.class);
given(m.getComposite()).willReturn(m);
given(m.hasFields(new int[] { 0, 1 })).willReturn(false);
given(m.addISOVError(isA(ISOVError.class))).willReturn(true);
given(m.getString(0)).willReturn("");
ISOVMsg result = (ISOVMsg) mSGTEST02.validate(m);
assertSame("result", m, result);
}
use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class MSGTEST021Test method testValidateThrowsISOVException1.
@Test
public void testValidateThrowsISOVException1() throws Throwable {
ISOComponent m = new ISOVMsg(new ISOMsg("testMSGTEST02Mti"));
try {
new MSGTEST02(true).validate(m);
fail("Expected ISOVException to be thrown");
} catch (ISOVException ex) {
assertEquals("ex.getMessage()", "Error on msg. ", ex.getMessage());
assertFalse("ex.treated", ex.treated);
assertSame("ex.errComponent", m, ex.errComponent);
assertNull("ex.getNested()", ex.getNested());
}
}
use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class MSGTEST021Test method testValidateThrowsNullPointerException.
@Test
public void testValidateThrowsNullPointerException() throws Throwable {
ISOMsg Source = new ISOMsg("testMSGTEST02Mti");
Source.setMTI("testMSGTEST02Mti");
Source.setRetransmissionMTI();
ISOComponent m = new ISOVMsg(Source);
try {
new MSGTEST02().validate(m);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations