use of org.jpos.iso.validator.MSGTEST02 in project jPOS by jpos.
the class GenericValidatingPackagerTest method testValidateThrowsNullPointerException3.
@Test
public void testValidateThrowsNullPointerException3() throws Throwable {
GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager();
ISOBaseValidator[] msgVlds = new ISOBaseValidator[2];
msgVlds[0] = new MSGTEST02();
genericValidatingPackager.setMsgValidator(msgVlds);
ISOFieldValidator[] fvlds = new ISOFieldValidator[2];
fvlds[0] = new IVA_ALPHANUMNOBLANK(100, "testGenericValidatingPackagerDescription");
genericValidatingPackager.setFieldValidator(fvlds);
try {
genericValidatingPackager.validate(new ISOMsg());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.validator.MSGTEST02 in project jPOS by jpos.
the class GenericValidatingPackagerTest method testValidateThrowsNullPointerException4.
@Test
public void testValidateThrowsNullPointerException4() throws Throwable {
GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager();
ISOFieldValidator[] fvlds = new ISOFieldValidator[0];
genericValidatingPackager.setFieldValidator(fvlds);
ISOBaseValidator[] msgVlds = new ISOBaseValidator[2];
msgVlds[1] = new MSGTEST02();
genericValidatingPackager.setMsgValidator(msgVlds);
try {
genericValidatingPackager.validate(new ISOMsg());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.validator.MSGTEST02 in project jPOS by jpos.
the class ISOBaseValidatingPackagerTest method testValidateThrowsNullPointerException2.
@Test
public void testValidateThrowsNullPointerException2() throws Throwable {
ISOBaseValidatingPackager iSOBaseValidatingPackager = new ISOBaseValidatingPackager();
ISOBaseValidator[] msgVlds = new ISOBaseValidator[3];
msgVlds[0] = new TEST0100();
msgVlds[1] = new MSGTEST();
msgVlds[2] = new MSGTEST02();
ISOValidator[] fvlds = new ISOValidator[0];
iSOBaseValidatingPackager.setFieldValidator(fvlds);
iSOBaseValidatingPackager.setMsgValidator(msgVlds);
ISOMsg m = new ISOMsg();
m.setMTI("testISOBaseValidatingPackagerMti");
m.setRetransmissionMTI();
try {
iSOBaseValidatingPackager.validate(m);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.validator.MSGTEST02 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.validator.MSGTEST02 in project jPOS by jpos.
the class ISOBaseValidatingPackagerTest method testValidate12.
@Test
public void testValidate12() throws Throwable {
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);
ISOVMsg result = (ISOVMsg) iSOBaseValidatingPackager.validate(new ISOMsg("testISOBaseValidatingPackagerMti"));
assertNotNull("result", result);
}
Aggregations