ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: #ignite-237: remove consistent hash from IgniteCacheAffinitySelfTest.
Date Thu, 26 Feb 2015 12:53:49 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-237 fecb680da -> df3c76e4a


#ignite-237: remove consistent hash from IgniteCacheAffinitySelfTest.


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

Branch: refs/heads/ignite-237
Commit: df3c76e4a353c599832a105ce0fc22f73104edf1
Parents: fecb680
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu Feb 26 15:53:43 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Thu Feb 26 15:53:43 2015 +0300

----------------------------------------------------------------------
 .../ignite/IgniteCacheAffinitySelfTest.java     | 30 +++++++-------------
 1 file changed, 11 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/df3c76e4/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
index 7186ae1..c3e76a6 100644
--- a/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
 import org.apache.ignite.cache.affinity.fair.*;
 import org.apache.ignite.cache.affinity.rendezvous.*;
 import org.apache.ignite.cluster.*;
@@ -40,13 +39,10 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest
{
     private int GRID_COUNT = 3;
 
     /** Cache name */
-    private final String CACHE1 = "ConsistentHash";
+    private final String CACHE1 = "Fair";
 
     /** Cache name */
-    private final String CACHE2 = "Fair";
-
-    /** Cache name */
-    private final String CACHE3 = "Rendezvous";
+    private final String CACHE2 = "Rendezvous";
 
     /** {@inheritDoc} */
     @Override protected int gridCount() {
@@ -61,20 +57,16 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest
{
 
         CacheConfiguration cache1 = cacheConfiguration(null);
         cache1.setName(CACHE1);
-        cache1.setAffinity(new CacheConsistentHashAffinityFunction());
+        cache1.setAffinity(new CachePartitionFairAffinity());
 
         CacheConfiguration cache2 = cacheConfiguration(null);
         cache2.setName(CACHE2);
-        cache2.setAffinity(new CachePartitionFairAffinity());
-
-        CacheConfiguration cache3 = cacheConfiguration(null);
-        cache3.setName(CACHE3);
-        cache3.setAffinity(new CacheRendezvousAffinityFunction());
+        cache2.setAffinity(new CacheRendezvousAffinityFunction());
 
         if (gridName.contains("0"))
             cfg.setCacheConfiguration(cache0);
         else
-            cfg.setCacheConfiguration(cache0, cache1, cache2, cache3);
+            cfg.setCacheConfiguration(cache0, cache1, cache2);
 
         return cfg;
     }
@@ -116,8 +108,8 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest
{
     private void checkAffinity() {
         checkAffinity(grid(0).affinity(null), cache(1, null).affinity());
         checkAffinity(grid(0).affinity(CACHE1), cache(1, CACHE1).affinity());
+        checkAffinity(grid(0).affinity(CACHE1), cache(1, CACHE1).affinity());
         checkAffinity(grid(0).affinity(CACHE2), cache(1, CACHE2).affinity());
-        checkAffinity(grid(0).affinity(CACHE3), cache(1, CACHE3).affinity());
     }
 
     /**
@@ -226,13 +218,13 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest
{
 
         Collection<Integer> col1 = new HashSet<>();
 
-        for (int i = 0; i < arr1.length; ++i)
-            col1.add(arr1[i]);
+        for (int anArr1 : arr1)
+            col1.add(anArr1);
 
-        for (int i = 0; i < arr2.length; ++i) {
-            assertTrue(col1.contains(arr2[i]));
+        for (int anArr2 : arr2) {
+            assertTrue(col1.contains(anArr2));
 
-            col1.remove(arr2[i]);
+            col1.remove(anArr2);
         }
 
         assertEquals(0, col1.size());


Mime
View raw message