use of org.jpos.iso.IFB_LLLCHAR in project jPOS by jpos.
the class EuroSubFieldPackagerTest method testUnpackThrowsNullPointerException1.
@Test
public void testUnpackThrowsNullPointerException1() throws Throwable {
EuroSubFieldPackager euroSubFieldPackager = new EuroSubFieldPackager();
ISOFieldPackager[] fld = new ISOFieldPackager[4];
fld[0] = new IFB_LLLCHAR();
euroSubFieldPackager.setFieldPackager(fld);
byte[] b = new byte[3];
try {
euroSubFieldPackager.unpack(null, b);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"org.jpos.iso.ISOComponent.set(org.jpos.iso.ISOComponent)\" because \"m\" is null", ex.getMessage(), "ex.getMessage()");
}
}
}
use of org.jpos.iso.IFB_LLLCHAR in project jPOS by jpos.
the class ISOMsgFieldValidatingPackagerTest method testConstructor.
@Test
public void testConstructor() throws Throwable {
ISOPackager msgPackager = new ISOBaseValidatingPackager();
ISOMsgFieldValidatingPackager iSOMsgFieldValidatingPackager = new ISOMsgFieldValidatingPackager(new IFB_LLLCHAR(), msgPackager);
assertNull(iSOMsgFieldValidatingPackager.getDescription(), "iSOMsgFieldValidatingPackager.getDescription()");
assertEquals(-1, iSOMsgFieldValidatingPackager.getMaxPackedLength(), "iSOMsgFieldValidatingPackager.getMaxPackedLength()");
assertEquals(-1, iSOMsgFieldValidatingPackager.getLength(), "iSOMsgFieldValidatingPackager.getLength()");
}
Aggregations