# IGNITE-709 Added testClientAndRouterFail() test
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4d5b8998 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4d5b8998 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4d5b8998 Branch: refs/heads/ignite-709_3 Commit: 4d5b8998cba39b61afd5d2fd7684bc78d6bc3faa Parents: 85a49ec Author: sevdokimov <sevdoki...@gridgain.com> Authored: Thu May 14 16:30:18 2015 +0300 Committer: sevdokimov <sevdoki...@gridgain.com> Committed: Thu May 14 16:30:18 2015 +0300 ---------------------------------------------------------------------- .../tcp/TcpClientDiscoverySpiSelfTest.java | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4d5b8998/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java index 119fc53..6544369 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java @@ -597,6 +597,39 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + public void testClientAndRouterFail() throws Exception { + startServerNodes(2); + startClientNodes(2); + + checkNodes(2, 2); + + srvFailedLatch = new CountDownLatch(2); + clientFailedLatch = new CountDownLatch(2); + + attachListeners(1, 1); + + ((TcpDiscoverySpi)G.ignite("server-1").configuration().getDiscoverySpi()).addSendMessageListener(new IgniteInClosure<TcpDiscoveryAbstractMessage>() { + @Override public void apply(TcpDiscoveryAbstractMessage msg) { + try { + Thread.sleep(1000000); + } + catch (InterruptedException ignored) { + Thread.interrupted(); + } + } + }); + failClient(1); + failServer(1); + + await(srvFailedLatch); + await(clientFailedLatch); + + checkNodes(1, 1); + } + + /** + * @throws Exception If failed. + */ public void testMetrics() throws Exception { startServerNodes(3); startClientNodes(3);