use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class CSChannelTest method testSendMessageHeader.
@Test
public void testSendMessageHeader() throws Throwable {
CSChannel cSChannel = new CSChannel();
cSChannel.sendMessageHeader(new ISOMsg(), 100);
assertEquals("cSChannel.getHeaderLength()", 0, cSChannel.getHeaderLength());
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class ChannelPoolTest method testSendThrowsIllegalArgumentException.
@Test
public void testSendThrowsIllegalArgumentException() throws Throwable {
ChannelPool channelPool = new ChannelPool();
channelPool.addChannel(new GZIPChannel("testChannelPoolHost", -1, new Base1SubFieldPackager()));
try {
channelPool.send((ISOMsg) new ISOMsg().clone());
fail("Expected IllegalArgumentException to be thrown");
} catch (IllegalArgumentException ex) {
assertEquals("ex.getMessage()", "port out of range:-1", ex.getMessage());
assertEquals("channelPool.pool.size()", 1, channelPool.pool.size());
assertNull("channelPool.current", channelPool.current);
assertTrue("channelPool.usable", channelPool.usable);
}
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class ChannelPoolTest method testSendThrowsIOException.
@Test
public void testSendThrowsIOException() throws Throwable {
ChannelPool channelPool = new ChannelPool();
try {
channelPool.send(new ISOMsg());
fail("Expected IOException to be thrown");
} catch (IOException ex) {
assertEquals("ex.getClass()", IOException.class, ex.getClass());
assertEquals("channelPool.pool.size()", 0, channelPool.pool.size());
assertNull("channelPool.current", channelPool.current);
assertTrue("channelPool.usable", channelPool.usable);
}
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class NACChannelTest method testSendMessageHeader.
@Test
public void testSendMessageHeader() throws Throwable {
NACChannel nACChannel = new NACChannel();
ISOMsg m = new ISOMsg();
nACChannel.sendMessageHeader(m, 100);
assertTrue("Execute without Exception", true);
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class NCCChannelTest method testSendMessageHeaderThrowsNullPointerException.
@Test
public void testSendMessageHeaderThrowsNullPointerException() throws Throwable {
byte[] TPDU = new byte[1];
NCCChannel nCCChannel = new NCCChannel(new ISO87BPackager(), TPDU, new ServerSocket());
ISOMsg m = new ISOMsg();
try {
nCCChannel.sendMessageHeader(m, 100);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations