Search in sources :

Example 1 with MSGTEST02

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());
    }
}
Also used : IVA_ALPHANUMNOBLANK(org.jpos.iso.IVA_ALPHANUMNOBLANK) ISOMsg(org.jpos.iso.ISOMsg) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) MSGTEST02(org.jpos.iso.validator.MSGTEST02) Test(org.junit.Test)

Example 2 with MSGTEST02

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());
    }
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) MSGTEST02(org.jpos.iso.validator.MSGTEST02) Test(org.junit.Test)

Example 3 with MSGTEST02

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());
    }
}
Also used : MSGTEST(org.jpos.iso.validator.MSGTEST) ISOMsg(org.jpos.iso.ISOMsg) ISOValidator(org.jpos.iso.ISOValidator) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) TEST0100(org.jpos.iso.validator.TEST0100) MSGTEST02(org.jpos.iso.validator.MSGTEST02) Test(org.junit.Test)

Example 4 with MSGTEST02

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());
    }
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOVError(org.jpos.iso.ISOVError) ISOMsg(org.jpos.iso.ISOMsg) IVA_ALPHANUM(org.jpos.iso.IVA_ALPHANUM) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) ISOVMsg(org.jpos.iso.ISOVMsg) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) MSGTEST02(org.jpos.iso.validator.MSGTEST02) Test(org.junit.Test)

Example 5 with MSGTEST02

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);
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) IVA_ALPHANUM(org.jpos.iso.IVA_ALPHANUM) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) ISOVMsg(org.jpos.iso.ISOVMsg) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) MSGTEST02(org.jpos.iso.validator.MSGTEST02) Test(org.junit.Test)

Aggregations

ISOBaseValidator (org.jpos.iso.ISOBaseValidator)9 ISOMsg (org.jpos.iso.ISOMsg)9 MSGTEST02 (org.jpos.iso.validator.MSGTEST02)9 Test (org.junit.Test)9 ISOFieldValidator (org.jpos.iso.ISOFieldValidator)6 ISOVMsg (org.jpos.iso.ISOVMsg)4 ISOValidator (org.jpos.iso.ISOValidator)4 ISOComponent (org.jpos.iso.ISOComponent)2 ISOVError (org.jpos.iso.ISOVError)2 IVA_ALPHANUM (org.jpos.iso.IVA_ALPHANUM)2 IVA_ALPHANUMNOBLANK (org.jpos.iso.IVA_ALPHANUMNOBLANK)1 MSGTEST (org.jpos.iso.validator.MSGTEST)1 TEST0100 (org.jpos.iso.validator.TEST0100)1