use of org.jpos.iso.channel.PostChannel in project jPOS by jpos.
the class BSHRequestListenerTest method testProcess.
@Test
public void testProcess() throws Throwable {
BSHRequestListener bSHRequestListener = new BSHRequestListener();
bSHRequestListener.setConfiguration(new SimpleConfiguration());
boolean result = bSHRequestListener.process(new PostChannel(), new ISOMsg("testBSHRequestListenerMti"));
// there is no source to process
assertFalse("result should be false", result);
assertEquals("bSHRequestListener.whitelist.size()", 1, bSHRequestListener.whitelist.size());
}
use of org.jpos.iso.channel.PostChannel in project jPOS by jpos.
the class MD5FilterTest method testFilterThrowsNullPointerException1.
@Test
public void testFilterThrowsNullPointerException1() throws Throwable {
int[] fields = new int[1];
MD5Filter mD5Filter = new MD5Filter();
mD5Filter.setConfiguration(new SimpleConfiguration());
mD5Filter.setFields(fields);
LogEvent evt = new LogEvent("testMD5FilterTag", Integer.valueOf(-12));
try {
mD5Filter.filter(new PostChannel(new CTCSubFieldPackager()), null, evt);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.channel.PostChannel in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException6.
@Test
public void testFilterThrowsNullPointerException6() throws Throwable {
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKeyPrefix(null);
try {
statefulFilter.filter(new PostChannel(new CTCSubFieldPackager()), new ISOMsg("testStatefulFilterMti"), new LogEvent());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.channel.PostChannel in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException.
@Test
public void testFilterThrowsNullPointerException() throws Throwable {
ISOMsg m = new ISOMsg(100);
m.setDirection(100);
int[] key = new int[0];
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(key);
statefulFilter.setSpace((Space) null);
statefulFilter.setMatchDirection(100);
try {
statefulFilter.filter(new PostChannel("testStatefulFilterHost", 100, new GenericSubFieldPackager()), m, new LogEvent());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.channel.PostChannel in project jPOS by jpos.
the class StatefulFilterTest method testFilter3.
@Test
public void testFilter3() throws Throwable {
int[] key = new int[0];
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(key);
statefulFilter.setMatchDirection(58);
statefulFilter.setSavedFields(null);
statefulFilter.setIgnoredFields(null);
ISOMsg m = new ISOMsg("testStatefulFilterMti");
m.setDirection(58);
ISOMsg result = statefulFilter.filter(new PostChannel("testStatefulFilterHost", 100, new XMLPackager()), m, new LogEvent("testStatefulFilterTag", new CTCSubFieldPackager()));
assertSame("result", m, result);
}
Aggregations