Search in sources :

Example 6 with ISOMultiFieldPackager

use of org.jpos.iso.packager.ISOMultiFieldPackager in project jPOS by jpos.

the class ISOMultiFieldPackagerTest method testPackList.

public void testPackList() throws Exception {
    Vector list = new Vector();
    list.add(new IFB_LLNUM(10, "Should not be this", true));
    list.add(new IFE_LLNUM(10, "Should be 041234"));
    list.add(new IFB_LLNUM(10, "The one to pack", true));
    ISOMultiFieldPackager packager = new ISOMultiFieldPackager("Should be 041234", list);
    packager.hint("The one to pack");
    ISOField field = new ISOField(12, "1234");
    TestUtils.assertEquals(new byte[] { (byte) 0x04, (byte) 0x12, (byte) 0x34 }, packager.pack(field));
}
Also used : ISOField(org.jpos.iso.ISOField) ISOMultiFieldPackager(org.jpos.iso.packager.ISOMultiFieldPackager) IFB_LLNUM(org.jpos.iso.IFB_LLNUM) Vector(java.util.Vector) IFE_LLNUM(org.jpos.iso.IFE_LLNUM)

Aggregations

IFB_LLNUM (org.jpos.iso.IFB_LLNUM)6 IFE_LLNUM (org.jpos.iso.IFE_LLNUM)6 ISOField (org.jpos.iso.ISOField)6 ISOMultiFieldPackager (org.jpos.iso.packager.ISOMultiFieldPackager)6 Vector (java.util.Vector)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1