ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [02/50] incubator-ignite git commit: #ignite-237: Change tests to new affinity API.
Date Tue, 03 Mar 2015 12:57:38 GMT
#ignite-237: Change tests to new affinity API.


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

Branch: refs/heads/ignite-349
Commit: 399d2b9e803cb90825f2d5eced3252c65a407fa6
Parents: 50db6ef
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu Feb 26 15:16:52 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Thu Feb 26 15:16:52 2015 +0300

----------------------------------------------------------------------
 .../near/GridCachePartitionedFullApiSelfTest.java        |  6 +++---
 .../org/apache/ignite/testframework/GridTestUtils.java   | 11 +----------
 2 files changed, 4 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/399d2b9e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
index cfdc105..771650e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.internal.processors.cache.distributed.near;
 
 import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.rendezvous.*;
+import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
@@ -68,9 +68,9 @@ public class GridCachePartitionedFullApiSelfTest extends GridCacheAbstractFullAp
             cache.put(key, i);
         }
 
-        CacheRendezvousAffinityFunction aff = (CacheRendezvousAffinityFunction)cache.configuration().getAffinity();
+        CacheAffinity aff = grid(0).affinity(cache.name());
 
-        for (int i = 0 ; i < aff.getPartitions(); i++)
+        for (int i = 0 ; i < aff.partitions(); i++)
             String.valueOf(cache.entrySet(i));
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/399d2b9e/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
index 6841345..0449e48 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
@@ -20,7 +20,6 @@ package org.apache.ignite.testframework;
 import junit.framework.*;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.rendezvous.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.client.ssl.*;
@@ -876,14 +875,6 @@ public final class GridTestUtils {
     }
 
     /**
-     * @param cache Cache.
-     * @return Affinity.
-     */
-    static <K, V> CacheRendezvousAffinityFunction affinity(GridCache<K, V> cache)
{
-        return (CacheRendezvousAffinityFunction)cache.cache().configuration().getAffinity();
-    }
-
-    /**
      * @param cacheName Cache name.
      * @param backups Number of backups.
      * @param log Logger.
@@ -900,7 +891,7 @@ public final class GridTestUtils {
             while (true) {
                 boolean wait = false;
 
-                for (int p = 0; p < affinity(cache).partitions(); p++) {
+                for (int p = 0; p < g.affinity(cacheName).partitions(); p++) {
                     Collection<ClusterNode> nodes = top.nodes(p, -1);
 
                     if (nodes.size() > backups + 1) {


Mime
View raw message