use of org.jpos.iso.ISOException in project jPOS by jpos.
the class TEST01001Test method testValidateThrowsISOException.
@Test
public void testValidateThrowsISOException() throws Throwable {
TEST0100 tEST0100 = new TEST0100();
try {
tEST0100.validate(new ISOMsg());
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "MTI not available", ex.getMessage());
assertNull("ex.getNested()", ex.getNested());
}
}
use of org.jpos.iso.ISOException in project jPOS by jpos.
the class LoopbackChannelTest method testSendThrowsISOException.
@Test
public void testSendThrowsISOException() throws Throwable {
LoopbackChannel loopbackChannel = new LoopbackChannel();
loopbackChannel.setUsable(false);
try {
loopbackChannel.send(new ISOMsg(100));
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "unconnected ISOChannel", ex.getMessage());
assertNull("ex.getNested()", ex.getNested());
assertEquals("loopbackChannel.queue.consumerCount()", 0, loopbackChannel.queue.consumerCount());
assertEquals("loopbackChannel.getCounters().length", 3, loopbackChannel.getCounters().length);
}
}
use of org.jpos.iso.ISOException in project jPOS by jpos.
the class CTCSubFieldPackagerTest method testPackThrowsISOException1.
@Test
public void testPackThrowsISOException1() throws Throwable {
try {
new CTCSubFieldPackager().pack(new ISOBinaryField(100));
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "null: null", ex.getMessage());
assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
}
}
use of org.jpos.iso.ISOException in project jPOS by jpos.
the class EuroSubFieldPackagerTest method testPackThrowsISOException1.
@Test
public void testPackThrowsISOException1() throws Throwable {
try {
new EuroSubFieldPackager().pack(new ISOMsg("testEuroSubFieldPackagerMti"));
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "java.lang.NullPointerException", ex.getMessage());
assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
}
}
use of org.jpos.iso.ISOException in project jPOS by jpos.
the class GenericPackagerTest method testReadFileThrowsISOException.
@Test
public void testReadFileThrowsISOException() throws Throwable {
try {
new GenericSubFieldPackager().readFile(new ByteArrayInputStream("".getBytes()));
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getNested().getClass()", SAXParseException.class, ex.getNested().getClass());
assertEquals("ex.getNested().getMessage()", "Premature end of file.", ex.getNested().getMessage());
}
}
Aggregations