Search in sources :

Example 6 with ConnectionClientPool

use of org.apache.ignite.spi.communication.tcp.internal.ConnectionClientPool in project ignite by apache.

the class GridTcpCommunicationSpiLogTest method testCloseClientConnectionsDebugLogMessage.

/**
 * @throws Exception If failed.
 */
@Test
public void testCloseClientConnectionsDebugLogMessage() throws Exception {
    LogListener logLsnr0 = LogListener.matches("The node client connections were closed").atLeast(1).atMost(1).build();
    srvTestLog.registerListener(logLsnr0);
    IgniteEx srv = startGrid(0);
    Ignite client = startGrid(1);
    TcpCommunicationSpi commSpi = (TcpCommunicationSpi) srv.context().config().getCommunicationSpi();
    ConnectionClientPool connPool = U.field(commSpi, "clientPool");
    connPool.forceCloseConnection(client.cluster().localNode().id());
    U.sleep(1000);
    assertTrue(logLsnr0.check());
}
Also used : LogListener(org.apache.ignite.testframework.LogListener) IgniteEx(org.apache.ignite.internal.IgniteEx) ConnectionClientPool(org.apache.ignite.spi.communication.tcp.internal.ConnectionClientPool) Ignite(org.apache.ignite.Ignite) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

ConnectionClientPool (org.apache.ignite.spi.communication.tcp.internal.ConnectionClientPool)6 IgniteEx (org.apache.ignite.internal.IgniteEx)4 CountDownLatch (java.util.concurrent.CountDownLatch)3 CommunicationSpi (org.apache.ignite.spi.communication.CommunicationSpi)3 GridNioServerWrapper (org.apache.ignite.spi.communication.tcp.internal.GridNioServerWrapper)3 UUID (java.util.UUID)2 Ignite (org.apache.ignite.Ignite)2 IgniteException (org.apache.ignite.IgniteException)2 IgniteKernal (org.apache.ignite.internal.IgniteKernal)2 GridCommunicationClient (org.apache.ignite.internal.util.nio.GridCommunicationClient)2 GridNioSession (org.apache.ignite.internal.util.nio.GridNioSession)2 Message (org.apache.ignite.plugin.extensions.communication.Message)2 CommunicationWorker (org.apache.ignite.spi.communication.tcp.internal.CommunicationWorker)2 InboundConnectionHandler (org.apache.ignite.spi.communication.tcp.internal.InboundConnectionHandler)2 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 SocketException (java.net.SocketException)1 ByteBuffer (java.nio.ByteBuffer)1