use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class VAPChannelTest method testSendMessageHeaderThrowsNullPointerException1.
@Test
public void testSendMessageHeaderThrowsNullPointerException1() throws Throwable {
ISOMsg m = new ISOMsg(100);
VAPChannel vAPChannel = new VAPChannel(new Base1Packager());
vAPChannel.setConfiguration(new SimpleConfiguration());
try {
vAPChannel.sendMessageHeader(m, 100);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class MD5FilterTest method testFilterThrowsVetoException4.
@Test
public void testFilterThrowsVetoException4() throws Throwable {
MD5Filter mD5Filter = new MD5Filter();
mD5Filter.setConfiguration(new SimpleConfiguration());
int[] fields = new int[1];
fields[0] = -100;
mD5Filter.setFields(fields);
ISOMsg m = new ISOMsg("testMD5FilterMti");
m.setDirection(1);
LogEvent evt = new LogEvent("testMD5FilterTag");
try {
mD5Filter.filter(new ASCIIChannel(new ISOBaseValidatingPackager()), m, evt);
fail("Expected VetoException to be thrown");
} catch (ISOFilter.VetoException ex) {
assertEquals("evt.payLoad.size()", 3, evt.getPayLoad().size());
assertEquals("ex.getMessage()", "org.jpos.iso.ISOFilter$VetoException: invalid MAC", ex.getMessage());
assertEquals("ex.getNested().getMessage()", "invalid MAC", ex.getNested().getMessage());
assertEquals("m.getDirection()", 1, m.getDirection());
}
}
use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class MD5FilterTest method testGetKey.
@Test
public void testGetKey() throws Throwable {
MD5Filter mD5Filter = new MD5Filter();
mD5Filter.setConfiguration(new SimpleConfiguration());
byte[] result = mD5Filter.getKey();
assertEquals("result.length", 0, result.length);
}
use of org.jpos.core.SimpleConfiguration 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.core.SimpleConfiguration in project jPOS by jpos.
the class MD5FilterTest method testFilterThrowsNullPointerException3.
@Test
public void testFilterThrowsNullPointerException3() throws Throwable {
MD5Filter mD5Filter = new MD5Filter();
mD5Filter.setConfiguration(new SimpleConfiguration());
int[] fields = new int[1];
fields[0] = -100;
mD5Filter.setFields(fields);
ISOMsg m = new ISOMsg("testMD5FilterMti");
try {
mD5Filter.filter(new GZIPChannel(new XMLPackager()), m, null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertEquals("m.getDirection()", 0, m.getDirection());
}
}
Aggregations