use of org.jpos.iso.channel.GZIPChannel in project jPOS by jpos.
the class BaseChannelTest method testSetLogger1.
@Test
public void testSetLogger1() throws Throwable {
BaseChannel gZIPChannel = new GZIPChannel();
Logger logger = new Logger();
gZIPChannel.setLogger(logger, "testBaseChannelRealm");
gZIPChannel.setLogger(logger, "testBaseChannelRealm");
assertSame("(GZIPChannel) gZIPChannel.logger", logger, ((GZIPChannel) gZIPChannel).logger);
assertEquals("(GZIPChannel) gZIPChannel.realm", "testBaseChannelRealm", ((GZIPChannel) gZIPChannel).realm);
}
use of org.jpos.iso.channel.GZIPChannel in project jPOS by jpos.
the class BaseChannelTest method testRemoveFilter1.
@Test
public void testRemoveFilter1() throws Throwable {
BaseChannel gZIPChannel = new GZIPChannel();
gZIPChannel.removeFilter(new BSHFilter(), 1);
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 testApplyIncomingFilters1.
@Test
public void testApplyIncomingFilters1() throws Throwable {
BaseChannel gZIPChannel = new GZIPChannel("testBaseChannelHost", 100, new ISOBaseValidatingPackager());
LogEvent evt = new LogEvent();
byte[] header = new byte[0];
byte[] image = new byte[2];
ISOMsg result = gZIPChannel.applyIncomingFilters(m, header, image, evt);
assertSame("result", m, result);
}
use of org.jpos.iso.channel.GZIPChannel in project jPOS by jpos.
the class BaseChannelTest method testSetConfiguration1.
@Test
public void testSetConfiguration1() throws Throwable {
BaseChannel gZIPChannel = new GZIPChannel();
gZIPChannel.setConfiguration(new SimpleConfiguration());
assertEquals("(GZIPChannel) gZIPChannel.getTimeout()", 300000, gZIPChannel.getTimeout());
assertEquals("(GZIPChannel) gZIPChannel.getMaxPacketLength()", 100000, gZIPChannel.getMaxPacketLength());
assertFalse("(GZIPChannel) gZIPChannel.overrideHeader", ((GZIPChannel) gZIPChannel).overrideHeader);
}
use of org.jpos.iso.channel.GZIPChannel in project jPOS by jpos.
the class MD5FilterTest method testFilterThrowsNullPointerException.
@Test
public void testFilterThrowsNullPointerException() throws Throwable {
MD5Filter mD5Filter = new MD5Filter();
mD5Filter.setConfiguration(new SimpleConfiguration());
int[] fields = new int[1];
mD5Filter.setFields(fields);
ISOMsg m = new ISOMsg("testMD5FilterMti");
try {
mD5Filter.filter(new GZIPChannel(new XMLPackager()), m, null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertEquals("m.getDirection()", 0, m.getDirection());
}
}
Aggregations