use of org.jpos.iso.ISOVError in project jPOS by jpos.
the class VErrorParserTest method testGetVErrors2.
@SuppressWarnings("unchecked")
@Test
public void testGetVErrors2() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVError FirstError = new ISOVError("testVErrorParserDescription", "testVErrorParserRejectCode");
ISOComponent c = new ISOVMsg(new ISOMsg("testVErrorParserMti"), FirstError);
Vector result = vErrorParser.getVErrors(c);
assertEquals("result.size()", 1, result.size());
assertSame("result.get(0)", FirstError, result.get(0));
}
use of org.jpos.iso.ISOVError in project jPOS by jpos.
the class VErrorParserTest method testGetVErrors8.
@SuppressWarnings("unchecked")
@Test
public void testGetVErrors8() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVError FirstError = new ISOVError("testVErrorParserDescription");
ISOComponent c = new ISOVMsg(new ISOMsg(), FirstError);
Vector result = vErrorParser.getVErrors(c);
assertEquals("result.size()", 1, result.size());
assertSame("result.get(0)", FirstError, result.get(0));
}
use of org.jpos.iso.ISOVError in project jPOS by jpos.
the class VErrorParserTest method testGetVErrors6.
@SuppressWarnings("unchecked")
@Test
public void testGetVErrors6() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOMsg Source = new ISOVMsg(new ISOMsg(), new ISOVError("testVErrorParserDescription"));
Source.set(100, "testVErrorParserValue");
Vector result = vErrorParser.getVErrors(new ISOVMsg(Source));
assertEquals("result.size()", 0, result.size());
}
use of org.jpos.iso.ISOVError in project jPOS by jpos.
the class ISOBaseValidatingPackagerTest method testValidateThrowsNullPointerException3.
@Test
public void testValidateThrowsNullPointerException3() throws Throwable {
ISOVError FirstError = new ISOVError("testISOBaseValidatingPackagerDescription", "testISOBaseValidatingPackagerRejectCode");
ISOBaseValidator[] msgVlds = new ISOBaseValidator[1];
msgVlds[0] = new MSGTEST02();
ISOBaseValidatingPackager iSOBaseValidatingPackager = new ISOBaseValidatingPackager();
iSOBaseValidatingPackager.setMsgValidator(msgVlds);
ISOComponent m = new ISOVMsg(new ISOMsg(), FirstError);
ISOValidator[] fvlds = new ISOValidator[0];
iSOBaseValidatingPackager.setFieldValidator(fvlds);
try {
iSOBaseValidatingPackager.validate(m);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations