use of org.jpos.iso.channel.NACChannel in project jPOS by jpos.
the class BaseChannelTest method testGetCounters.
@Test
public void testGetCounters() throws Throwable {
int[] result = new NACChannel().getCounters();
assertEquals("result.length", 3, result.length);
assertEquals("result[0]", 0, result[0]);
}
use of org.jpos.iso.channel.NACChannel in project jPOS by jpos.
the class MacroFilterTest method testFilter5.
@Test
public void testFilter5() throws Throwable {
MacroFilter macroFilter = new MacroFilter();
LogEvent evt = new LogEvent();
ISOChannel channel = new NACChannel();
when(m.getMaxField()).thenReturn(0);
when(m.hasField(0)).thenReturn(true);
when(m.getValue(0)).thenReturn("N/A in Composite");
ISOMsg result = macroFilter.filter(channel, m, evt);
assertSame("result", m, result);
}
use of org.jpos.iso.channel.NACChannel in project jPOS by jpos.
the class StatefulFilterTest method testFilter1.
@Test
public void testFilter1() throws Throwable {
ISOMsg m = new ISOMsg("testStatefulFilterMti");
m.setDirection(1);
ISOMsg result = new StatefulFilter().filter(new NACChannel(), m, new LogEvent());
assertSame("result", m, result);
}
use of org.jpos.iso.channel.NACChannel in project jPOS by jpos.
the class BaseChannelTest method testRemoveFilter4.
@Test
public void testRemoveFilter4() throws Throwable {
BaseChannel nACChannel = new NACChannel();
nACChannel.removeFilter(new DelayFilter());
assertEquals("(NACChannel) nACChannel.incomingFilters.size()", 0, ((NACChannel) nACChannel).incomingFilters.size());
assertEquals("(NACChannel) nACChannel.outgoingFilters.size()", 0, ((NACChannel) nACChannel).outgoingFilters.size());
}
use of org.jpos.iso.channel.NACChannel in project jPOS by jpos.
the class DelayFilterTest method testFilterThrowsNullPointerException.
@Test
public void testFilterThrowsNullPointerException() throws Throwable {
try {
new DelayFilter(0).filter(new NACChannel(), new ISOMsg("testDelayFilterMti"), null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations