use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class ISOVException1Test method testConstructor.
@Test
public void testConstructor() throws Throwable {
ISOComponent errComponent = new ISOMsg("testISOVExceptionMti");
ISOVException iSOVException = new ISOVException("testISOVExceptionDescription", errComponent);
assertSame("iSOVException.errComponent", errComponent, iSOVException.errComponent);
assertEquals("iSOVException.getMessage()", "testISOVExceptionDescription", iSOVException.getMessage());
assertFalse("iSOVException.treated", iSOVException.treated);
assertNull("iSOVException.getNested()", iSOVException.getNested());
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class MSGTEST021Test method testValidate2.
@Test
public void testValidate2() throws Throwable {
ISOMsg m = new ISOVMsg(new ISOMsg("testMSGTEST02Mti"), new ISOVError("testMSGTEST02Description"));
m.set(1, "testMSGTEST02Value");
ISOMsg result = (ISOMsg) new MSGTEST02().validate(m);
assertSame("result", m, result);
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class MSGTEST021Test method testValidateThrowsISOVException.
@Test
public void testValidateThrowsISOVException() throws Throwable {
try {
new MSGTEST02(true).validate(new ISOMsg(100));
fail("Expected ISOVException to be thrown");
} catch (ISOVException ex) {
assertEquals("ex.getMessage()", "Error on msg. ", ex.getMessage());
assertFalse("ex.treated", ex.treated);
assertNotNull("ex.errComponent", ex.errComponent);
assertNull("ex.getNested()", ex.getNested());
}
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class MSGTEST021Test method testValidateThrowsNullPointerException3.
@Test
public void testValidateThrowsNullPointerException3() throws Throwable {
ISOMsg m = new ISOMsg("testMSGTEST02Mti");
m.setMTI("testMSGTEST02Mti");
m.setRetransmissionMTI();
try {
new MSGTEST02().validate(m);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class MSGTEST021Test method testValidateThrowsISOVException1.
@Test
public void testValidateThrowsISOVException1() throws Throwable {
ISOComponent m = new ISOVMsg(new ISOMsg("testMSGTEST02Mti"));
try {
new MSGTEST02(true).validate(m);
fail("Expected ISOVException to be thrown");
} catch (ISOVException ex) {
assertEquals("ex.getMessage()", "Error on msg. ", ex.getMessage());
assertFalse("ex.treated", ex.treated);
assertSame("ex.errComponent", m, ex.errComponent);
assertNull("ex.getNested()", ex.getNested());
}
}
Aggregations