ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivasilin...@apache.org
Subject incubator-ignite git commit: #ignite-961: Change commands.
Date Thu, 23 Jul 2015 15:03:01 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-961-master fb4f38d3a -> dde9a4d38


#ignite-961: Change commands.


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

Branch: refs/heads/ignite-961-master
Commit: dde9a4d3879fb78d5a9596c503fa6408df8dcf38
Parents: fb4f38d
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu Jul 23 18:02:55 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Thu Jul 23 18:02:55 2015 +0300

----------------------------------------------------------------------
 .../JettyRestProcessorAbstractSelfTest.java     | 137 +++++++++++--------
 .../processors/rest/GridRestCommand.java        |  28 ++--
 2 files changed, 97 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dde9a4d3/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 55d60d2..160046c 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
@@ -248,7 +248,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testGet() throws Exception {
         jcache().put("getKey", "getVal");
 
-        String ret = content(F.asMap("cmd", "get", "key", "getKey"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_GET.key(), "key", "getKey"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -266,7 +266,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("getKey", "getVal");
 
-        String ret = content(F.asMap("cmd", "cachesize"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_SIZE.key()));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -280,7 +280,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testIgniteName() throws Exception {
-        String ret = content(F.asMap("cmd", "name"));
+        String ret = content(F.asMap("cmd", GridRestCommand.NAME.key()));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -294,7 +294,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testGetOrCreateCache() throws Exception {
-        String ret = content(F.asMap("cmd", "getorcreatecache", "cacheName", "testCache"));
+        String ret = content(F.asMap("cmd", GridRestCommand.GET_OR_CREATE_CACHE.key(), "cacheName",
"testCache"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -303,7 +303,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         grid(0).cache("testCache").put("1", "1");
 
-        ret = content(F.asMap("cmd", "destroycache", "cacheName", "testCache"));
+        ret = content(F.asMap("cmd", GridRestCommand.DESTROY_CACHE.key(), "cacheName", "testCache"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -318,7 +318,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         jcache().put("getKey1", "getVal1");
         jcache().put("getKey2", "getVal2");
 
-        String ret = content(F.asMap("cmd", "getall", "k1", "getKey1", "k2", "getKey2"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_GET_ALL.key(), "k1", "getKey1",
"k2", "getKey2"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -335,7 +335,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testIncorrectPut() throws Exception {
-        String ret = content(F.asMap("cmd", "put", "key", "key0"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_PUT.key(), "key", "key0"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -348,7 +348,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testContainsKey() throws Exception {
         grid(0).cache(null).put("key0", "val0");
 
-        String ret = content(F.asMap("cmd", "containskey", "key", "key0"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_CONTAINS_KEY.key(), "key",
"key0"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -363,7 +363,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         grid(0).cache(null).put("key0", "val0");
         grid(0).cache(null).put("key1", "val1");
 
-        String ret = content(F.asMap("cmd", "containskeys", "k1", "key0", "k2", "key1"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_CONTAINS_KEYS.key(),
+            "k1", "key0", "k2", "key1"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -377,7 +378,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testGetAndPut() throws Exception {
         grid(0).cache(null).put("key0", "val0");
 
-        String ret = content(F.asMap("cmd", "getandput", "key", "key0", "val", "val1"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_GET_AND_PUT.key(), "key",
"key0", "val", "val1"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -393,7 +394,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testGetAndPutIfAbsent() throws Exception {
         grid(0).cache(null).put("key0", "val0");
 
-        String ret = content(F.asMap("cmd", "getandputifabsent", "key", "key0", "val", "val1"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_GET_AND_PUT_IF_ABSENT.key(),
+            "key", "key0", "val", "val1"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -407,7 +409,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testPutIfAbsent2() throws Exception {
-        String ret = content(F.asMap("cmd", "putifabsent", "key", "key0", "val", "val1"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_PUT_IF_ABSENT.key(),
+            "key", "key0", "val", "val1"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -423,7 +426,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testRemoveValue() throws Exception {
         grid(0).cache(null).put("key0", "val0");
 
-        String ret = content(F.asMap("cmd", "rmvvalue", "key", "key0", "val", "val1"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_REMOVE_VALUE.key(),
+            "key", "key0", "val", "val1"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -432,7 +436,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("val0", grid(0).cache(null).get("key0"));
 
-        ret = content(F.asMap("cmd", "rmvvalue", "key", "key0", "val", "val0"));
+        ret = content(F.asMap("cmd", GridRestCommand.CACHE_REMOVE_VALUE.key(),
+            "key", "key0", "val", "val0"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -448,7 +453,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testGetAndRemove() throws Exception {
         grid(0).cache(null).put("key0", "val0");
 
-        String ret = content(F.asMap("cmd", "getandrmv", "key", "key0"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_GET_AND_REMOVE.key(),
+            "key", "key0"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -464,7 +470,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testReplaceValue() throws Exception {
         grid(0).cache(null).put("key0", "val0");
 
-        String ret = content(F.asMap("cmd", "repval", "key", "key0", "val", "val1", "val2",
"val2"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_REPLACE_VALUE.key(),
+            "key", "key0", "val", "val1", "val2", "val2"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -473,7 +480,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("val0", grid(0).cache(null).get("key0"));
 
-        ret = content(F.asMap("cmd", "repval", "key", "key0", "val", "val1", "val2", "val0"));
+        ret = content(F.asMap("cmd", GridRestCommand.CACHE_REPLACE_VALUE.key(),
+            "key", "key0", "val", "val1", "val2", "val0"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -489,7 +497,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testGetAndReplace() throws Exception {
         grid(0).cache(null).put("key0", "val0");
 
-        String ret = content(F.asMap("cmd", "getandreplace", "key", "key0", "val", "val1"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_GET_AND_REPLACE.key(),
+            "key", "key0", "val", "val1"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -503,7 +512,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testPut() throws Exception {
-        String ret = content(F.asMap("cmd", "put", "key", "putKey", "val", "putVal"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_PUT.key(),
+            "key", "putKey", "val", "putVal"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -519,7 +529,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testPutWithExpiration() throws Exception {
-        String ret = content(F.asMap("cmd", "put", "key", "putKey", "val", "putVal", "exp",
"2000"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_PUT.key(),
+            "key", "putKey", "val", "putVal", "exp", "2000"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -539,7 +550,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testAdd() throws Exception {
         jcache().put("addKey1", "addVal1");
 
-        String ret = content(F.asMap("cmd", "add", "key", "addKey2", "val", "addVal2"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_ADD.key(),
+            "key", "addKey2", "val", "addVal2"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -554,7 +566,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testAddWithExpiration() throws Exception {
-        String ret = content(F.asMap("cmd", "add", "key", "addKey", "val", "addVal", "exp",
"2000"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_ADD.key(),
+            "key", "addKey", "val", "addVal", "exp", "2000"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -572,7 +585,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testPutAll() throws Exception {
-        String ret = content(F.asMap("cmd", "putall", "k1", "putKey1", "k2", "putKey2",
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_PUT_ALL.key(),
+            "k1", "putKey1", "k2", "putKey2",
             "v1", "putVal1", "v2", "putVal2"));
 
         assertNotNull(ret);
@@ -594,7 +608,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("rmvVal", jcache().localPeek("rmvKey", CachePeekMode.ONHEAP));
 
-        String ret = content(F.asMap("cmd", "rmv", "key", "rmvKey"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_REMOVE.key(),
+            "key", "rmvKey"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -620,7 +635,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertEquals("rmvVal3", jcache().localPeek("rmvKey3", CachePeekMode.ONHEAP));
         assertEquals("rmvVal4", jcache().localPeek("rmvKey4", CachePeekMode.ONHEAP));
 
-        String ret = content(F.asMap("cmd", "rmvall", "k1", "rmvKey1", "k2", "rmvKey2"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_REMOVE_ALL.key(),
+            "k1", "rmvKey1", "k2", "rmvKey2"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -658,7 +674,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("casOldVal", jcache().localPeek("casKey", CachePeekMode.ONHEAP));
 
-        String ret = content(F.asMap("cmd", "cas", "key", "casKey", "val2", "casOldVal",
"val1", "casNewVal"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_CAS.key(),
+            "key", "casKey", "val2", "casOldVal", "val1", "casNewVal"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -680,7 +697,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("repOldVal", jcache().localPeek("repKey", CachePeekMode.ONHEAP));
 
-        String ret = content(F.asMap("cmd", "rep", "key", "repKey", "val", "repVal"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_REPLACE.key(),
+            "key", "repKey", "val", "repVal"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -700,7 +718,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("replaceVal", jcache().get("replaceKey"));
 
-        String ret = content(F.asMap("cmd", "rep", "key", "replaceKey", "val", "replaceValNew",
"exp", "2000"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_REPLACE.key(),
+            "key", "replaceKey", "val", "replaceValNew", "exp", "2000"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -721,7 +740,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testAppend() throws Exception {
         jcache().put("appendKey", "appendVal");
 
-        String ret = content(F.asMap("cmd", "append", "key", "appendKey", "val", "_suffix"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_APPEND.key(),
+            "key", "appendKey", "val", "_suffix"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -737,7 +757,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testPrepend() throws Exception {
         jcache().put("prependKey", "prependVal");
 
-        String ret = content(F.asMap("cmd", "prepend", "key", "prependKey", "val", "prefix_"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_PREPEND.key(),
+            "key", "prependKey", "val", "prefix_"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -751,7 +772,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testIncrement() throws Exception {
-        String ret = content(F.asMap("cmd", "incr", "key", "incrKey", "init", "2", "delta",
"3"));
+        String ret = content(F.asMap("cmd", GridRestCommand.ATOMIC_INCREMENT.key(),
+            "key", "incrKey", "init", "2", "delta", "3"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -760,7 +782,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals(5, grid(0).atomicLong("incrKey", 0, true).get());
 
-        ret = content(F.asMap("cmd", "incr", "key", "incrKey", "delta", "10"));
+        ret = content(F.asMap("cmd", GridRestCommand.ATOMIC_INCREMENT.key(), "key", "incrKey",
"delta", "10"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -774,7 +796,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testDecrement() throws Exception {
-        String ret = content(F.asMap("cmd", "decr", "key", "decrKey", "init", "15", "delta",
"10"));
+        String ret = content(F.asMap("cmd", GridRestCommand.ATOMIC_DECREMENT.key(),
+            "key", "decrKey", "init", "15", "delta", "10"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -783,7 +806,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals(5, grid(0).atomicLong("decrKey", 0, true).get());
 
-        ret = content(F.asMap("cmd", "decr", "key", "decrKey", "delta", "3"));
+        ret = content(F.asMap("cmd", GridRestCommand.ATOMIC_DECREMENT.key(),
+            "key", "decrKey", "delta", "3"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -801,7 +825,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("casOldVal", jcache().localPeek("casKey", CachePeekMode.ONHEAP));
 
-        String ret = content(F.asMap("cmd", "cas", "key", "casKey", "val2", "casOldVal"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_CAS.key(),
+            "key", "casKey", "val2", "casOldVal"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -819,7 +844,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testPutIfAbsent() throws Exception {
         assertNull(jcache().localPeek("casKey", CachePeekMode.ONHEAP));
 
-        String ret = content(F.asMap("cmd", "cas", "key", "casKey", "val1", "casNewVal"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_CAS.key(),
+            "key", "casKey", "val1", "casNewVal"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -839,7 +865,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("casVal", jcache().localPeek("casKey", CachePeekMode.ONHEAP));
 
-        String ret = content(F.asMap("cmd", "cas", "key", "casKey"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_CAS.key(), "key", "casKey"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -855,7 +881,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testMetrics() throws Exception {
-        String ret = content(F.asMap("cmd", "cache"));
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_METRICS.key()));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -869,7 +895,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testTopology() throws Exception {
-        String ret = content(F.asMap("cmd", "top", "attr", "false", "mtr", "false"));
+        String ret = content(F.asMap("cmd", GridRestCommand.TOPOLOGY.key(), "attr", "false",
"mtr", "false"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -883,7 +909,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testNode() throws Exception {
-        String ret = content(F.asMap("cmd", "node", "attr", "true", "mtr", "true", "id",
+        String ret = content(F.asMap("cmd", GridRestCommand.NODE.key(), "attr", "true", "mtr",
"true", "id",
             grid(0).localNode().id().toString()));
 
         assertNotNull(ret);
@@ -893,7 +919,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jsonEquals(ret, pattern("\\{.+\\}", true));
 
-        ret = content(F.asMap("cmd", "node", "attr", "false", "mtr", "false", "ip", LOC_HOST));
+        ret = content(F.asMap("cmd", GridRestCommand.NODE.key(), "attr", "false", "mtr",
"false", "ip", LOC_HOST));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -902,7 +928,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jsonEquals(ret, pattern("\\{.+\\}", true));
 
-        ret = content(F.asMap("cmd", "node", "attr", "false", "mtr", "false", "ip", LOC_HOST,
"id",
+        ret = content(F.asMap("cmd", GridRestCommand.NODE.key(), "attr", "false", "mtr",
"false", "ip", LOC_HOST, "id",
             UUID.randomUUID().toString()));
 
         assertNotNull(ret);
@@ -921,7 +947,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testExe() throws Exception {
-        String ret = content(F.asMap("cmd", "exe"));
+        String ret = content(F.asMap("cmd", GridRestCommand.EXE.key()));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -931,7 +957,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         jsonEquals(ret, pattern("null", false));
 
         // Attempt to execute unknown task (UNKNOWN_TASK) will result in exception on server.
-        ret = content(F.asMap("cmd", "exe", "name", "UNKNOWN_TASK"));
+        ret = content(F.asMap("cmd", GridRestCommand.EXE.key(), "name", "UNKNOWN_TASK"));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -943,7 +969,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         grid(0).compute().localDeployTask(TestTask1.class, TestTask1.class.getClassLoader());
         grid(0).compute().localDeployTask(TestTask2.class, TestTask2.class.getClassLoader());
 
-        ret = content(F.asMap("cmd", "exe", "name", TestTask1.class.getName()));
+        ret = content(F.asMap("cmd", GridRestCommand.EXE.key(), "name", TestTask1.class.getName()));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -952,7 +978,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jsonEquals(ret, pattern("\\{.+\\}", true));
 
-        ret = content(F.asMap("cmd", "exe", "name", TestTask2.class.getName()));
+        ret = content(F.asMap("cmd", GridRestCommand.EXE.key(), "name", TestTask2.class.getName()));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -961,7 +987,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jsonEquals(ret, pattern("\\{.+" + TestTask2.RES + ".+\\}", true));
 
-        ret = content(F.asMap("cmd", "res"));
+        ret = content(F.asMap("cmd", GridRestCommand.RESULT.key()));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());
@@ -990,7 +1016,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         String qry = "salary > ? and salary <= ?";
 
         Map<String, String> params = new HashMap<>();
-        params.put("cmd", "qryexecute");
+        params.put("cmd", GridRestCommand.EXECUTE_SQL_QUERY.key());
         params.put("type", "Person");
         params.put("psz", "10");
         params.put("cacheName", "person");
@@ -1021,7 +1047,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         grid(0).cache(null).put("3", "3");
 
         Map<String, String> params = new HashMap<>();
-        params.put("cmd", "qryexecute");
+        params.put("cmd", GridRestCommand.EXECUTE_SQL_QUERY.key());
         params.put("type", "String");
         params.put("psz", "1");
         params.put("qry", URLEncoder.encode("select * from String"));
@@ -1037,7 +1063,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertNotNull(qryId);
 
-        ret = content(F.asMap("cmd", "qryfetch", "psz", "1", "qryId", String.valueOf(qryId)));
+        ret = content(F.asMap("cmd", GridRestCommand.FETCH_SQL_QUERY.key(),
+            "psz", "1", "qryId", String.valueOf(qryId)));
 
         json = JSONObject.fromObject(ret);
 
@@ -1048,7 +1075,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertEquals(qryId0, qryId);
         assertFalse(last);
 
-        ret = content(F.asMap("cmd", "qryfetch", "psz", "1", "qryId", String.valueOf(qryId)));
+        ret = content(F.asMap("cmd", GridRestCommand.FETCH_SQL_QUERY.key(),
+            "psz", "1", "qryId", String.valueOf(qryId)));
 
         json = JSONObject.fromObject(ret);
 
@@ -1069,7 +1097,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         String qry = "select concat(firstName, ' ', lastName) from Person";
 
         Map<String, String> params = new HashMap<>();
-        params.put("cmd", "qryfieldsexecute");
+        params.put("cmd", GridRestCommand.EXECUTE_SQL_FIELDS_QUERY.key());
         params.put("psz", "10");
         params.put("cacheName", "person");
         params.put("qry", URLEncoder.encode(qry));
@@ -1095,7 +1123,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         String qry = "salary > ? and salary <= ?";
 
         Map<String, String> params = new HashMap<>();
-        params.put("cmd", "qryexecute");
+        params.put("cmd", GridRestCommand.EXECUTE_SQL_QUERY.key());
         params.put("type", "Person");
         params.put("psz", "1");
         params.put("cacheName", "person");
@@ -1120,7 +1148,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertNotNull(qryId);
 
-        ret = content(F.asMap("cmd", "qryclose", "cacheName", "person", "qryId", String.valueOf(qryId)));
+        ret = content(F.asMap("cmd", GridRestCommand.CLOSE_SQL_QUERY.key(),
+            "cacheName", "person", "qryId", String.valueOf(qryId)));
 
         assertNotNull(ret);
         assertTrue(!ret.isEmpty());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dde9a4d3/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestCommand.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestCommand.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestCommand.java
index ab8929f..76a33b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestCommand.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestCommand.java
@@ -34,25 +34,25 @@ public enum GridRestCommand {
     CACHE_GET("get"),
 
     /** Contains cached value. */
-    CACHE_CONTAINS_KEY("containskey"),
+    CACHE_CONTAINS_KEY("conkey"),
 
     /** Contains cached values. */
-    CACHE_CONTAINS_KEYS("containskeys"),
+    CACHE_CONTAINS_KEYS("conkeys"),
 
     /** Get several cached values. */
     CACHE_GET_ALL("getall"),
 
     /** Store value in cache and return previous value. */
-    CACHE_GET_AND_PUT("getandput"),
+    CACHE_GET_AND_PUT("getput"),
 
     /** Store value in cache and return previous value. */
-    CACHE_GET_AND_PUT_IF_ABSENT("getandputifabsent"),
+    CACHE_GET_AND_PUT_IF_ABSENT("getputifabs"),
 
     /** Store value in cache. */
     CACHE_PUT("put"),
 
     /** Store value in cache. */
-    CACHE_PUT_IF_ABSENT("putifabsent"),
+    CACHE_PUT_IF_ABSENT("putifabs"),
 
     /** Store value in cache if it doesn't exist. */
     CACHE_ADD("add"),
@@ -64,10 +64,10 @@ public enum GridRestCommand {
     CACHE_REMOVE("rmv"),
 
     /** Remove value from cache. */
-    CACHE_REMOVE_VALUE("rmvvalue"),
+    CACHE_REMOVE_VALUE("rmvval"),
 
     /** Remove value from cache. */
-    CACHE_GET_AND_REMOVE("getandrmv"),
+    CACHE_GET_AND_REMOVE("getrmv"),
 
     /** Remove several values from cache. */
     CACHE_REMOVE_ALL("rmvall"),
@@ -79,7 +79,7 @@ public enum GridRestCommand {
     CACHE_REPLACE_VALUE("repval"),
 
     /** Replace cache value only if there is currently a mapping for it. */
-    CACHE_GET_AND_REPLACE("getandreplace"),
+    CACHE_GET_AND_REPLACE("getrep"),
 
     /** Compare and set. */
     CACHE_CAS("cas"),
@@ -94,7 +94,7 @@ public enum GridRestCommand {
     CACHE_METRICS("cache"),
 
     /** Cache size. */
-    CACHE_SIZE("cachesize"),
+    CACHE_SIZE("size"),
 
     /** Increment. */
     ATOMIC_INCREMENT("incr"),
@@ -130,22 +130,22 @@ public enum GridRestCommand {
     QUIT("quit"),
 
     /** Get or create cache. */
-    GET_OR_CREATE_CACHE("getorcreatecache"),
+    GET_OR_CREATE_CACHE("getorcreate"),
 
     /** Stops dynamically started cache. */
-    DESTROY_CACHE("destroycache"),
+    DESTROY_CACHE("destcache"),
 
     /** Execute sql query. */
-    EXECUTE_SQL_QUERY("qryexecute"),
+    EXECUTE_SQL_QUERY("qryexe"),
 
     /** Execute sql fields query. */
-    EXECUTE_SQL_FIELDS_QUERY("qryfieldsexecute"),
+    EXECUTE_SQL_FIELDS_QUERY("qryfldexe"),
 
     /** Fetch query results. */
     FETCH_SQL_QUERY("qryfetch"),
 
     /** Close query. */
-    CLOSE_SQL_QUERY("qryclose");
+    CLOSE_SQL_QUERY("qrycls");
 
     /** Enum values. */
     private static final GridRestCommand[] VALS = values();


Mime
View raw message