Search in sources :

Example 1 with IFA_AMOUNT

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

the class CTCSubElementPackagerTest method testUnpackThrowsNullPointerException2.

@Test
public void testUnpackThrowsNullPointerException2() throws Throwable {
    CTCSubElementPackager cTCSubElementPackager = new CTCSubElementPackager();
    ISOFieldPackager[] fld = new ISOFieldPackager[2];
    fld[0] = new IFA_AMOUNT();
    cTCSubElementPackager.setFieldPackager(fld);
    byte[] b = new byte[3];
    ISOComponent m = new ISOMsg("testCTCSubElementPackagerMti");
    try {
        cTCSubElementPackager.unpack(m, b);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) IFA_AMOUNT(org.jpos.iso.IFA_AMOUNT) ISOMsg(org.jpos.iso.ISOMsg) ISOFieldPackager(org.jpos.iso.ISOFieldPackager) Test(org.junit.Test)

Example 2 with IFA_AMOUNT

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

the class GenericPackagerTest method testGetBitMapfieldPackager.

@Test
public void testGetBitMapfieldPackager() throws Throwable {
    ISOFieldPackager iFA_AMOUNT = new IFA_AMOUNT();
    ISOFieldPackager[] fld = new ISOFieldPackager[2];
    fld[1] = iFA_AMOUNT;
    GenericPackager genericPackager = new GenericPackager();
    genericPackager.setFieldPackager(fld);
    ISOFieldPackager result = genericPackager.getBitMapfieldPackager();
    assertSame("result", iFA_AMOUNT, result);
}
Also used : IFA_AMOUNT(org.jpos.iso.IFA_AMOUNT) ISOFieldPackager(org.jpos.iso.ISOFieldPackager) Test(org.junit.Test)

Aggregations

IFA_AMOUNT (org.jpos.iso.IFA_AMOUNT)2 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)2 Test (org.junit.Test)2 ISOComponent (org.jpos.iso.ISOComponent)1 ISOMsg (org.jpos.iso.ISOMsg)1