Search in sources :

Example 6 with ISOComponent

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

the class ISOVException1Test method testConstructor.

@Test
public void testConstructor() throws Throwable {
    ISOComponent errComponent = new ISOMsg("testISOVExceptionMti");
    ISOVException iSOVException = new ISOVException("testISOVExceptionDescription", errComponent);
    assertSame("iSOVException.errComponent", errComponent, iSOVException.errComponent);
    assertEquals("iSOVException.getMessage()", "testISOVExceptionDescription", iSOVException.getMessage());
    assertFalse("iSOVException.treated", iSOVException.treated);
    assertNull("iSOVException.getNested()", iSOVException.getNested());
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOMsg(org.jpos.iso.ISOMsg) Test(org.junit.Test)

Example 7 with ISOComponent

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

the class MSGTEST021Test method testValidateThrowsISOVException1.

@Test
public void testValidateThrowsISOVException1() throws Throwable {
    ISOComponent m = new ISOVMsg(new ISOMsg("testMSGTEST02Mti"));
    try {
        new MSGTEST02(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 8 with ISOComponent

use of org.jpos.iso.ISOComponent 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 9 with ISOComponent

use of org.jpos.iso.ISOComponent 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 10 with ISOComponent

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

the class VErrorParserTest method testGetVErrors4.

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

Aggregations

ISOComponent (org.jpos.iso.ISOComponent)34 ISOMsg (org.jpos.iso.ISOMsg)25 Test (org.junit.Test)23 ISOVMsg (org.jpos.iso.ISOVMsg)8 ISOException (org.jpos.iso.ISOException)6 LogEvent (org.jpos.util.LogEvent)6 Vector (java.util.Vector)5 ISOBaseValidator (org.jpos.iso.ISOBaseValidator)5 ISOField (org.jpos.iso.ISOField)5 ISOVError (org.jpos.iso.ISOVError)5 Map (java.util.Map)4 ISOBinaryField (org.jpos.iso.ISOBinaryField)4 ISOValidator (org.jpos.iso.ISOValidator)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)3 ISOFieldValidator (org.jpos.iso.ISOFieldValidator)3 ISOTaggedField (org.jpos.tlv.ISOTaggedField)3 TreeMap (java.util.TreeMap)2 ConfigurationException (org.jpos.core.ConfigurationException)2