use of org.jpos.iso.ISOFieldValidator 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.ISOFieldValidator in project jPOS by jpos.
the class GenericValidatingPackagerTest method testGenericValidatorContentHandlerMakeFieldValidatorArray4.
@SuppressWarnings("unchecked")
@Test
public void testGenericValidatorContentHandlerMakeFieldValidatorArray4() throws Throwable {
GenericValidatingPackager.GenericValidatorContentHandler genericValidatorContentHandler = new GenericValidatingPackager().new GenericValidatorContentHandler();
ISOFieldValidator[] result = genericValidatorContentHandler.makeFieldValidatorArray(new Hashtable(100));
assertEquals("result.length", 0, result.length);
}
use of org.jpos.iso.ISOFieldValidator 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.ISOFieldValidator in project jPOS by jpos.
the class GenericValidatingPackagerTest method testValidateThrowsISOException.
@Test
public void testValidateThrowsISOException() throws Throwable {
GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager();
ISOFieldValidator[] fvlds = new ISOFieldValidator[1];
fvlds[0] = new IVA_ALPHANUMNOBLANK("testGenericValidatingPackagerDescription");
genericValidatingPackager.setFieldValidator(fvlds);
ISOBaseValidator[] msgVlds = new ISOBaseValidator[3];
msgVlds[0] = new TEST0100();
genericValidatingPackager.setMsgValidator(msgVlds);
try {
genericValidatingPackager.validate(new ISOMsg());
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "MTI not available", ex.getMessage());
assertNull("ex.getNested()", ex.getNested());
}
}
use of org.jpos.iso.ISOFieldValidator in project jPOS by jpos.
the class GenericValidatingPackagerTest method testValidate6.
@Test
public void testValidate6() throws Throwable {
ISOBaseValidator mSGTEST = new MSGTEST(false);
GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager();
ISOBaseValidator mSGTEST2 = new MSGTEST(false);
ISOBaseValidator[] msgVlds = new ISOBaseValidator[3];
msgVlds[0] = mSGTEST2;
msgVlds[1] = mSGTEST;
msgVlds[2] = mSGTEST2;
genericValidatingPackager.setMsgValidator(msgVlds);
ISOFieldValidator[] fvlds = new ISOFieldValidator[1];
fvlds[0] = new IVA_ALPHANUM("testGenericValidatingPackagerDescription");
genericValidatingPackager.setFieldValidator(fvlds);
ISOVMsg result = (ISOVMsg) genericValidatingPackager.validate(new ISOMsg(100));
assertNotNull("result", result);
}
Aggregations