Search in sources :

Example 26 with AbstractServerConnectionFactory

use of org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory 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);
}
Also used : AbstractClientConnectionFactory(org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory) TcpNioServerConnectionFactory(org.springframework.integration.ip.tcp.connection.TcpNioServerConnectionFactory) AbstractServerConnectionFactory(org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory) TcpNioClientConnectionFactory(org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory) Test(org.junit.Test)

Aggregations

AbstractServerConnectionFactory (org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory)26 Test (org.junit.Test)25 TcpNetServerConnectionFactory (org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory)14 Socket (java.net.Socket)13 QueueChannel (org.springframework.integration.channel.QueueChannel)12 ServerSocket (java.net.ServerSocket)10 BeanFactory (org.springframework.beans.factory.BeanFactory)8 TcpNioServerConnectionFactory (org.springframework.integration.ip.tcp.connection.TcpNioServerConnectionFactory)8 ServiceActivatingHandler (org.springframework.integration.handler.ServiceActivatingHandler)6 AbstractClientConnectionFactory (org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory)5 CountDownLatch (java.util.concurrent.CountDownLatch)4 ApplicationEventPublisher (org.springframework.context.ApplicationEventPublisher)4 ByteArrayCrLfSerializer (org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer)4 DatagramSocket (java.net.DatagramSocket)3 MessageChannel (org.springframework.messaging.MessageChannel)3 PollableChannel (org.springframework.messaging.PollableChannel)3 HashSet (java.util.HashSet)2 TimeUnit (java.util.concurrent.TimeUnit)2 Log (org.apache.commons.logging.Log)2 Assert.assertEquals (org.junit.Assert.assertEquals)2