Search in sources :

Example 16 with ISOVMsg

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

the class ISOBaseValidatingPackagerTest method testValidate13.

@Test
public void testValidate13() throws Throwable {
    ISOBaseValidator[] msgVlds = new ISOBaseValidator[1];
    msgVlds[0] = new MSGTEST02();
    ISOValidator[] fvlds = new ISOFieldValidator[1];
    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) ISOValidator(org.jpos.iso.ISOValidator) 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 17 with ISOVMsg

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

the class MSGTEST021Test method testValidateThrowsNullPointerException2.

@Test
public void testValidateThrowsNullPointerException2() throws Throwable {
    ISOComponent m = new ISOVMsg(new ISOMsg(100));
    try {
        new MSGTEST02().validate(m);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOMsg(org.jpos.iso.ISOMsg) ISOVMsg(org.jpos.iso.ISOVMsg) Test(org.junit.Test)

Example 18 with ISOVMsg

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

the class MSGTEST021Test method testValidate.

@Test
public void testValidate() throws Throwable {
    ISOVMsg result = (ISOVMsg) new MSGTEST02().validate(new ISOMsg("testMSGTEST02Mti"));
    assertNotNull("result", result);
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) ISOVMsg(org.jpos.iso.ISOVMsg) Test(org.junit.Test)

Example 19 with ISOVMsg

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

the class VErrorParserTest method testGetVErrors5.

@SuppressWarnings("unchecked")
@Test
public void testGetVErrors5() throws Throwable {
    VErrorParser vErrorParser = new VErrorParser();
    Vector result = vErrorParser.getVErrors(new ISOVMsg(new ISOMsg()));
    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 20 with ISOVMsg

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

the class VErrorParserTest method testGetVErrors2.

@SuppressWarnings("unchecked")
@Test
public void testGetVErrors2() throws Throwable {
    VErrorParser vErrorParser = new VErrorParser();
    ISOVError FirstError = new ISOVError("testVErrorParserDescription", "testVErrorParserRejectCode");
    ISOComponent c = new ISOVMsg(new ISOMsg("testVErrorParserMti"), FirstError);
    Vector result = vErrorParser.getVErrors(c);
    assertEquals("result.size()", 1, result.size());
    assertSame("result.get(0)", FirstError, result.get(0));
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOVError(org.jpos.iso.ISOVError) ISOMsg(org.jpos.iso.ISOMsg) ISOVMsg(org.jpos.iso.ISOVMsg) Vector(java.util.Vector) 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