use of org.jpos.iso.channel.GZIPChannel in project jPOS by jpos.
the class MacroFilterTest method testFilter.
@Test
public void testFilter() throws Throwable {
MacroFilter macroFilter = new MacroFilter();
ISOChannel channel = new GZIPChannel(new X92GenericPackager());
LogEvent evt = new LogEvent("testMacroFilterTag", "\u0000\u0000");
when(m.getMaxField()).thenReturn(0);
ISOMsg result = macroFilter.filter(channel, m, evt);
assertSame("result", m, result);
verify(m).hasField(0);
}
use of org.jpos.iso.channel.GZIPChannel in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException5.
@Test
public void testFilterThrowsNullPointerException5() throws Throwable {
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setSpace((Space) null);
try {
statefulFilter.filter(new GZIPChannel(), new ISOMsg("testStatefulFilterMti"), new LogEvent());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.channel.GZIPChannel in project jPOS by jpos.
the class BaseChannelTest method testAddFilter3.
@Test
public void testAddFilter3() throws Throwable {
BaseChannel gZIPChannel = new GZIPChannel();
gZIPChannel.addFilter(new DelayFilter(), 2);
assertEquals("(GZIPChannel) gZIPChannel.outgoingFilters.size()", 1, ((GZIPChannel) gZIPChannel).outgoingFilters.size());
}
use of org.jpos.iso.channel.GZIPChannel in project jPOS by jpos.
the class BaseChannelTest method testSetIncomingFilters.
@Test
public void testSetIncomingFilters() throws Throwable {
BaseChannel gZIPChannel = new GZIPChannel();
gZIPChannel.setIncomingFilters(new ArrayList());
assertEquals("(GZIPChannel) gZIPChannel.incomingFilters.size()", 0, ((GZIPChannel) gZIPChannel).incomingFilters.size());
}
use of org.jpos.iso.channel.GZIPChannel 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());
}
Aggregations