ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [06/53] [abbrv] incubator-ignite git commit: # IGNITE-943 Fix tests.
Date Mon, 01 Jun 2015 11:44:58 GMT
# IGNITE-943 Fix tests.


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

Branch: refs/heads/ignite-sprint-5
Commit: bf0e15750d30a05a4371b86ad2135a9b5fd233cb
Parents: 838c0fd
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Wed May 27 17:01:02 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed May 27 17:01:02 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/spi/discovery/tcp/ServerImpl.java  |  2 +-
 .../apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java | 11 +++++++++--
 .../spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java |  3 +--
 3 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf0e1575/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 7e1f592..46a89aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -78,7 +78,7 @@ class ServerImpl extends TcpDiscoveryImpl {
     private RingMessageWorker msgWorker;
 
     /** Client message workers. */
-    private ConcurrentMap<UUID, ClientMessageWorker> clientMsgWorkers = new ConcurrentHashMap8<>();
+    protected ConcurrentMap<UUID, ClientMessageWorker> clientMsgWorkers = new ConcurrentHashMap8<>();
 
     /** Metrics sender. */
     @SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized")

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf0e1575/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 2b2c691..922c496 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -1495,6 +1495,8 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi,
T
                 sockTimeout = DFLT_SOCK_TIMEOUT_CLIENT;
 
             impl = new ClientImpl(this);
+
+            ctxInitLatch.countDown();
         }
         else {
             if (ackTimeout == 0)
@@ -1506,8 +1508,6 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi,
T
             impl = new ServerImpl(this);
         }
 
-        startStopwatch();
-
         assertParameter(ipFinder != null, "ipFinder != null");
         assertParameter(hbFreq > 0, "heartbeatFreq > 0");
         assertParameter(netTimeout > 0, "networkTimeout > 0");
@@ -1636,6 +1636,13 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi,
T
     /**
      * <strong>FOR TEST ONLY!!!</strong>
      */
+    public int clientWorkerCount() {
+        return ((ServerImpl)impl).clientMsgWorkers.size();
+    }
+
+    /**
+     * <strong>FOR TEST ONLY!!!</strong>
+     */
     public void addSendMessageListener(IgniteInClosure<TcpDiscoveryAbstractMessage>
lsnr) {
         sendMsgLsnrs.add(lsnr);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bf0e1575/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 1655c33..f27ef33 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
@@ -25,7 +25,6 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.io.*;
 import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.*;
@@ -341,7 +340,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
 
         attachListeners(3, 3);
 
-        assert U.<Map>field(G.ignite("server-2").configuration().getDiscoverySpi(),
"clientMsgWorkers").isEmpty();
+        assert ((TcpDiscoverySpi)G.ignite("server-2").configuration().getDiscoverySpi()).clientWorkerCount()
== 0;
 
         failServer(2);
 


Mime
View raw message