Search in sources :

Example 21 with ISOMsg

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

the class MSGTEST021Test method testValidateThrowsNullPointerException.

@Test
public void testValidateThrowsNullPointerException() throws Throwable {
    ISOMsg Source = new ISOMsg("testMSGTEST02Mti");
    Source.setMTI("testMSGTEST02Mti");
    Source.setRetransmissionMTI();
    ISOComponent m = new ISOVMsg(Source);
    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 22 with ISOMsg

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

the class MSGTEST1Test method testValidateThrowsISOVException1.

@Test
public void testValidateThrowsISOVException1() throws Throwable {
    ISOComponent m = new ISOVMsg(new ISOMsg());
    try {
        new MSGTEST(true).validate(m);
        fail("Expected ISOVException to be thrown");
    } catch (ISOVException ex) {
        assertEquals("ex.getMessage()", "Error on msg. ", ex.getMessage());
        assertFalse("ex.treated", ex.treated);
        assertSame("ex.errComponent", m, ex.errComponent);
        assertNull("ex.getNested()", ex.getNested());
    }
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOMsg(org.jpos.iso.ISOMsg) ISOVMsg(org.jpos.iso.ISOVMsg) Test(org.junit.Test)

Example 23 with ISOMsg

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

the class MSGTEST1Test method testValidate1.

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

Example 24 with ISOMsg

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

the class VErrorParserTest method testGetVErrorsThrowsNullPointerException1.

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

Example 25 with ISOMsg

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

Aggregations

ISOMsg (org.jpos.iso.ISOMsg)223 Test (org.junit.Test)191 LogEvent (org.jpos.util.LogEvent)41 ISOBaseValidator (org.jpos.iso.ISOBaseValidator)30 ISOException (org.jpos.iso.ISOException)29 ISOComponent (org.jpos.iso.ISOComponent)25 ISOVMsg (org.jpos.iso.ISOVMsg)22 ISOFieldValidator (org.jpos.iso.ISOFieldValidator)21 Context (org.jpos.transaction.Context)20 ISOValidator (org.jpos.iso.ISOValidator)18 Result (org.jpos.rc.Result)17 SimpleConfiguration (org.jpos.core.SimpleConfiguration)15 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)12 TEST0100 (org.jpos.iso.validator.TEST0100)12 FileInputStream (java.io.FileInputStream)9 Vector (java.util.Vector)9 PostChannel (org.jpos.iso.channel.PostChannel)9 MSGTEST (org.jpos.iso.validator.MSGTEST)9 MSGTEST02 (org.jpos.iso.validator.MSGTEST02)9 ISOFilter (org.jpos.iso.ISOFilter)8