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-35 Fixed tests
Date Sat, 20 Dec 2014 11:26:16 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-35 858e87b56 -> 7f3ece4f6


IGNITE-35 Fixed tests


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

Branch: refs/heads/ignite-35
Commit: 7f3ece4f67b30a4491aa1748e659b5e5b2b3cb07
Parents: 858e87b
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Sat Dec 20 13:48:40 2014 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Sat Dec 20 14:20:15 2014 +0300

----------------------------------------------------------------------
 .../grid/p2p/GridP2PHotRedeploymentSelfTest.java    | 16 ++++++++--------
 .../java/org/gridgain/grid/p2p/GridP2PTestTask.java |  4 +++-
 .../testframework/junits/GridTestKernalContext.java |  4 +++-
 3 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f3ece4f/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PHotRedeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PHotRedeploymentSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PHotRedeploymentSelfTest.java
index 94471a1..4210222 100644
--- a/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PHotRedeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PHotRedeploymentSelfTest.java
@@ -60,26 +60,26 @@ public class GridP2PHotRedeploymentSelfTest extends GridCommonAbstractTest
{
 
             ClassLoader ldr = getExternalClassLoader();
 
-            Class<? extends ComputeTask<Object, int[]>> taskCls =
-                (Class<? extends ComputeTask<Object, int[]>>)ldr.loadClass(TASK_NAME);
+            Class<? extends ComputeTask<Object, Integer>> taskCls =
+                (Class<? extends ComputeTask<Object, Integer>>)ldr.loadClass(TASK_NAME);
 
-            int[] res1 = ignite1.compute().execute(taskCls, Collections.singletonList(ignite2.cluster().localNode().id()));
+            Integer res1 = ignite1.compute().
+                execute(taskCls, Collections.singletonList(ignite2.cluster().localNode().id()));
 
-            info("Result1: " + Arrays.toString(res1));
+            info("Result1: " + res1);
 
             assert res1 != null;
 
             ignite1.compute().localDeployTask(taskCls, taskCls.getClassLoader());
 
-            int[] res2 = (int[]) ignite1.compute().execute(taskCls.getName(),
+            Integer res2 = (Integer)ignite1.compute().execute(taskCls.getName(),
                 Collections.singletonList(ignite2.cluster().localNode().id()));
 
-            info("Result2: " + Arrays.toString(res2));
+            info("Result2: " + res2);
 
             assert res2 != null;
 
-            assert res1[0] == res2[0];
-            assert res1[1] == res2[1];
+            assert res1.equals(res2);
         }
         finally {
             stopGrid(2);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f3ece4f/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PTestTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PTestTask.java b/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PTestTask.java
index 2692eea..93730e0 100644
--- a/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PTestTask.java
+++ b/modules/core/src/test/java/org/gridgain/grid/p2p/GridP2PTestTask.java
@@ -49,8 +49,10 @@ public class GridP2PTestTask extends ComputeTaskAdapter<Object, Integer>
{
 
         Map<ComputeJob, ClusterNode> map = new HashMap<>(subgrid.size());
 
+        UUID nodeId = ignite != null ? ignite.configuration().getNodeId() : null;
+
         for (ClusterNode node : subgrid)
-            if (!node.id().equals(ignite.configuration().getNodeId()))
+            if (!node.id().equals(nodeId))
                 map.put(new GridP2PTestJob(arg1), node);
 
         return map;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f3ece4f/modules/core/src/test/java/org/gridgain/testframework/junits/GridTestKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testframework/junits/GridTestKernalContext.java
b/modules/core/src/test/java/org/gridgain/testframework/junits/GridTestKernalContext.java
index fa5e4ed..c5eceb3 100644
--- a/modules/core/src/test/java/org/gridgain/testframework/junits/GridTestKernalContext.java
+++ b/modules/core/src/test/java/org/gridgain/testframework/junits/GridTestKernalContext.java
@@ -11,9 +11,9 @@ package org.gridgain.testframework.junits;
 
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.kernal.*;
 import org.gridgain.grid.util.typedef.internal.*;
+import org.gridgain.testframework.*;
 
 import java.util.*;
 
@@ -31,6 +31,8 @@ public class GridTestKernalContext extends GridKernalContextImpl {
             new GridKernalGatewayImpl(null),
             null,
             false);
+
+        GridTestUtils.setFieldValue(grid(), "cfg", config());
     }
 
     /**


Mime
View raw message