You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/11/22 10:49:05 UTC

[02/10] ignite git commit: IGNITE-2355: fix test - clear client connections before and after a test.

IGNITE-2355: fix test - clear client connections before and after a test.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6e4a279e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6e4a279e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6e4a279e

Branch: refs/heads/ignite-4259
Commit: 6e4a279e34584881469a7d841432e6c38db2f06f
Parents: 88f38ac
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Mon Nov 21 19:15:17 2016 +0500
Committer: tledkov-gridgain <tl...@gridgain.com>
Committed: Mon Nov 21 19:15:17 2016 +0500

----------------------------------------------------------------------
 ...opClientProtocolMultipleServersSelfTest.java | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6e4a279e/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java
index 0e51938..cb83a73 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java
@@ -23,6 +23,7 @@ import java.io.OutputStreamWriter;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -44,6 +45,8 @@ import org.apache.ignite.IgniteFileSystem;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.hadoop.mapreduce.IgniteHadoopClientProtocolProvider;
 import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.client.GridClient;
 import org.apache.ignite.internal.client.GridServerUnreachableException;
 import org.apache.ignite.internal.processors.hadoop.impl.HadoopAbstractSelfTest;
 import org.apache.ignite.internal.processors.hadoop.impl.HadoopUtils;
@@ -76,9 +79,18 @@ public class HadoopClientProtocolMultipleServersSelfTest extends HadoopAbstractS
     }
 
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        super.beforeTest();
+
+        clearClients();
+    }
+
+    /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         stopAllGrids();
 
+        clearClients();
+
         super.afterTest();
     }
 
@@ -92,6 +104,18 @@ public class HadoopClientProtocolMultipleServersSelfTest extends HadoopAbstractS
     }
 
     /**
+     *
+     */
+    private void clearClients() {
+        ConcurrentHashMap<String, IgniteInternalFuture<GridClient>> cliMap = GridTestUtils.getFieldValue(
+            IgniteHadoopClientProtocolProvider.class,
+            IgniteHadoopClientProtocolProvider.class,
+            "cliMap");
+
+        cliMap.clear();
+    }
+
+    /**
      * @throws Exception If failed.
      */
     private void beforeJob() throws Exception {