use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class BaseChannelTest method testDisconnect1.
@Test
public void testDisconnect1() throws Throwable {
ServerSocket sock = new ServerSocket();
BaseChannel cSChannel = new CSChannel(new PostPackager());
cSChannel.setServerSocket(sock);
cSChannel.disconnect();
assertSame(sock, ((CSChannel) cSChannel).serverSocket, "(CSChannel) cSChannel.serverSocket");
assertNull(cSChannel.getSocket(), "(CSChannel) cSChannel.getSocket()");
assertFalse(((CSChannel) cSChannel).usable, "(CSChannel) cSChannel.usable");
}
use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class BSHFilterTest method testFilterThrowsNullPointerException.
@Test
public void testFilterThrowsNullPointerException() throws Throwable {
BSHFilter bSHFilter = new BSHFilter();
LogEvent evt = new LogEvent();
try {
bSHFilter.filter(new CSChannel("testBSHFilterHost", 100, new PostPackager()), new ISOMsg("testBSHFilterMti"), evt);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"org.jpos.core.Configuration.getAll(String)\" because \"this.cfg\" is null", ex.getMessage(), "ex.getMessage()");
}
assertNull(bSHFilter.cfg, "bSHFilter.cfg");
}
}
use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class BaseChannelTest method testGetIncomingFilters.
@Test
public void testGetIncomingFilters() throws Throwable {
Collection result = (Collection) new CSChannel(new PostPackager()).getIncomingFilters();
assertEquals(0, result.size(), "result.size()");
}
use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class XMLChannelTest method testStreamReceive.
@Test
public void testStreamReceive() throws Throwable {
XMLChannel xMLChannel = new XMLChannel(new PostPackager(), new ServerSocket());
try {
xMLChannel.streamReceive();
} catch (EOFException e) {
return;
}
fail("EOFException should have been raised");
}
use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class NACChannelTest method testConstructor3.
@Test
public void testConstructor3() throws Throwable {
byte[] TPDU = new byte[0];
ISOPackager p = new PostPackager();
NACChannel nACChannel = new NACChannel(p, TPDU);
assertEquals(0, nACChannel.getIncomingFilters().size(), "nACChannel.getIncomingFilters().size()");
assertEquals(100000, nACChannel.getMaxPacketLength(), "nACChannel.getMaxPacketLength()");
assertSame(p, nACChannel.getPackager(), "nACChannel.getPackager()");
assertEquals(0, nACChannel.getPort(), "nACChannel.getPort()");
assertEquals("", nACChannel.getName(), "nACChannel.getName()");
assertEquals(3, nACChannel.getCounters().length, "nACChannel.getCounters().length");
assertNull(nACChannel.getLogger(), "nACChannel.getLogger()");
assertNull(nACChannel.getSocketFactory(), "nACChannel.getSocketFactory()");
assertSame(TPDU, nACChannel.getHeader(), "nACChannel.getHeader()");
assertEquals(0, nACChannel.getOutgoingFilters().size(), "nACChannel.getOutgoingFilters().size()");
assertNull(nACChannel.getServerSocket(), "nACChannel.getServerSocket()");
assertEquals("org.jpos.iso.channel.NACChannel", nACChannel.getOriginalRealm(), "nACChannel.getOriginalRealm()");
assertNull(nACChannel.getRealm(), "nACChannel.getRealm()");
assertNull(nACChannel.getHost(), "nACChannel.getHost()");
}
Aggregations