use of org.jpos.iso.ISOComponent in project jPOS by jpos.
the class VISA1PackagerTest method testUnpackThrowsNullPointerException2.
@Test
public void testUnpackThrowsNullPointerException2() throws Throwable {
int[] sequence = new int[2];
VISA1Packager vISA1Packager = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode", null);
byte[] b = new byte[3];
ISOComponent m = new ISOMsg();
try {
vISA1Packager.unpack(m, b);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertEquals("(ISOMsg) m.getMaxField()", 100, m.getMaxField());
assertNull("ex.getMessage()", ex.getMessage());
assertSame("vISA1Packager.filter", vISA1Packager, vISA1Packager.filter);
}
}
use of org.jpos.iso.ISOComponent in project jPOS by jpos.
the class ISOVException1Test method testGetErrComponent.
@Test
public void testGetErrComponent() throws Throwable {
ISOComponent errComponent = new ISOMsg("testISOVExceptionMti");
ISOComponent result = new ISOVException("testISOVExceptionDescription", errComponent).getErrComponent();
assertSame("result", errComponent, result);
}
use of org.jpos.iso.ISOComponent in project jPOS by jpos.
the class ISOVException1Test method testSetErrComponent.
@Test
public void testSetErrComponent() throws Throwable {
ISOVException iSOVException = new ISOVException("testISOVExceptionDescription");
ISOComponent c = new ISOMsg();
iSOVException.setErrComponent(c);
assertSame("iSOVException.errComponent", c, iSOVException.errComponent);
}
use of org.jpos.iso.ISOComponent in project jPOS by jpos.
the class MSGTEST021Test method testValidateThrowsNullPointerException2.
@Test
public void testValidateThrowsNullPointerException2() throws Throwable {
ISOComponent m = new ISOVMsg(new ISOMsg(100));
try {
new MSGTEST02().validate(m);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.ISOComponent in project jPOS by jpos.
the class VErrorParserTest method testGetVErrors2.
@SuppressWarnings("unchecked")
@Test
public void testGetVErrors2() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVError FirstError = new ISOVError("testVErrorParserDescription", "testVErrorParserRejectCode");
ISOComponent c = new ISOVMsg(new ISOMsg("testVErrorParserMti"), FirstError);
Vector result = vErrorParser.getVErrors(c);
assertEquals("result.size()", 1, result.size());
assertSame("result.get(0)", FirstError, result.get(0));
}
Aggregations