use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException4.
@Test
public void testFilterThrowsNullPointerException4() throws Throwable {
ISOMsg m = new ISOMsg(100);
m.setDirection(100);
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setSpace((Space) null);
statefulFilter.setMatchDirection(100);
statefulFilter.setSavedFields(null);
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.ISOMsg 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.ISOMsg in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException8.
@Test
public void testFilterThrowsNullPointerException8() throws Throwable {
int[] key = new int[0];
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(key);
statefulFilter.setSpace((Space) null);
statefulFilter.setMatchDirection(0);
statefulFilter.setSavedFields(null);
statefulFilter.setIgnoredFields(null);
try {
statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100, new PostPackager()), new ISOMsg("testStatefulFilterMti"), new LogEvent());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException9.
@Test
public void testFilterThrowsNullPointerException9() 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);
statefulFilter.setSavedFields(null);
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.ISOMsg in project jPOS by jpos.
the class Base1_BITMAP126Test method testUnpackThrowsArrayIndexOutOfBoundsException.
@Test
public void testUnpackThrowsArrayIndexOutOfBoundsException() throws Throwable {
byte[] b = new byte[0];
ISOComponent c = new ISOMsg();
try {
new Base1_BITMAP126().unpack(c, b, 100);
fail("Expected ArrayIndexOutOfBoundsException to be thrown");
} catch (ArrayIndexOutOfBoundsException ex) {
assertEquals("ex.getMessage()", "100", ex.getMessage());
assertEquals("(ISOMsg) c.getDirection()", 0, ((ISOMsg) c).getDirection());
}
}
Aggregations