Search in sources :

Example 1 with ISOVError

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

the class MSGTEST021Test method testValidate2.

@Test
public void testValidate2() throws Throwable {
    ISOMsg m = new ISOVMsg(new ISOMsg("testMSGTEST02Mti"), new ISOVError("testMSGTEST02Description"));
    m.set(1, "testMSGTEST02Value");
    ISOMsg result = (ISOMsg) new MSGTEST02().validate(m);
    assertSame("result", m, result);
}
Also used : ISOVError(org.jpos.iso.ISOVError) ISOMsg(org.jpos.iso.ISOMsg) ISOVMsg(org.jpos.iso.ISOVMsg) Test(org.junit.Test)

Example 2 with ISOVError

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

the class VErrorParserTest method testGetVErrorsThrowsNullPointerException.

@Test
public void testGetVErrorsThrowsNullPointerException() throws Throwable {
    VErrorParser vErrorParser = new VErrorParser();
    ISOVMsg c = new ISOVMsg(new ISOMsg(), new ISOVError("testVErrorParserDescription"));
    c.addISOVError(null);
    try {
        vErrorParser.getVErrors(c);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISOVError(org.jpos.iso.ISOVError) ISOMsg(org.jpos.iso.ISOMsg) ISOVMsg(org.jpos.iso.ISOVMsg) Test(org.junit.Test)

Example 3 with ISOVError

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

the class VErrorParserTest method testGetVErrors1.

@SuppressWarnings("unchecked")
@Test
public void testGetVErrors1() throws Throwable {
    VErrorParser vErrorParser = new VErrorParser();
    ISOVError FirstError = new ISOVError("testVErrorParserDescription");
    ISOComponent c = new ISOVField(new ISOField(), FirstError);
    Vector result = vErrorParser.getVErrors(c);
    assertEquals("result.size()", 1, result.size());
    assertSame("result.get(0)", FirstError, result.get(0));
}
Also used : ISOField(org.jpos.iso.ISOField) ISOComponent(org.jpos.iso.ISOComponent) ISOVError(org.jpos.iso.ISOVError) ISOVField(org.jpos.iso.ISOVField) Vector(java.util.Vector) Test(org.junit.Test)

Example 4 with ISOVError

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

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

the class VErrorParserTest method testGetVErrorsThrowsNullPointerException2.

@Test
public void testGetVErrorsThrowsNullPointerException2() throws Throwable {
    VErrorParser vErrorParser = new VErrorParser();
    ISOVField c = new ISOVField(new ISOField(), new ISOVError("testVErrorParserDescription"));
    c.addISOVError(null);
    try {
        vErrorParser.getVErrors(c);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISOField(org.jpos.iso.ISOField) ISOVError(org.jpos.iso.ISOVError) ISOVField(org.jpos.iso.ISOVField) Test(org.junit.Test)

Aggregations

ISOVError (org.jpos.iso.ISOVError)9 Test (org.junit.Test)9 ISOMsg (org.jpos.iso.ISOMsg)7 ISOVMsg (org.jpos.iso.ISOVMsg)7 ISOComponent (org.jpos.iso.ISOComponent)5 Vector (java.util.Vector)4 ISOBaseValidator (org.jpos.iso.ISOBaseValidator)2 ISOField (org.jpos.iso.ISOField)2 ISOVField (org.jpos.iso.ISOVField)2 MSGTEST02 (org.jpos.iso.validator.MSGTEST02)2 ISOFieldValidator (org.jpos.iso.ISOFieldValidator)1 ISOValidator (org.jpos.iso.ISOValidator)1 IVA_ALPHANUM (org.jpos.iso.IVA_ALPHANUM)1