use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class CSChannelTest method testGetHeaderLength.
@Test
public void testGetHeaderLength() throws Throwable {
CSChannel cSChannel = new CSChannel("testCSChannelHost", 100, new PostPackager());
int result = cSChannel.getHeaderLength();
assertEquals(0, result, "result");
}
use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class NACChannelTest method testSendMessageHeaderThrowsNullPointerException1.
@Test
public void testSendMessageHeaderThrowsNullPointerException1() throws Throwable {
byte[] TPDU = new byte[0];
NACChannel nACChannel = new NACChannel(new PostPackager(), TPDU);
ISOMsg m = new ISOMsg();
try {
nACChannel.sendMessageHeader(m, 100);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"java.io.DataOutputStream.write(byte[])\" because \"this.serverOut\" is null", ex.getMessage(), "ex.getMessage()");
}
}
}
use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class X25ChannelTest method testSetHeader.
@Test
public void testSetHeader() throws Throwable {
X25Channel x25Channel = new X25Channel(new PostPackager());
x25Channel.setHeader("testX25ChannelHeader");
assertEquals(10, x25Channel.header.length, "x25Channel.header.length");
}
use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException1.
@Test
public void testFilterThrowsNullPointerException1() throws Throwable {
int[] key = new int[0];
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(key);
statefulFilter.setSpace((Space) null);
statefulFilter.setMatchDirection(0);
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) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"org.jpos.space.Space.out(Object, Object, long)\" because the return value of \"org.jpos.iso.filter.StatefulFilter.getSpace()\" is null", ex.getMessage(), "ex.getMessage()");
}
}
}
use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException7.
@Test
public void testFilterThrowsNullPointerException7() throws Throwable {
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(null);
try {
statefulFilter.filter(new BASE24TCPChannel(new EuroSubFieldPackager()), new ISOMsg(), new LogEvent(new PostPackager(), "testStatefulFilterTag"));
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot read the array length because \"<local8>\" is null", ex.getMessage(), "ex.getMessage()");
}
}
}
Aggregations