use of org.jpos.iso.packager.GenericValidatingPackager in project jPOS by jpos.
the class BaseChannelTest method testSendMessageHeader.
@Test
public void testSendMessageHeader() throws Throwable {
ISOMsg m = new ISOMsg();
BaseChannel gZIPChannel = new GZIPChannel(new GenericValidatingPackager());
gZIPChannel.sendMessageHeader(m, 100);
assertNull("(GZIPChannel) gZIPChannel.serverOut", ((GZIPChannel) gZIPChannel).serverOut);
assertEquals("m.getDirection()", 0, m.getDirection());
}
use of org.jpos.iso.packager.GenericValidatingPackager in project jPOS by jpos.
the class CSChannelTest method testConstructor1.
@Test
public void testConstructor1() throws Throwable {
ISOPackager p = new GenericValidatingPackager();
CSChannel cSChannel = new CSChannel("testCSChannelHost", 100, p);
assertEquals("cSChannel.getIncomingFilters().size()", 0, cSChannel.getIncomingFilters().size());
assertEquals("cSChannel.getMaxPacketLength()", 100000, cSChannel.getMaxPacketLength());
assertSame("cSChannel.getPackager()", p, cSChannel.getPackager());
assertEquals("cSChannel.getPort()", 100, cSChannel.getPort());
assertEquals("cSChannel.getName()", "", cSChannel.getName());
assertEquals("cSChannel.getCounters().length", 3, cSChannel.getCounters().length);
assertNull("cSChannel.getLogger()", cSChannel.getLogger());
assertNull("cSChannel.getSocketFactory()", cSChannel.getSocketFactory());
assertNull("cSChannel.getHeader()", cSChannel.getHeader());
assertEquals("cSChannel.getOutgoingFilters().size()", 0, cSChannel.getOutgoingFilters().size());
assertNull("cSChannel.getServerSocket()", cSChannel.getServerSocket());
assertEquals("cSChannel.getOriginalRealm()", "org.jpos.iso.channel.CSChannel", cSChannel.getOriginalRealm());
assertNull("cSChannel.getRealm()", cSChannel.getRealm());
assertEquals("cSChannel.getHost()", "testCSChannelHost", cSChannel.getHost());
}
use of org.jpos.iso.packager.GenericValidatingPackager in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException2.
@Test
public void testFilterThrowsNullPointerException2() throws Throwable {
int[] key = new int[1];
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(key);
try {
statefulFilter.filter(new BASE24TCPChannel(new GenericValidatingPackager()), null, new LogEvent());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations