use of org.jpos.iso.IFE_CHAR in project jPOS by jpos.
the class CTCSubElementPackagerTest method testUnpackThrowsISOException.
@Test
public void testUnpackThrowsISOException() throws Throwable {
CTCSubElementPackager cTCSubElementPackager = new CTCSubElementPackager();
ISOFieldPackager[] fld = new ISOFieldPackager[2];
cTCSubElementPackager.setFieldPackager(fld);
cTCSubElementPackager.setLogger(new Logger(), "testCTCSubElementPackagerRealm");
cTCSubElementPackager.setFieldPackager(0, new IFE_CHAR());
byte[] b = new byte[2];
try {
cTCSubElementPackager.unpack(new ISOVField(new ISOField(100, "testCTCSubElementPackagerv"), null), b);
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "Can't add to Leaf", ex.getMessage());
assertNull("ex.getNested()", ex.getNested());
}
}
use of org.jpos.iso.IFE_CHAR in project jPOS by jpos.
the class CTCSubFieldPackagerTest method testUnpackThrowsNullPointerException.
@Test(expected = NullPointerException.class)
public void testUnpackThrowsNullPointerException() throws Throwable {
ISOFieldPackager[] fld = new ISOFieldPackager[4];
fld[0] = new IFE_CHAR();
CTCSubFieldPackager cTCSubFieldPackager = new CTCSubFieldPackager();
cTCSubFieldPackager.setFieldPackager(fld);
byte[] b = new byte[2];
cTCSubFieldPackager.unpack(null, b);
}
Aggregations