ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [14/51] [abbrv] ignite git commit: IGNITE-2523: Fixing tests.
Date Thu, 25 Feb 2016 12:31:13 GMT
IGNITE-2523: Fixing tests.


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

Branch: refs/heads/ignite-2523
Commit: e83408060970aba8f3f98ec7be1d96bab4fa888c
Parents: c54873b
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Feb 4 12:05:56 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Feb 4 12:05:56 2016 +0300

----------------------------------------------------------------------
 ...niteCacheClientNodeChangingTopologyTest.java | 29 ++++++++++++++++----
 1 file changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e8340806/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
index 18ff8df..8182b33 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java
@@ -108,6 +108,7 @@ import static org.apache.ignite.transactions.TransactionIsolation.SERIALIZABLE;
 /**
  *
  */
+@SuppressWarnings({"unchecked", "unused", "NullArgumentToVariableArgMethod", "ConstantConditions",
"UnusedAssignment"})
 public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstractTest {
     /** */
     protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
@@ -374,8 +375,7 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
         spi.blockMessages(GridNearAtomicUpdateRequest.class, ignite2.localNode().id());
         spi.blockMessages(GridNearAtomicSingleUpdateRequest.class, ignite2.localNode().id());
 
-        spi.record(GridNearAtomicUpdateRequest.class);
-        spi.record(GridNearAtomicSingleUpdateRequest.class);
+        spi.record(GridNearAtomicUpdateRequest.class, GridNearAtomicSingleUpdateRequest.class);
 
         final IgniteCache<Integer, Integer> cache = ignite3.cache(null);
 
@@ -2019,7 +2019,7 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
         private Map<Class<?>, Set<UUID>> blockCls = new HashMap<>();
 
         /** */
-        private Class<?> recordCls;
+        private Class<?>[] recordClss;
 
         /** */
         private List<Object> recordedMsgs = new ArrayList<>();
@@ -2031,7 +2031,7 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
                 Object msg0 = ((GridIoMessage)msg).message();
 
                 synchronized (this) {
-                    if (recordCls != null && msg0.getClass().equals(recordCls))
+                    if (isRecordMessage(msg0.getClass()))
                         recordedMsgs.add(msg0);
 
                     Set<UUID> blockNodes = blockCls.get(msg0.getClass());
@@ -2053,9 +2053,9 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
         /**
          * @param recordCls Message class to record.
          */
-        void record(@Nullable Class<?> recordCls) {
+        void record(@Nullable Class... recordCls) {
             synchronized (this) {
-                this.recordCls = recordCls;
+                this.recordClss = recordCls;
             }
         }
 
@@ -2109,6 +2109,23 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac
                 blockedMsgs.clear();
             }
         }
+
+        /**
+         * Decide whether to record message or not.
+         *
+         * @param msgCls Message class.
+         * @return {@code True} if message should be recorded.
+         */
+        private boolean isRecordMessage(Class msgCls) {
+            if (recordClss != null) {
+                for (Class recordCls : recordClss) {
+                    if (msgCls.equals(recordCls))
+                        return true;
+                }
+            }
+
+            return false;
+        }
     }
 
     /**


Mime
View raw message