public void testUnpack() throws Exception { byte[] raw = new byte[] {(byte)0xF0, (byte)0xF0, (byte)0xF2, (byte)0x30, (byte)0x31}; IFE_LLLBINARY packager = new IFE_LLLBINARY(100, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x30, 0x31}, (byte[])field.getValue()); }
public void testUnpack() throws Exception { byte[] raw = new byte[] {0x00, 0x02, 0x12, 0x34}; IFB_LLLBINARY packager = new IFB_LLLBINARY(100, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x12, 0x34}, (byte[])field.getValue()); }
public void testUnpack() throws Exception { byte[] raw = new byte[] {0x02, 0x12, 0x34}; IFB_LLHBINARY packager = new IFB_LLHBINARY(10, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x12, 0x34}, (byte[])field.getValue()); }
public void testUnpack() throws Exception { byte[] raw = new byte[] {0x00, 0x02, 0x12, 0x34}; IFB_LLLHBINARY packager = new IFB_LLLHBINARY(4, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x12, 0x34}, (byte[])field.getValue()); }
public void testUnpack() throws Exception { byte[] raw = new byte[] {0x30, 0x30, 0x32, 0x12, 0x34}; IFA_LLLBINARY packager = new IFA_LLLBINARY(2, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x12, 0x34}, (byte[])field.getValue()); }
public void testUnpack() throws Exception { byte[] raw = new byte[] {0x02, 0x12, 0x34, 0x00, 0x00}; IFB_LLHFBINARY packager = new IFB_LLHFBINARY(4, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x12, 0x34}, (byte[])field.getValue()); }
public void testUnpack() throws Exception { byte[] raw = new byte[] {0x02, 0x12, 0x34}; IFB_LLBINARY packager = new IFB_LLBINARY(2, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x12, 0x34}, (byte[])field.getValue()); }
public void testUnpackGreaterThan16() throws Exception { byte[] raw = new byte[] {0x00, 0x17, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 ,0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11}; IFB_LLLBINARY packager = new IFB_LLLBINARY(999, "Should be 17 bytes 01 through 11"); ISOBinaryField field = new ISOBinaryField(1); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 ,0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11}, (byte[])field.getValue()); }
public void testUnpack() throws Exception { byte[] raw = new byte[] {0x12, 0x34}; IFB_BINARY packager = new IFB_BINARY(2, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x12, 0x34}, (byte[])field.getValue()); }
@Test public void testUnpackZeroLengthArray() throws Exception { byte[] raw = new byte[] {(byte) 0xF0}; IFE_LBINARY packager = new IFE_LBINARY(9, "testing unpacking an empty Array"); ISOBinaryField field = new ISOBinaryField(9); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[]{}, (byte[])field.getValue()); }
@Test public void testUnpackOffsetArray() throws Exception { byte[] raw = new byte[] {0x30, 0x31, (byte) 0xF2, 0x30, 0x31}; IFE_LBINARY packager = new IFE_LBINARY(9, "testing unpacking a non empty Array with an offset"); ISOBinaryField field = new ISOBinaryField(9); packager.unpack(field, raw, 2); TestUtils.assertEquals(new byte[] {0x30, 0x31}, (byte[])field.getValue()); } }
@Test public void testUnpackATwoLengthArray() throws Exception { byte[] raw = new byte[] {(byte) 0xF2, 0x30, 0x31}; IFE_LBINARY packager = new IFE_LBINARY(9, "testing unpacking a non empty Array"); ISOBinaryField field = new ISOBinaryField(9); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x30, 0x31}, (byte[])field.getValue()); }
public void testReversability() throws Exception { byte[] origin = new byte[] {0x12, 0x34, 0x56, 0x78}; ISOBinaryField f = new ISOBinaryField(12, origin); IFB_LLLHBINARY packager = new IFB_LLLHBINARY(10, "Should be 12345678"); ISOBinaryField unpack = new ISOBinaryField(12); packager.unpack(unpack, packager.pack(f), 0); TestUtils.assertEquals(origin, (byte[])unpack.getValue()); } }
public void testReversability() throws Exception { byte[] origin = new byte[] {0x12, 0x34, 0x56, 0x78}; ISOBinaryField f = new ISOBinaryField(12, origin); IFA_BINARY packager = new IFA_BINARY(4, "Should be 12345678"); ISOBinaryField unpack = new ISOBinaryField(12); packager.unpack(unpack, packager.pack(f), 0); TestUtils.assertEquals(origin, (byte[])unpack.getValue()); } }
public void testReversability() throws Exception { byte[] origin = new byte[] {0x12, 0x34, 0x56, 0x78}; ISOBinaryField f = new ISOBinaryField(12, origin); IFB_LLHFBINARY packager = new IFB_LLHFBINARY(10, "Should be 12345678"); ISOBinaryField unpack = new ISOBinaryField(12); packager.unpack(unpack, packager.pack(f), 0); TestUtils.assertEquals(origin, (byte[])unpack.getValue()); } }
public void testReversability() throws Exception { byte[] origin = new byte[] {0x12, 0x34, 0x56, 0x78}; ISOBinaryField f = new ISOBinaryField(12, origin); IFB_LLLBINARY packager = new IFB_LLLBINARY(100, "Should be 12345678"); ISOBinaryField unpack = new ISOBinaryField(12); packager.unpack(unpack, packager.pack(f), 0); TestUtils.assertEquals(origin, (byte[])unpack.getValue()); }
public void testReversability() throws Exception { byte[] origin = new byte[] {0x12, 0x34, 0x56, 0x78}; ISOBinaryField f = new ISOBinaryField(12, origin); IFA_LLLBINARY packager = new IFA_LLLBINARY(4, "Should be 12345678"); ISOBinaryField unpack = new ISOBinaryField(12); packager.unpack(unpack, packager.pack(f), 0); TestUtils.assertEquals(origin, (byte[])unpack.getValue()); } }
public void testReversability() throws Exception { byte[] origin = new byte[] {0x12, 0x34, 0x56, 0x78}; ISOBinaryField f = new ISOBinaryField(12, origin); IFB_LLBINARY packager = new IFB_LLBINARY(4, "Should be 12345678"); ISOBinaryField unpack = new ISOBinaryField(12); packager.unpack(unpack, packager.pack(f), 0); TestUtils.assertEquals(origin, (byte[])unpack.getValue()); } }
public void testReversability() throws Exception { byte[] origin = new byte[] {0x12, 0x34, 0x56, 0x78}; ISOBinaryField f = new ISOBinaryField(12, origin); IFB_BINARY packager = new IFB_BINARY(4, "Should be 12345678"); ISOBinaryField unpack = new ISOBinaryField(12); packager.unpack(unpack, packager.pack(f), 0); TestUtils.assertEquals(origin, (byte[])unpack.getValue()); } }
@Test public void testReversability() throws Exception { IFE_LBINARY packager = new IFE_LBINARY(9, "testing packing and unpacking cycle"); byte[] originalData = new byte[] {0x12, 0x34, 0x56, 0x78}; ISOBinaryField originalDataField = new ISOBinaryField(9, originalData); byte[] packedData = packager.pack(originalDataField); ISOBinaryField unpackedDataField = new ISOBinaryField(9); packager.unpack(unpackedDataField, packedData, 0); TestUtils.assertEquals(originalData, (byte[]) unpackedDataField.getValue()); }