ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [10/21] incubator-ignite git commit: #ignite-961: fix qry tests.
Date Mon, 20 Jul 2015 11:39:20 GMT
#ignite-961: fix qry 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/f8516dcf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f8516dcf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f8516dcf

Branch: refs/heads/ignite-1121
Commit: f8516dcf3adf96d3b6d85d1924c830cf98039f06
Parents: f7bb17c
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Jul 17 17:41:09 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Jul 17 17:41:09 2015 +0300

----------------------------------------------------------------------
 .../JettyRestProcessorAbstractSelfTest.java     | 23 ++++++++++----------
 .../rendezvous/RendezvousAffinityFunction.java  |  4 ++++
 .../affinity/GridAffinityAssignmentCache.java   |  8 +++++++
 3 files changed, 23 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8516dcf/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index 09c0e13..9aab6f5 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.processors.rest.handlers.*;
 import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.testframework.*;
 
 import java.io.*;
@@ -50,6 +51,8 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
         System.setProperty(IGNITE_JETTY_PORT, Integer.toString(restPort()));
 
         super.beforeTestsStarted();
+
+        initCache();
     }
 
     /** {@inheritDoc} */
@@ -1256,13 +1259,13 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
         assertNotNull(ignite);
 
         String f = "function(expName){"+
-            "if (expName.toString() !== ignite.name().toString()) {" +
-            "throw \"Not correct name.\"" +
+            "if (expName !== \"hello\") {" +
+            "throw \"Not correct arg.\"" +
             "}" +
             "return ignite.name();}";
 
         String ret = makePostRequest(F.asMap("cmd", "affrun", "func", URLEncoder.encode(f)),
-            "{\"arg\":\"" + ignite.name() + "\",\"key\":\"key0\"}");
+            "{\"arg\":\"" + "hello" + "\",\"key\":\"key0\"}");
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -1286,13 +1289,13 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
         assertNotNull(ignite);
 
         String f = "function(expName){"+
-            "if (expName != ignite.name()) {" +
-            "throw \"Not correct name.\"" +
+            "if (expName !== \"hello\") {" +
+            "throw \"Not correct arg.\"" +
             "}" +
             "return ignite.name();}";
 
         String ret = content(F.asMap("cmd", "affrun", "func", URLEncoder.encode(f),
-            "key", "key0", "arg", ignite.name()));
+            "key", "key0", "arg", "hello"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -1390,14 +1393,14 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
         Integer qryId0 = (Integer)((Map)json.get("response")).get("queryId");
 
         assertEquals(qryId0, qryId);
+
+        ret = content(F.asMap("cmd", "qryclose", "qryId", String.valueOf(qryId)));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testQueryArgsPost() throws Exception {
-        initCache();
-
         String qry = "salary > ? and salary <= ?";
 
         String ret = makePostRequest(F.asMap("cmd", "qryexecute", "type", "Person", "psz",
"10", "cacheName", "person",
@@ -1429,8 +1432,6 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
      * @throws Exception If failed.
      */
     public void testQueryArgs() throws Exception {
-        initCache();
-
         String qry = "salary > ? and salary <= ?";
 
         Map<String, String> params = new HashMap<>();
@@ -1469,8 +1470,6 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
      * @throws Exception If failed.
      */
     public void testQueryClose() throws Exception {
-        initCache();
-
         String qry = "salary > ? and salary <= ?";
 
         String ret = makePostRequest(F.asMap("cmd", "qryexecute", "type", "Person", "psz",
"1", "cacheName", "person",

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8516dcf/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
index 2b26630..81472f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
@@ -290,6 +290,10 @@ public class RendezvousAffinityFunction implements AffinityFunction,
Externaliza
             try {
                 ByteArrayOutputStream out = new ByteArrayOutputStream();
 
+                if (ignite == null)
+                    System.out.println("IGNITE IS NULL!!!");
+
+
                 byte[] nodeHashBytes = ignite.configuration().getMarshaller().marshal(nodeHash);
 
                 out.write(U.intToBytes(part), 0, 4); // Avoid IOException.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8516dcf/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index d40128c..281c153 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
 import org.jsr166.*;
 
@@ -185,6 +186,13 @@ public class GridAffinityAssignmentCache {
             Collections.sort(sorted, GridNodeOrderComparator.INSTANCE);
         }
 
+        /*try {
+            ctx.grid().context().resource().injectGeneric(aff);
+        }
+        catch (IgniteCheckedException e) {
+            U.convertException(e);
+        }*/
+
         List<List<ClusterNode>> prevAssignment = prev == null ? null : prev.assignment();
 
         List<List<ClusterNode>> assignment;


Mime
View raw message