Search in sources :

Example 11 with ISOVMsg

use of org.jpos.iso.ISOVMsg in project jPOS by jpos.

the class VErrorParserTest method testGetVErrors.

@SuppressWarnings("unchecked")
@Test
public void testGetVErrors() throws Throwable {
    VErrorParser vErrorParser = new VErrorParser();
    Vector result = vErrorParser.getVErrors(new ISOVMsg(new ISOMsg("testVErrorParserMti")));
    assertEquals("result.size()", 0, result.size());
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) ISOVMsg(org.jpos.iso.ISOVMsg) Vector(java.util.Vector) Test(org.junit.Test)

Example 12 with ISOVMsg

use of org.jpos.iso.ISOVMsg 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);
}
Also used : MSGTEST(org.jpos.iso.validator.MSGTEST) 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) Test(org.junit.Test)

Example 13 with ISOVMsg

use of org.jpos.iso.ISOVMsg in project jPOS by jpos.

the class GenericValidatingPackagerTest method testValidate1.

@Test
public void testValidate1() throws Throwable {
    GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager();
    ISOFieldValidator[] fvlds = new ISOFieldValidator[2];
    fvlds[0] = new ISOFieldValidator();
    fvlds[1] = new IVA_ALPHANUMNOZERO_NOBLANK();
    genericValidatingPackager.setFieldValidator(fvlds);
    ISOBaseValidator[] msgVlds = new ISOBaseValidator[2];
    msgVlds[0] = new MSGTEST();
    msgVlds[1] = new ISOBaseValidator();
    genericValidatingPackager.setMsgValidator(msgVlds);
    ISOMsg m = new ISOMsg("testGenericValidatingPackagerMti");
    m.setMTI("testGenericValidatingPackagerMti");
    ISOVMsg result = (ISOVMsg) genericValidatingPackager.validate(m);
    assertNotNull("result", result);
}
Also used : MSGTEST(org.jpos.iso.validator.MSGTEST) ISOMsg(org.jpos.iso.ISOMsg) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) ISOVMsg(org.jpos.iso.ISOVMsg) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) IVA_ALPHANUMNOZERO_NOBLANK(org.jpos.iso.IVA_ALPHANUMNOZERO_NOBLANK) Test(org.junit.Test)

Example 14 with ISOVMsg

use of org.jpos.iso.ISOVMsg 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 15 with ISOVMsg

use of org.jpos.iso.ISOVMsg 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

ISOVMsg (org.jpos.iso.ISOVMsg)25 Test (org.junit.Test)25 ISOMsg (org.jpos.iso.ISOMsg)22 ISOVError (org.jpos.iso.ISOVError)9 ISOBaseValidator (org.jpos.iso.ISOBaseValidator)8 ISOComponent (org.jpos.iso.ISOComponent)8 ISOFieldValidator (org.jpos.iso.ISOFieldValidator)7 Vector (java.util.Vector)5 ISOValidator (org.jpos.iso.ISOValidator)4 MSGTEST (org.jpos.iso.validator.MSGTEST)4 MSGTEST02 (org.jpos.iso.validator.MSGTEST02)4 IVA_ALPHANUM (org.jpos.iso.IVA_ALPHANUM)3 Configuration (org.jpos.core.Configuration)1 SimpleConfiguration (org.jpos.core.SimpleConfiguration)1 ISOChannel (org.jpos.iso.ISOChannel)1 IVA_ALPHANUMNOBLANK (org.jpos.iso.IVA_ALPHANUMNOBLANK)1 IVA_ALPHANUMNOZERO_NOBLANK (org.jpos.iso.IVA_ALPHANUMNOZERO_NOBLANK)1 CSChannel (org.jpos.iso.channel.CSChannel)1 TEST0100 (org.jpos.iso.validator.TEST0100)1 LogEvent (org.jpos.util.LogEvent)1