use of org.jpos.iso.packager.XMLPackager in project jPOS by jpos.
the class LogChannelTest method testConstructor3.
@Test
public void testConstructor3() throws Throwable {
ISOPackager p = new XMLPackager();
LogChannel logChannel = new LogChannel(p);
assertEquals(0, logChannel.getIncomingFilters().size(), "logChannel.getIncomingFilters().size()");
assertEquals(100000, logChannel.getMaxPacketLength(), "logChannel.getMaxPacketLength()");
assertSame(p, logChannel.getPackager(), "logChannel.getPackager()");
assertEquals(0, logChannel.getPort(), "logChannel.getPort()");
assertEquals("", logChannel.getName(), "logChannel.getName()");
assertEquals(3, logChannel.getCounters().length, "logChannel.getCounters().length");
assertNull(logChannel.getLogger(), "logChannel.getLogger()");
assertNull(logChannel.getSocketFactory(), "logChannel.getSocketFactory()");
assertNull(logChannel.getHeader(), "logChannel.getHeader()");
assertEquals(0, logChannel.getOutgoingFilters().size(), "logChannel.getOutgoingFilters().size()");
assertNull(logChannel.getServerSocket(), "logChannel.getServerSocket()");
assertEquals("org.jpos.iso.channel.LogChannel", logChannel.getOriginalRealm(), "logChannel.getOriginalRealm()");
assertNull(logChannel.getRealm(), "logChannel.getRealm()");
assertNull(logChannel.reader, "logChannel.reader");
assertNull(logChannel.getHost(), "logChannel.getHost()");
}
use of org.jpos.iso.packager.XMLPackager in project jPOS by jpos.
the class RawChannelTest method testConstructor3.
@Test
public void testConstructor3() throws Throwable {
byte[] header = new byte[0];
ISOPackager p = new XMLPackager();
ServerSocket serverSocket = new ServerSocket();
RawChannel rawChannel = new RawChannel(p, header, serverSocket);
assertEquals(0, rawChannel.getIncomingFilters().size(), "rawChannel.getIncomingFilters().size()");
assertEquals(100000, rawChannel.getMaxPacketLength(), "rawChannel.getMaxPacketLength()");
assertSame(p, rawChannel.getPackager(), "rawChannel.getPackager()");
assertEquals(0, rawChannel.getPort(), "rawChannel.getPort()");
assertEquals("", rawChannel.getName(), "rawChannel.getName()");
assertEquals(3, rawChannel.getCounters().length, "rawChannel.getCounters().length");
assertNull(rawChannel.getLogger(), "rawChannel.getLogger()");
assertNull(rawChannel.getSocketFactory(), "rawChannel.getSocketFactory()");
assertSame(header, rawChannel.getHeader(), "rawChannel.getHeader()");
assertEquals(0, rawChannel.getOutgoingFilters().size(), "rawChannel.getOutgoingFilters().size()");
assertSame(serverSocket, rawChannel.getServerSocket(), "rawChannel.getServerSocket()");
assertEquals("org.jpos.iso.channel.RawChannel", rawChannel.getOriginalRealm(), "rawChannel.getOriginalRealm()");
assertNull(rawChannel.getRealm(), "rawChannel.getRealm()");
assertNull(rawChannel.getHost(), "rawChannel.getHost()");
}
use of org.jpos.iso.packager.XMLPackager in project jPOS by jpos.
the class BaseChannelTest method testSendKeepAliveThrowsNullPointerException.
@Test
public void testSendKeepAliveThrowsNullPointerException() throws Throwable {
try {
new X25Channel("testBaseChannelHost", 100, new XMLPackager()).sendKeepAlive();
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.flush()\" because \"this.serverOut\" is null", ex.getMessage(), "ex.getMessage()");
}
}
}
use of org.jpos.iso.packager.XMLPackager in project jPOS by jpos.
the class SslChannelIntegrationTest method newClientChannel.
private XMLChannel newClientChannel() throws IOException, ISOException {
XMLChannel clientChannel = new XMLChannel(new XMLPackager());
clientChannel.setSocketFactory(new GenericSSLSocketFactory());
clientChannel.setConfiguration(clientConfiguration());
clientChannel.setLogger(logger, "client.channel");
clientChannel.setHost("localhost", PORT);
return clientChannel;
}
use of org.jpos.iso.packager.XMLPackager in project jPOS by jpos.
the class VAPChannelTest method testSendMessageHeaderThrowsNullPointerException2.
@Test
public void testSendMessageHeaderThrowsNullPointerException2() throws Throwable {
VAPChannel vAPChannel = new VAPChannel("testVAPChannelHost", 100, new XMLPackager());
ISOMsg m = new ISOMsg("testVAPChannelMti");
m.setHeader(new BaseHeader());
try {
vAPChannel.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()");
}
assertEquals(0, m.getDirection(), "m.getDirection()");
}
}
Aggregations