Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E03B6187A3 for ; Mon, 20 Jul 2015 17:26:11 +0000 (UTC) Received: (qmail 12559 invoked by uid 500); 20 Jul 2015 17:26:11 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 12513 invoked by uid 500); 20 Jul 2015 17:26:11 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 12465 invoked by uid 99); 20 Jul 2015 17:26:11 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jul 2015 17:26:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4FB12189D78 for ; Mon, 20 Jul 2015 17:26:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id EYN_8WGPrsyD for ; Mon, 20 Jul 2015 17:26:03 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 24CD6215CD for ; Mon, 20 Jul 2015 17:26:03 +0000 (UTC) Received: (qmail 11643 invoked by uid 99); 20 Jul 2015 17:26:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jul 2015 17:26:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B4A1CE10A9; Mon, 20 Jul 2015 17:26:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ivasilinets@apache.org To: commits@ignite.incubator.apache.org Date: Mon, 20 Jul 2015 17:26:05 -0000 Message-Id: In-Reply-To: <78afde7c448a4f35a14aaa5575c105bf@git.apache.org> References: <78afde7c448a4f35a14aaa5575c105bf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/5] incubator-ignite git commit: #ignite-961: fix comments after review. #ignite-961: fix comments after review. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/09d598e4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/09d598e4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/09d598e4 Branch: refs/heads/ignite-961-master Commit: 09d598e46a083c1ce98274a37d34639f91fc7ba7 Parents: 65c72c5 Author: ivasilinets Authored: Mon Jul 20 14:55:07 2015 +0300 Committer: ivasilinets Committed: Mon Jul 20 14:55:07 2015 +0300 ---------------------------------------------------------------------- .../JettyRestProcessorAbstractSelfTest.java | 39 ++++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09d598e4/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 f1cfe96..7354214 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 @@ -61,7 +61,7 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS /** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { - grid(0).cache(null).clear(); + grid(0).cache(null).removeAll(); } /** {@inheritDoc} */ @@ -1009,16 +1009,7 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS assertEquals(2, items.size()); - for (int i = 0; i < GRID_CNT; ++i) { - Map handlers = - GridTestUtils.getFieldValue(grid(i).context().rest(), "handlers"); - - GridRestCommandHandler qryHnd = handlers.get(GridRestCommand.CLOSE_SQL_QUERY); - - ConcurrentHashMap its = GridTestUtils.getFieldValue(qryHnd, "curs"); - - assertEquals(0, its.size()); - } + assertFalse(queryCursorFound()); } /** @@ -1074,6 +1065,32 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS /** * @throws Exception If failed. */ + public void testSqlFieldsQuery() throws Exception { + String qry = "select concat(firstName, ' ', lastName) from Person"; + + Map params = new HashMap<>(); + params.put("cmd", "qryfieldsexecute"); + params.put("psz", "10"); + params.put("cacheName", "person"); + params.put("qry", URLEncoder.encode(qry)); + + String ret = content(params); + + assertNotNull(ret); + assertTrue(!ret.isEmpty()); + + JSONObject json = JSONObject.fromObject(ret); + + List items = (List)((Map)json.get("response")).get("items"); + + assertEquals(4, items.size()); + + assertFalse(queryCursorFound()); + } + + /** + * @throws Exception If failed. + */ public void testQueryClose() throws Exception { String qry = "salary > ? and salary <= ?";