ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [29/50] incubator-ignite git commit: #ignite-237: fix ClientAbstractMultiNodeSelfTest.
Date Tue, 03 Mar 2015 08:54:59 GMT
#ignite-237: fix ClientAbstractMultiNodeSelfTest.


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

Branch: refs/heads/sprint-2
Commit: 3bab015f3e7e086972b90998832d6003d05b7c1a
Parents: 4d54c50
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Feb 27 13:01:08 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Feb 27 13:01:08 2015 +0300

----------------------------------------------------------------------
 .../ClientAbstractMultiNodeSelfTest.java        | 49 +-------------------
 1 file changed, 1 insertion(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3bab015f/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
index 0eb6e16..e73f06d 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
@@ -408,47 +408,6 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract
         }
     }
 
-    /**
-     * @throws Exception If failed.
-     */
-    public void testClientAffinity() throws Exception {
-        GridClientData partitioned = client.data(PARTITIONED_CACHE_NAME);
-
-        Collection<Object> keys = new ArrayList<>();
-
-        keys.addAll(Arrays.asList(
-            Boolean.TRUE,
-            Boolean.FALSE,
-            1,
-            Integer.MAX_VALUE
-        ));
-
-        Random rnd = new Random();
-        StringBuilder sb = new StringBuilder();
-
-        // Generate some random strings.
-        for (int i = 0; i < 100; i++) {
-            sb.setLength(0);
-
-            for (int j = 0; j < 255; j++)
-                // Only printable ASCII symbols for test.
-                sb.append((char)(rnd.nextInt(0x7f - 0x20) + 0x20));
-
-            keys.add(sb.toString());
-        }
-
-        // Generate some more keys to achieve better coverage.
-        for (int i = 0; i < 100; i++)
-            keys.add(UUID.randomUUID());
-
-        for (Object key : keys) {
-            UUID nodeId = grid(0).cluster().mapKeyToNode(PARTITIONED_CACHE_NAME, key).id();
-
-            UUID clientNodeId = partitioned.affinity(key);
-
-            assertEquals("Invalid affinity mapping for REST response for key: " + key, nodeId,
clientNodeId);
-        }
-    }
 
     /**
      * @throws Exception If failed.
@@ -585,18 +544,12 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract
 
             UUID primaryNodeId = grid(0).cluster().mapKeyToNode(PARTITIONED_CACHE_NAME, key).id();
 
-            assertEquals("Affinity mismatch for key: " + key, primaryNodeId, partitioned.affinity(key));
-
-            assertEquals(primaryNodeId, partitioned.affinity(key));
-
-            // Must go to primary node only. Since backup count is 0, value must present
on
-            // primary node only.
             partitioned.put(key, "val" + key);
 
             for (Map.Entry<UUID, Ignite> entry : gridsByLocNode.entrySet()) {
                 Object val = entry.getValue().jcache(PARTITIONED_CACHE_NAME).localPeek(key,
CachePeekMode.ONHEAP);
 
-                if (primaryNodeId.equals(entry.getKey()))
+                if (primaryNodeId.equals(entry.getKey()) || partitioned.affinity(key).equals(entry.getKey()))
                     assertEquals("val" + key, val);
                 else
                     assertNull(val);


Mime
View raw message