Search in sources :

Example 16 with TcpNioClientConnectionFactory

use of org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory 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

TcpNioClientConnectionFactory (org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory)16 Test (org.junit.Test)14 ServerSocket (java.net.ServerSocket)12 IOException (java.io.IOException)10 Socket (java.net.Socket)9 SocketException (java.net.SocketException)9 CountDownLatch (java.util.concurrent.CountDownLatch)9 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)9 AtomicReference (java.util.concurrent.atomic.AtomicReference)9 AbstractConnectionFactory (org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory)9 MessagingException (org.springframework.messaging.MessagingException)9 QueueChannel (org.springframework.integration.channel.QueueChannel)8 HashSet (java.util.HashSet)6 DefaultDeserializer (org.springframework.core.serializer.DefaultDeserializer)6 DefaultSerializer (org.springframework.core.serializer.DefaultSerializer)6 AbstractClientConnectionFactory (org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory)4 ByteArrayCrLfSerializer (org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer)4 ObjectInputStream (java.io.ObjectInputStream)3 ObjectOutputStream (java.io.ObjectOutputStream)3 Semaphore (java.util.concurrent.Semaphore)3