use of org.jpos.iso.channel.BASE24TCPChannel in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsVetoException.
@Test
public void testFilterThrowsVetoException() throws Throwable {
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setSpace("testStatefulFilterUri");
int[] key = new int[0];
statefulFilter.setVetoUnmatched(true);
statefulFilter.setKey(key);
try {
statefulFilter.filter(new BASE24TCPChannel(), new ISOMsg("testStatefulFilterMti"), new LogEvent());
fail("Expected VetoException to be thrown");
} catch (ISOFilter.VetoException ex) {
assertEquals("ex.getMessage()", "unmatched iso message", ex.getMessage());
assertNull("ex.getNested()", ex.getNested());
}
}
use of org.jpos.iso.channel.BASE24TCPChannel in project jPOS by jpos.
the class FilterLogListenerTest method testLog1.
@Test
public void testLog1() throws Throwable {
LogEvent ev = new LogEvent(new BASE24TCPChannel(), "testFilterLogListenerTag", "");
FilterLogListener filterLogListener = new FilterLogListener();
LogEvent result = filterLogListener.log(ev);
assertSame("result", ev, result);
assertNotNull("filterLogListener.p", filterLogListener.p);
}
use of org.jpos.iso.channel.BASE24TCPChannel in project jPOS by jpos.
the class BaseChannelTest method testRemoveFilter2.
@Test
public void testRemoveFilter2() throws Throwable {
BaseChannel bASE24TCPChannel = new BASE24TCPChannel();
bASE24TCPChannel.removeFilter(new DelayFilter(), 0);
assertEquals("(BASE24TCPChannel) bASE24TCPChannel.incomingFilters.size()", 0, ((BASE24TCPChannel) bASE24TCPChannel).incomingFilters.size());
assertEquals("(BASE24TCPChannel) bASE24TCPChannel.outgoingFilters.size()", 0, ((BASE24TCPChannel) bASE24TCPChannel).outgoingFilters.size());
}
use of org.jpos.iso.channel.BASE24TCPChannel in project jPOS by jpos.
the class MacroFilterTest method testFilter2.
@Test
public void testFilter2() throws Throwable {
ISOMsg m = new ISOMsg();
m.set(100, "testMacroFilterValue");
ISOMsg result = new MacroFilter().filter(new BASE24TCPChannel(), m, new LogEvent("testMacroFilterTag"));
assertSame("result", m, result);
}
use of org.jpos.iso.channel.BASE24TCPChannel in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException7.
@Test
public void testFilterThrowsNullPointerException7() throws Throwable {
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(null);
try {
statefulFilter.filter(new BASE24TCPChannel(new EuroSubFieldPackager()), new ISOMsg(), new LogEvent(new PostPackager(), "testStatefulFilterTag"));
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations