use of org.jpos.iso.ISOVError 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.ISOVError in project jPOS by jpos.
the class VErrorParserTest method testGetVErrorsThrowsNullPointerException.
@Test
public void testGetVErrorsThrowsNullPointerException() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVMsg c = new ISOVMsg(new ISOMsg(), new ISOVError("testVErrorParserDescription"));
c.addISOVError(null);
try {
vErrorParser.getVErrors(c);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.ISOVError in project jPOS by jpos.
the class VErrorParserTest method testGetVErrors1.
@SuppressWarnings("unchecked")
@Test
public void testGetVErrors1() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVError FirstError = new ISOVError("testVErrorParserDescription");
ISOComponent c = new ISOVField(new ISOField(), 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 ISOBaseValidatingPackagerTest method testValidateThrowsNullPointerException4.
@Test
public void testValidateThrowsNullPointerException4() throws Throwable {
ISOVError FirstError = new ISOVError("testISOBaseValidatingPackagerDescription", "testISOBaseValidatingPackagerRejectCode");
ISOBaseValidator[] msgVlds = new ISOBaseValidator[1];
msgVlds[0] = new MSGTEST02();
ISOFieldValidator[] fvlds = new ISOFieldValidator[1];
fvlds[0] = new IVA_ALPHANUM("testISOBaseValidatingPackagerDescription");
ISOBaseValidatingPackager iSOBaseValidatingPackager = new ISOBaseValidatingPackager();
iSOBaseValidatingPackager.setFieldValidator(fvlds);
iSOBaseValidatingPackager.setMsgValidator(msgVlds);
ISOComponent m = new ISOVMsg(new ISOMsg(), FirstError);
try {
iSOBaseValidatingPackager.validate(m);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.ISOVError in project jPOS by jpos.
the class VErrorParserTest method testGetVErrorsThrowsNullPointerException2.
@Test
public void testGetVErrorsThrowsNullPointerException2() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVField c = new ISOVField(new ISOField(), new ISOVError("testVErrorParserDescription"));
c.addISOVError(null);
try {
vErrorParser.getVErrors(c);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations