Search in sources :

Example 1 with IFA_LLBNUM

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

the class CTCSubElementPackagerTest method testUnpackThrowsNegativeArraySizeException.

@Test
public void testUnpackThrowsNegativeArraySizeException() throws Throwable {
    byte[] b = new byte[3];
    ISOFieldPackager[] fld = new ISOFieldPackager[3];
    fld[0] = new IFA_LLBNUM();
    CTCSubElementPackager cTCSubElementPackager = new CTCSubElementPackager();
    cTCSubElementPackager.setFieldPackager(fld);
    try {
        cTCSubElementPackager.unpack(new ISOBinaryField(), b);
        fail("Expected NegativeArraySizeException to be thrown");
    } catch (NegativeArraySizeException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISOBinaryField(org.jpos.iso.ISOBinaryField) ISOFieldPackager(org.jpos.iso.ISOFieldPackager) IFA_LLBNUM(org.jpos.iso.IFA_LLBNUM) Test(org.junit.Test)

Aggregations

IFA_LLBNUM (org.jpos.iso.IFA_LLBNUM)1 ISOBinaryField (org.jpos.iso.ISOBinaryField)1 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)1 Test (org.junit.Test)1