use of org.jpos.util.LogEvent 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.util.LogEvent in project jPOS by jpos.
the class BaseChannelTest method testApplyIncomingFiltersThrowsVetoException.
@Test
public void testApplyIncomingFiltersThrowsVetoException() throws Throwable {
BaseChannel x25Channel = new X25Channel();
x25Channel.addFilter(new MD5Filter());
try {
x25Channel.applyIncomingFilters(new ISOMsg(), new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag"));
fail("Expected VetoException to be thrown");
} catch (ISOFilter.VetoException ex) {
assertEquals("ex.getMessage()", "MD5Filter not configured", ex.getMessage());
assertNull("ex.nested", ex.nested);
}
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BaseChannelTest method testApplyIncomingFilters.
@Test
public void testApplyIncomingFilters() throws Throwable {
byte[] image = "testString".getBytes();
final BaseChannel cSChannel = new CSChannel();
cSChannel.addIncomingFilter(filter);
final LogEvent evt = new LogEvent();
byte[] header = new byte[2];
when(filter.filter(cSChannel, m, evt)).thenReturn(m);
ISOMsg result = cSChannel.applyIncomingFilters(m, header, image, evt);
assertSame("result", m, result);
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BaseChannelTest method testApplyIncomingFilters2.
@Test
public void testApplyIncomingFilters2() throws Throwable {
BaseChannel x25Channel = new X25Channel(null, new ServerSocket());
byte[] header = new byte[1];
byte[] image = new byte[1];
ISOMsg result = x25Channel.applyIncomingFilters(null, header, image, new LogEvent("testBaseChannelTag"));
assertNull("result", result);
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BaseChannelTest method testApplyOutgoingFilters.
@Test
public void testApplyOutgoingFilters() throws Throwable {
BaseChannel x25Channel = new X25Channel();
LogEvent evt = new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag");
ISOMsg result = x25Channel.applyOutgoingFilters(m, evt);
assertSame("result", m, result);
}
Aggregations