use of org.jpos.iso.ISOVField in project jPOS by jpos.
the class VErrorParserTest method testGetVErrors7.
@SuppressWarnings("unchecked")
@Test
public void testGetVErrors7() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
Vector result = vErrorParser.getVErrors(new ISOVField(new ISOField(100)));
assertEquals("result.size()", 0, result.size());
}
use of org.jpos.iso.ISOVField in project jPOS by jpos.
the class VErrorParserTest method testGetVErrors1.
@SuppressWarnings("unchecked")
@Test
public void testGetVErrors1() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVError FirstError = new ISOVError("testVErrorParserDescription");
ISOComponent c = new ISOVField(new ISOField(), FirstError);
Vector result = vErrorParser.getVErrors(c);
assertEquals("result.size()", 1, result.size());
assertSame("result.get(0)", FirstError, result.get(0));
}
use of org.jpos.iso.ISOVField in project jPOS by jpos.
the class VErrorParserTest method testGetVErrorsThrowsNullPointerException3.
@Test
public void testGetVErrorsThrowsNullPointerException3() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVField c = new ISOVField(new ISOField(100, "testVErrorParserv"));
c.addISOVError(null);
try {
vErrorParser.getVErrors(c);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.ISOVField in project jPOS by jpos.
the class CTCSubElementPackagerTest method testUnpackThrowsISOException.
@Test
public void testUnpackThrowsISOException() throws Throwable {
CTCSubElementPackager cTCSubElementPackager = new CTCSubElementPackager();
ISOFieldPackager[] fld = new ISOFieldPackager[2];
cTCSubElementPackager.setFieldPackager(fld);
cTCSubElementPackager.setLogger(new Logger(), "testCTCSubElementPackagerRealm");
cTCSubElementPackager.setFieldPackager(0, new IFE_CHAR());
byte[] b = new byte[2];
try {
cTCSubElementPackager.unpack(new ISOVField(new ISOField(100, "testCTCSubElementPackagerv"), null), 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());
}
}
use of org.jpos.iso.ISOVField in project jPOS by jpos.
the class VErrorParserTest method testGetVErrorsThrowsNullPointerException2.
@Test
public void testGetVErrorsThrowsNullPointerException2() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVField c = new ISOVField(new ISOField(), new ISOVError("testVErrorParserDescription"));
c.addISOVError(null);
try {
vErrorParser.getVErrors(c);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations