ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [18/50] [abbrv] ignite git commit: Fixed GridQueryCommandHandlerTest.testNullCache
Date Tue, 06 Jun 2017 08:59:36 GMT
Fixed GridQueryCommandHandlerTest.testNullCache


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

Branch: refs/heads/ignite-5075
Commit: 79ab48b876f2cd8c1b2fe18dea0492c9f2483694
Parents: 43ab98b
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Jun 2 17:14:15 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Jun 2 17:14:15 2017 +0300

----------------------------------------------------------------------
 .../processors/rest/handlers/query/QueryCommandHandler.java   | 7 ++++---
 .../rest/handlers/query/GridQueryCommandHandlerTest.java      | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/79ab48b8/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
index e7cc3dd..05ca3aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
@@ -315,12 +315,13 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter
{
                         throw new IgniteException("Incorrect query type [type=" + req.queryType()
+ "]");
                 }
 
-                IgniteCache<Object, Object> cache = ctx.grid().cache(
-                    req.cacheName() == null ? DFLT_CACHE_NAME : req.cacheName());
+                String cacheName = req.cacheName() == null ? DFLT_CACHE_NAME : req.cacheName();
+
+                IgniteCache<Object, Object> cache = ctx.grid().cache(cacheName);
 
                 if (cache == null)
                     return new GridRestResponse(GridRestResponse.STATUS_FAILED,
-                        "Failed to find cache with name: " + req.cacheName());
+                        "Failed to find cache with name: " + cacheName);
 
                 final QueryCursor qryCur = cache.query(qry);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/79ab48b8/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/query/GridQueryCommandHandlerTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/query/GridQueryCommandHandlerTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/query/GridQueryCommandHandlerTest.java
index 130899f..cffc7b9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/query/GridQueryCommandHandlerTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/query/GridQueryCommandHandlerTest.java
@@ -114,7 +114,8 @@ public class GridQueryCommandHandlerTest extends GridCommonAbstractTest
{
         IgniteInternalFuture<GridRestResponse> resp = cmdHnd.handleAsync(req);
         resp.get();
 
-        assertEquals("Ouch! Argument is invalid: Cache name must not be null or empty.",
resp.result().getError());
+        // If cache name is not set server uses name 'default'.
+        assertEquals("Failed to find cache with name: default", resp.result().getError());
         assertEquals(GridRestResponse.STATUS_FAILED, resp.result().getSuccessStatus());
         assertNull(resp.result().getResponse());
     }


Mime
View raw message