use of org.jpos.iso.channel.XMLChannel in project jPOS by jpos.
the class BaseChannelTest method testSendMessageTrailer.
@Test
public void testSendMessageTrailer() throws Throwable {
BaseChannel xMLChannel = new XMLChannel(new PostPackager());
xMLChannel.sendMessageTrailer(new ISOMsg(), new byte[] { 100 });
int actual = xMLChannel.getHeaderLength();
assertEquals("(XMLChannel) xMLChannel.getHeaderLength()", 0, actual);
}
use of org.jpos.iso.channel.XMLChannel in project jPOS by jpos.
the class BaseChannelTest method testAcceptThrowsNullPointerException.
@Test
public void testAcceptThrowsNullPointerException() throws Throwable {
BaseChannel xMLChannel = new XMLChannel(new PostPackager());
try {
xMLChannel.accept(null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertNull("(XMLChannel) xMLChannel.logger", ((XMLChannel) xMLChannel).logger);
assertNull("(XMLChannel) xMLChannel.originalRealm", ((XMLChannel) xMLChannel).originalRealm);
assertNull("(XMLChannel) xMLChannel.serverIn", ((XMLChannel) xMLChannel).serverIn);
assertNull("(XMLChannel) xMLChannel.serverOut", ((XMLChannel) xMLChannel).serverOut);
assertNull("(XMLChannel) xMLChannel.getSocket()", xMLChannel.getSocket());
assertEquals("(XMLChannel) xMLChannel.cnt.length", 3, ((XMLChannel) xMLChannel).cnt.length);
assertNull("(XMLChannel) xMLChannel.realm", ((XMLChannel) xMLChannel).realm);
assertFalse("(XMLChannel) xMLChannel.usable", ((XMLChannel) xMLChannel).usable);
}
}
use of org.jpos.iso.channel.XMLChannel in project jPOS by jpos.
the class BaseChannelTest method testIsConnected.
@Test
public void testIsConnected() throws Throwable {
boolean result = new XMLChannel(new ISO87APackager()).isConnected();
assertFalse("result", result);
}
use of org.jpos.iso.channel.XMLChannel in project jPOS by jpos.
the class ConnectorTest method testProcess.
@Test
public void testProcess() throws Throwable {
Connector connector = new Connector();
boolean result = connector.process(new XMLChannel(), new ISOMsg(100));
assertTrue("result", result);
}
use of org.jpos.iso.channel.XMLChannel 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 SunJSSESocketFactory());
clientChannel.setConfiguration(clientConfiguration());
clientChannel.setLogger(logger, "client.channel");
clientChannel.setHost("localhost", PORT);
return clientChannel;
}
Aggregations