use of org.jpos.iso.packager.XMLPackager in project jPOS by jpos.
the class SslChannelIntegrationTest method newIsoServer.
private ISOServer newIsoServer() throws IOException, ISOException {
XMLChannel clientSide = new XMLChannel(new XMLPackager());
clientSide.setLogger(logger, "server.channel");
ISOServer isoServer = new ISOServer(PORT, clientSide, new ThreadPool());
isoServer.setSocketFactory(new GenericSSLSocketFactory());
isoServer.setConfiguration(serverConfiguration());
isoServer.setLogger(logger, "server");
isoServer.addISORequestListener(new TestListener());
return isoServer;
}
use of org.jpos.iso.packager.XMLPackager in project jPOS by jpos.
the class X25ChannelTest method testSetHeaderThrowsNullPointerException.
@Test
public void testSetHeaderThrowsNullPointerException() throws Throwable {
X25Channel x25Channel = new X25Channel("testX25ChannelHost", 100, new XMLPackager());
try {
x25Channel.setHeader((String) null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"String.getBytes()\" because \"header\" is null", ex.getMessage(), "ex.getMessage()");
}
assertNull(x25Channel.header, "x25Channel.header");
}
}
use of org.jpos.iso.packager.XMLPackager 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(m, result, "result");
}
use of org.jpos.iso.packager.XMLPackager 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) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"org.jpos.util.LogEvent.addMessage(Object)\" because \"evt\" is null", ex.getMessage(), "ex.getMessage()");
}
assertEquals(0, m.getDirection(), "m.getDirection()");
}
}
use of org.jpos.iso.packager.XMLPackager in project jPOS by jpos.
the class StatefulFilterTest method testFilter7.
@Test
public void testFilter7() throws Throwable {
int[] key = new int[0];
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(key);
statefulFilter.setMatchDirection(0);
statefulFilter.setSavedFields(null);
ISOMsg m = new ISOMsg("testStatefulFilterMti");
ISOMsg result = statefulFilter.filter(new PADChannel(new XMLPackager()), m, new LogEvent(new Base1SubFieldPackager(), "testStatefulFilterTag"));
assertSame(m, result, "result");
}
Aggregations