use of org.jpos.iso.channel.PADChannel in project jPOS by jpos.
the class MacroFilterTest method testFilterThrowsNullPointerException.
@Test
public void testFilterThrowsNullPointerException() throws Throwable {
MacroFilter macroFilter = new MacroFilter();
LogEvent evt = new LogEvent();
try {
macroFilter.filter(new PADChannel("testMacroFilterHost", 100, new XMLPackager()), null, evt);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertNull("macroFilter.cfg", macroFilter.cfg);
assertNull("macroFilter.seq", macroFilter.seq);
}
}
use of org.jpos.iso.channel.PADChannel in project jPOS by jpos.
the class QMUXTest method testProcessUnhandled.
@Test
public void testProcessUnhandled() throws Throwable {
ISOMsg m = new ISOMsg("testQMUXMti");
m.setSource(new PADChannel(new EuroSubFieldPackager()));
QMUX qMUX = new QMUX();
qMUX.processUnhandled(m);
assertEquals("qMUX.listeners.size()", 0, qMUX.listeners.size());
}
use of org.jpos.iso.channel.PADChannel in project jPOS by jpos.
the class BSHFilterTest method testFilter.
@Test
public void testFilter() throws Throwable {
Configuration cfg = new SimpleConfiguration();
BSHFilter bSHFilter = new BSHFilter();
bSHFilter.setConfiguration(cfg);
ISOMsg result = bSHFilter.filter(new PADChannel(), null, new LogEvent("testBSHFilterTag", "testString"));
assertNull("result", result);
assertSame("bSHFilter.cfg", cfg, bSHFilter.cfg);
}
use of org.jpos.iso.channel.PADChannel in project jPOS by jpos.
the class MacroFilterTest method testFilter3.
@Test
public void testFilter3() throws Throwable {
MacroFilter macroFilter = new MacroFilter();
ISOChannel channel = new PADChannel(new GenericSubFieldPackager());
LogEvent evt = new LogEvent();
when(m.getMaxField()).thenReturn(0);
when(m.hasField(0)).thenReturn(false);
ISOMsg result = macroFilter.filter(channel, m, evt);
assertSame("result", m, result);
}
use of org.jpos.iso.channel.PADChannel in project jPOS by jpos.
the class StatefulFilterTest method testFilter2.
@Test
public void testFilter2() throws Throwable {
int[] key = new int[0];
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(key);
ISOChannel iSOChannel = new PADChannel();
LogEvent evt = new LogEvent("testStatefulFilterTag");
ISOMsg m = mock(ISOMsg.class);
given(m.getDirection()).willReturn(58);
ISOMsg result = statefulFilter.filter(iSOChannel, m, evt);
assertSame("result", m, result);
}
Aggregations