use of org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory in project spring-integration by spring-projects.
the class TcpOutboundGatewayTests method testNioGWPropagatesSocketClose.
@Test
public void testNioGWPropagatesSocketClose() throws Exception {
ServerSocket serverSocket = ServerSocketFactory.getDefault().createServerSocket(0);
final int port = serverSocket.getLocalPort();
AbstractClientConnectionFactory ccf = new TcpNioClientConnectionFactory("localhost", port);
ccf.setSerializer(new DefaultSerializer());
ccf.setDeserializer(new DefaultDeserializer());
ccf.setSoTimeout(10000);
ccf.setSingleUse(false);
ccf.start();
testGWPropagatesSocketCloseGuts(port, ccf, serverSocket);
serverSocket.close();
}
use of org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory in project spring-integration by spring-projects.
the class ConnectionFacforyTests method shouldReturnNioFlavor.
@Test
public void shouldReturnNioFlavor() throws Exception {
AbstractServerConnectionFactory server = Tcp.nioServer(0).get();
assertTrue(server instanceof TcpNioServerConnectionFactory);
AbstractClientConnectionFactory client = Tcp.nioClient("localhost", server.getPort()).get();
assertTrue(client instanceof TcpNioClientConnectionFactory);
}
Aggregations