use of org.jpos.iso.channel.XMLChannel in project jPOS by jpos.
the class ConnectorTest method testProcessConstructor.
@Test
public void testProcessConstructor() throws Throwable {
ISOSource source = new XMLChannel(new EuroPackager(), new ServerSocket());
ISOMsg m = new ISOMsg(100);
Connector.Process process = new Connector().new Process(source, m);
assertSame("process.m", m, process.m);
assertSame("process.source", source, process.source);
}
use of org.jpos.iso.channel.XMLChannel in project jPOS by jpos.
the class SslChannelIntegrationTest method serverSideDisconnect.
@Test
public void serverSideDisconnect() throws Exception {
ISOServer isoServer = newIsoServer();
new Thread(isoServer).start();
XMLChannel clientChannel = newClientChannel();
clientChannel.connect();
// need to push some traffic through to complete the SSL handshake
clientChannel.send(new ISOMsg("0800"));
assertThat(clientChannel.receive(), hasMti("0810"));
isoServer.shutdown();
try {
clientChannel.receive();
fail("clientChannel should be closed");
} catch (Exception e) {
assertThat(e, is(instanceOf(EOFException.class)));
}
}
use of org.jpos.iso.channel.XMLChannel 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 SunJSSESocketFactory());
isoServer.setConfiguration(serverConfiguration());
isoServer.setLogger(logger, "server");
isoServer.addISORequestListener(new TestListener());
return isoServer;
}
Aggregations