use of org.jpos.iso.IVA_ALPHANUM in project jPOS by jpos.
the class GenericValidatingPackagerTest method testValidateThrowsISOVException.
@Test
public void testValidateThrowsISOVException() throws Throwable {
GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager();
ISOBaseValidator[] msgVlds = new ISOBaseValidator[3];
msgVlds[0] = new MSGTEST(false);
msgVlds[1] = new MSGTEST(true);
genericValidatingPackager.setMsgValidator(msgVlds);
ISOFieldValidator[] fvlds = new ISOFieldValidator[1];
fvlds[0] = new IVA_ALPHANUM("testGenericValidatingPackagerDescription");
genericValidatingPackager.setFieldValidator(fvlds);
try {
genericValidatingPackager.validate(new ISOMsg(100));
fail("Expected ISOVException to be thrown");
} catch (ISOVException ex) {
assertEquals("ex.getMessage()", "Error on msg. ", ex.getMessage());
assertFalse("ex.treated()", ex.treated());
assertNotNull("ex.getErrComponent()", ex.getErrComponent());
assertNull("ex.getNested()", ex.getNested());
}
}
Aggregations