Search in sources :

Example 21 with ISOComponent

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

the class VISA1PackagerTest method testUnpackThrowsNullPointerException2.

@Test
public void testUnpackThrowsNullPointerException2() throws Throwable {
    int[] sequence = new int[2];
    VISA1Packager vISA1Packager = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode", null);
    byte[] b = new byte[3];
    ISOComponent m = new ISOMsg();
    try {
        vISA1Packager.unpack(m, b);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertEquals("(ISOMsg) m.getMaxField()", 100, m.getMaxField());
        assertNull("ex.getMessage()", ex.getMessage());
        assertSame("vISA1Packager.filter", vISA1Packager, vISA1Packager.filter);
    }
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOMsg(org.jpos.iso.ISOMsg) Test(org.junit.Test)

Example 22 with ISOComponent

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

the class ISOVException1Test method testGetErrComponent.

@Test
public void testGetErrComponent() throws Throwable {
    ISOComponent errComponent = new ISOMsg("testISOVExceptionMti");
    ISOComponent result = new ISOVException("testISOVExceptionDescription", errComponent).getErrComponent();
    assertSame("result", errComponent, result);
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOMsg(org.jpos.iso.ISOMsg) Test(org.junit.Test)

Example 23 with ISOComponent

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

the class ISOVException1Test method testSetErrComponent.

@Test
public void testSetErrComponent() throws Throwable {
    ISOVException iSOVException = new ISOVException("testISOVExceptionDescription");
    ISOComponent c = new ISOMsg();
    iSOVException.setErrComponent(c);
    assertSame("iSOVException.errComponent", c, iSOVException.errComponent);
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOMsg(org.jpos.iso.ISOMsg) Test(org.junit.Test)

Example 24 with ISOComponent

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

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

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