ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [28/50] incubator-ignite git commit: #ignite-237: remove test validating that client partitioned affinity and cache partitioned affinity produce the same result
Date Tue, 03 Mar 2015 08:54:58 GMT
#ignite-237: remove test validating that client partitioned affinity and cache partitioned
affinity produce the same result


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

Branch: refs/heads/sprint-2
Commit: 4d54c502fcc48896fd2e4321f18ffa6ad1611656
Parents: 120711b
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Feb 27 12:53:00 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Feb 27 12:53:00 2015 +0300

----------------------------------------------------------------------
 .../impl/ClientPartitionAffinitySelfTest.java   | 66 --------------------
 1 file changed, 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4d54c502/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
index 444a84c..dde345e 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
@@ -267,45 +267,6 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * Validate client partitioned affinity and cache partitioned affinity produce the same
result.
-     *
-     * @throws Exception On any exception.
-     */
-    public void testReplicas() throws Exception {
-        // Emulate nodes in topology.
-        Collection<GridClientNode> nodes = new ArrayList<>();
-        Collection<ClusterNode> srvNodes = new ArrayList<>();
-
-        // Define affinities to test.
-        GridClientPartitionAffinity aff = new GridClientPartitionAffinity();
-
-        getTestResources().inject(aff);
-
-        aff.setHashIdResolver(HASH_ID_RSLVR);
-
-        CacheRendezvousAffinityFunction srvAff = new CacheRendezvousAffinityFunction();
-
-        getTestResources().inject(srvAff);
-
-        srvAff.setHashIdResolver(new CacheAffinityNodeIdHashResolver());
-
-        // Define keys to test affinity for.
-        Collection<String> keys = new ArrayList<>(
-            Arrays.asList("", "1", "12", "asdf", "Hadoop\u3092\u6bba\u3059"));
-
-        for (int i = 0; i < 10; i++)
-            keys.add(UUID.randomUUID().toString());
-
-        // Test affinity behaviour on different topologies.
-        for (int i = 0; i < 20; i++) {
-            addNodes(1 + (int)Math.round(Math.random() * 50), nodes, srvNodes);
-
-            for (String key : keys)
-                assertSameAffinity(key, aff, srvAff, nodes, srvNodes);
-        }
-    }
-
-    /**
      * Add {@code cnt} nodes into emulated topology.
      *
      * @param cnt Number of nodes to add into emulated topology.
@@ -329,33 +290,6 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * Compare server and client affinity for specified key in current topology.
-     *
-     * @param key Key to validate affinity for.
-     * @param aff Client affinity.
-     * @param srvAff Server affinity.
-     * @param nodes Client topology.
-     * @param srvNodes Server topology.
-     */
-    private void assertSameAffinity(Object key, GridClientDataAffinity aff, CacheAffinityFunction
srvAff,
-        Collection<? extends GridClientNode> nodes, Collection<ClusterNode> srvNodes)
{
-        GridClientNode node = aff.node(key, nodes);
-        int part = srvAff.partition(key);
-
-        CacheAffinityFunctionContext ctx = new GridCacheAffinityFunctionContextImpl(new ArrayList<>(srvNodes),
-            null, null, 1, 0);
-
-        ClusterNode srvNode = F.first(srvAff.assignPartitions(ctx).get(part));
-
-        if (node == null)
-            assertNull(srvNode);
-        else {
-            assertNotNull(srvNode);
-            assertEquals(node.nodeId(), srvNode.id());
-        }
-    }
-
-    /**
      * Rich node stub to use in emulated server topology.
      */
     private static class TestRichNode extends GridTestNode {


Mime
View raw message