use of org.jpos.iso.IFA_LLLLCHAR in project jPOS by jpos.
the class CTCSubFieldPackagerTest method testUnpackThrowsISOException.
@Test
public void testUnpackThrowsISOException() throws Throwable {
CTCSubFieldPackager cTCSubFieldPackager = new CTCSubFieldPackager();
ISOFieldPackager[] fld = new ISOFieldPackager[6];
fld[0] = new IFA_LLLLCHAR(100, "testCTCSubFieldPackagerDescription");
cTCSubFieldPackager.setFieldPackager(fld);
byte[] b = new byte[4];
try {
cTCSubFieldPackager.unpack(new ISOField(), b);
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "org.jpos.iso.IFA_LLLLCHAR: Problem unpacking field 0", ex.getMessage());
assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
}
}
use of org.jpos.iso.IFA_LLLLCHAR in project jPOS by jpos.
the class GenericSubFieldPackagerTest method testUnpackThrowsISOException8.
@Test
public void testUnpackThrowsISOException8() throws Throwable {
ISOFieldPackager[] fld = new ISOFieldPackager[2];
fld[1] = new IFA_LLLLCHAR();
GenericSubFieldPackager genericSubFieldPackager = new GenericSubFieldPackager();
genericSubFieldPackager.setFieldPackager(fld);
genericSubFieldPackager.setLogger(new Logger(), "testGenericSubFieldPackagerRealm");
byte[] b = new byte[5];
try {
genericSubFieldPackager.unpack(new ISOMsg(), b);
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "org.jpos.iso.IFA_LLLLCHAR: Problem unpacking field -1", ex.getMessage());
assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
}
}
Aggregations