use of org.jpos.iso.packager.Base1SubFieldPackager in project jPOS by jpos.
the class ASCIIChannelTest method testSendMessageLengthThrowsNullPointerException1.
@Test
public void testSendMessageLengthThrowsNullPointerException1() throws Throwable {
ASCIIChannel aSCIIChannel = new ASCIIChannel(new Base1SubFieldPackager());
try {
aSCIIChannel.sendMessageLength(9998);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.packager.Base1SubFieldPackager in project jPOS by jpos.
the class BASE24ChannelTest method testConstructor3.
@Test
public void testConstructor3() throws Throwable {
ISOPackager p = new Base1SubFieldPackager();
ServerSocket serverSocket = new ServerSocket();
BASE24Channel bASE24Channel = new BASE24Channel(p, serverSocket);
assertEquals("bASE24Channel.getIncomingFilters().size()", 0, bASE24Channel.getIncomingFilters().size());
assertEquals("bASE24Channel.getMaxPacketLength()", 100000, bASE24Channel.getMaxPacketLength());
assertSame("bASE24Channel.getPackager()", p, bASE24Channel.getPackager());
assertEquals("bASE24Channel.getPort()", 0, bASE24Channel.getPort());
assertEquals("bASE24Channel.getName()", "", bASE24Channel.getName());
assertEquals("bASE24Channel.getCounters().length", 3, bASE24Channel.getCounters().length);
assertNull("bASE24Channel.getLogger()", bASE24Channel.getLogger());
assertNull("bASE24Channel.getSocketFactory()", bASE24Channel.getSocketFactory());
assertNull("bASE24Channel.getHeader()", bASE24Channel.getHeader());
assertEquals("bASE24Channel.getOutgoingFilters().size()", 0, bASE24Channel.getOutgoingFilters().size());
assertSame("bASE24Channel.getServerSocket()", serverSocket, bASE24Channel.getServerSocket());
assertEquals("bASE24Channel.getOriginalRealm()", "org.jpos.iso.channel.BASE24Channel", bASE24Channel.getOriginalRealm());
assertNull("bASE24Channel.getRealm()", bASE24Channel.getRealm());
assertNull("bASE24Channel.getHost()", bASE24Channel.getHost());
}
use of org.jpos.iso.packager.Base1SubFieldPackager 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.packager.Base1SubFieldPackager in project jPOS by jpos.
the class DelayFilterTest method testFilter1.
@Test
public void testFilter1() throws Throwable {
LogEvent evt = new LogEvent(new BASE24TCPChannel("testDelayFilterHost", 100, new Base1SubFieldPackager()), "testDelayFilterTag", null);
ISOMsg result = new DelayFilter(1).filter(new PADChannel(), null, evt);
assertEquals("evt.payLoad.size()", 2, evt.getPayLoad().size());
assertEquals("evt.payLoad.get(1)", "<delay-filter delay=\"1\"/>", evt.getPayLoad().get(1));
assertNull("result", result);
}
use of org.jpos.iso.packager.Base1SubFieldPackager in project jPOS by jpos.
the class ChannelPoolTest method testSetPackager.
@Test
public void testSetPackager() throws Throwable {
ChannelPool channelPool = new ChannelPool();
channelPool.setPackager(new Base1SubFieldPackager());
assertEquals("channelPool.getName()", "", channelPool.getName());
}
Aggregations