use of org.jpos.iso.ISOBitMap in project jPOS by jpos.
the class VISA1PackagerTest method testUnpackThrowsNullPointerException3.
@Test
public void testUnpackThrowsNullPointerException3() throws Throwable {
int[] sequence = new int[0];
VISA1Packager vISA1Packager = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode", "testVISA1PackagerOkPattern");
try {
vISA1Packager.unpack(new ISOBitMap(100), (byte[]) null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertSame("vISA1Packager.filter", vISA1Packager, vISA1Packager.filter);
}
}
use of org.jpos.iso.ISOBitMap in project jPOS by jpos.
the class VISA1PackagerTest method testUnpackThrowsISOException1.
@Test
public void testUnpackThrowsISOException1() throws Throwable {
int[] sequence = new int[3];
VISA1Packager vISA1Packager = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode", "testVISA1PackagerOkPattern");
byte[] b = new byte[3];
try {
vISA1Packager.unpack(new ISOBitMap(100), 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());
assertSame("vISA1Packager.filter", vISA1Packager, vISA1Packager.filter);
}
}
use of org.jpos.iso.ISOBitMap in project jPOS by jpos.
the class CardHolderTest method testConstructorFieldsTwoBitmapThrowsNullPointerException.
@Test
public void testConstructorFieldsTwoBitmapThrowsNullPointerException() throws Throwable {
ISOMsg m = new ISOMsg("testCardHolderMti");
m.set(new ISOBitMap(2));
try {
new CardHolder(m);
fail("Expected InvalidCardException to be thrown");
} catch (NullPointerException ex) {
assertEquals("m.getDirection()", 0, m.getDirection());
}
}
use of org.jpos.iso.ISOBitMap in project jPOS by jpos.
the class Base1_BITMAP126Test method testPack.
@Test
public void testPack() throws Throwable {
BitSet v = new BitSet(100);
Base1_BITMAP126 base1_BITMAP126 = new Base1_BITMAP126(100, "testBase1_BITMAP126Description");
byte[] result = base1_BITMAP126.pack(new ISOBitMap(100, v));
assertEquals("result.length", 0, result.length);
}
Aggregations