ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject incubator-ignite git commit: IGNITE-701 - Fixed test.
Date Wed, 08 Apr 2015 17:44:58 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-701 ada2bdefe -> a3fe2e44a


IGNITE-701 - Fixed test.


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

Branch: refs/heads/ignite-701
Commit: a3fe2e44a66e19c1afd1a316a0bea0cbe170ef9f
Parents: ada2bde
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Wed Apr 8 10:44:54 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Wed Apr 8 10:44:54 2015 -0700

----------------------------------------------------------------------
 .../ignite/GridCacheAffinityBackupsSelfTest.java     | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3fe2e44/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
index 2a4655f..212eb23 100644
--- a/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite;
 
 import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cache.affinity.fair.*;
 import org.apache.ignite.cache.affinity.rendezvous.*;
 import org.apache.ignite.cluster.*;
@@ -35,7 +34,7 @@ public class GridCacheAffinityBackupsSelfTest extends GridCommonAbstractTest
{
     private int backups;
 
     /** Affinity function. */
-    private AffinityFunction func;
+    private int funcType;
 
     /** */
     private int nodesCnt = 5;
@@ -48,7 +47,7 @@ public class GridCacheAffinityBackupsSelfTest extends GridCommonAbstractTest
{
 
         ccfg.setCacheMode(CacheMode.PARTITIONED);
         ccfg.setBackups(backups);
-        ccfg.setAffinity(func);
+        ccfg.setAffinity(funcType == 0 ? new FairAffinityFunction() : new RendezvousAffinityFunction());
 
         cfg.setCacheConfiguration(ccfg);
 
@@ -60,7 +59,7 @@ public class GridCacheAffinityBackupsSelfTest extends GridCommonAbstractTest
{
      */
     public void testRendezvousBackups() throws Exception {
         for (int i = 0; i < nodesCnt; i++)
-            checkBackups(i, new RendezvousAffinityFunction());
+            checkBackups(i, 1);
     }
 
     /**
@@ -68,17 +67,17 @@ public class GridCacheAffinityBackupsSelfTest extends GridCommonAbstractTest
{
      */
     public void testFairBackups() throws Exception {
         for (int i = 0; i < nodesCnt; i++)
-            checkBackups(i, new FairAffinityFunction());
+            checkBackups(i, 0);
     }
 
     /**
      * @param backups Number of backups.
-     * @param func Affinity function.
+     * @param funcType Affinity function type.
      * @throws Exception If failed.
      */
-    private void checkBackups(int backups, AffinityFunction func) throws Exception {
+    private void checkBackups(int backups, int funcType) throws Exception {
         this.backups = backups;
-        this.func = func;
+        this.funcType = funcType;
 
         startGrids(nodesCnt);
 


Mime
View raw message