Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 50748200BA3 for ; Wed, 5 Oct 2016 20:29:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4F209160AF2; Wed, 5 Oct 2016 18:29:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6A0D1160AC9 for ; Wed, 5 Oct 2016 20:29:15 +0200 (CEST) Received: (qmail 34614 invoked by uid 500); 5 Oct 2016 18:29:14 -0000 Mailing-List: contact commits-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list commits@hawq.incubator.apache.org Received: (qmail 34605 invoked by uid 99); 5 Oct 2016 18:29:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2016 18:29:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EB8F5C0B9A for ; Wed, 5 Oct 2016 18:29:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id a7rNSxzM3tUd for ; Wed, 5 Oct 2016 18:29:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 5C0685F39A for ; Wed, 5 Oct 2016 18:29:12 +0000 (UTC) Received: (qmail 34552 invoked by uid 99); 5 Oct 2016 18:29:11 -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; Wed, 05 Oct 2016 18:29:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5D770E0FC4; Wed, 5 Oct 2016 18:29:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: odiachenko@apache.org To: commits@hawq.incubator.apache.org Date: Wed, 05 Oct 2016 18:29:16 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [06/18] incubator-hawq git commit: HAWQ-964. Update unittests and remove @Test from example code archived-at: Wed, 05 Oct 2016 18:29:16 -0000 HAWQ-964. Update unittests and remove @Test from example code Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/f3668dcc Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/f3668dcc Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/f3668dcc Branch: refs/heads/HAWQ-964 Commit: f3668dcca2d5862247ba4d5e8e17e7bd2778aba8 Parents: 545f8aa Author: Kavinder Dhaliwal Authored: Mon Sep 19 14:51:10 2016 -0700 Committer: Kavinder Dhaliwal Committed: Tue Sep 20 09:45:44 2016 -0700 ---------------------------------------------------------------------- .../apache/hawq/pxf/api/FilterParserTest.java | 71 ++++++++++---------- .../hive/HiveORCSearchArgumentExample.java | 1 - 2 files changed, 35 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f3668dcc/pxf/pxf-api/src/test/java/org/apache/hawq/pxf/api/FilterParserTest.java ---------------------------------------------------------------------- diff --git a/pxf/pxf-api/src/test/java/org/apache/hawq/pxf/api/FilterParserTest.java b/pxf/pxf-api/src/test/java/org/apache/hawq/pxf/api/FilterParserTest.java index 83bb2dc..a129a4b 100644 --- a/pxf/pxf-api/src/test/java/org/apache/hawq/pxf/api/FilterParserTest.java +++ b/pxf/pxf-api/src/test/java/org/apache/hawq/pxf/api/FilterParserTest.java @@ -288,40 +288,65 @@ public class FilterParserTest { @Test public void parseLogicalAndOperator() throws Exception { - filter = "l0"; - Object op = "filter with 1 AND operator"; + filter = "a1c0o5a2c3o2l0"; + + Object firstOp = "first operation HDOP_EQ"; + Object secondOp = "second operation HDOP_GT"; + Object lastOp = "filter with 2 operations connected by AND"; + + when(filterBuilder.build(eq(Operation.HDOP_EQ), + any(), + any())).thenReturn(firstOp); + + when(filterBuilder.build(eq(Operation.HDOP_GT), + any(), + any())).thenReturn(secondOp); when(filterBuilder.build(eq(LogicalOperation.HDOP_AND), any(), - any())).thenReturn(op); + any())).thenReturn(lastOp); Object result = filterParser.parse(filter); - assertEquals(op, result); + assertEquals(lastOp, result); } @Test public void parseLogicalOrOperator() throws Exception { - filter = "l1"; + filter = "a1c0o5a2c3o2l1"; + + Object firstOp = "first operation HDOP_EQ"; + Object secondOp = "second operation HDOP_GT"; + Object lastOp = "filter with 1 OR operator"; - Object op = "filter with 1 OR operator"; + when(filterBuilder.build(eq(Operation.HDOP_EQ), + any(), + any())).thenReturn(firstOp); + + when(filterBuilder.build(eq(Operation.HDOP_GT), + any(), + any())).thenReturn(secondOp); when(filterBuilder.build(eq(LogicalOperation.HDOP_OR), any(), - any())).thenReturn(op); + any())).thenReturn(lastOp); Object result = filterParser.parse(filter); - assertEquals(op, result); + assertEquals(lastOp, result); } @Test public void parseLogicalNotOperator() throws Exception { - filter = "l2"; + filter = "a1c0o5l2"; + Object firstOp = "first operation HDOP_EQ"; Object op = "filter with NOT operator"; - when(filterBuilder.build(eq(LogicalOperation.HDOP_NOT), + when(filterBuilder.build(eq(Operation.HDOP_EQ), any(), + any())).thenReturn(firstOp); + + when(filterBuilder.build(eq(LogicalOperation.HDOP_NOT), any())).thenReturn(op); Object result = filterParser.parse(filter); @@ -344,31 +369,6 @@ public class FilterParserTest { } @Test - public void parseLogicalOperatorWithExpressions() throws Exception { - filter = "a1c\"first\"o5a2c2o2l0"; - Object firstOp = "first operation HDOP_EQ"; - Object secondOp = "second operation HDOP_GT"; - Object lastOp = "filter with 2 operations connected by AND"; - - when(filterBuilder.build(eq(Operation.HDOP_EQ), - any(), - any())).thenReturn(firstOp); - - - when(filterBuilder.build(eq(Operation.HDOP_GT), - any(), - any())).thenReturn(secondOp); - - when(filterBuilder.build(eq(LogicalOperation.HDOP_AND), - any(), - any())).thenReturn(lastOp); - - - Object result = filterParser.parse(filter); - assertEquals(lastOp, result); - } - - @Test public void parseLogicalOperatorNotExpression() throws Exception { filter = "a1c\"first\"o5a2c2o2l0l2"; Object firstOp = "first operation HDOP_EQ"; @@ -396,7 +396,6 @@ public class FilterParserTest { assertEquals(lastOp, result); } - /* * Helper functions */ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f3668dcc/pxf/pxf-hive/src/test/java/org/apache/hawq/pxf/plugins/hive/HiveORCSearchArgumentExample.java ---------------------------------------------------------------------- diff --git a/pxf/pxf-hive/src/test/java/org/apache/hawq/pxf/plugins/hive/HiveORCSearchArgumentExample.java b/pxf/pxf-hive/src/test/java/org/apache/hawq/pxf/plugins/hive/HiveORCSearchArgumentExample.java index a520b94..d884022 100644 --- a/pxf/pxf-hive/src/test/java/org/apache/hawq/pxf/plugins/hive/HiveORCSearchArgumentExample.java +++ b/pxf/pxf-hive/src/test/java/org/apache/hawq/pxf/plugins/hive/HiveORCSearchArgumentExample.java @@ -13,7 +13,6 @@ import java.util.List; public class HiveORCSearchArgumentExample { - @Test public void buildLogicalOperationTree() throws Exception { /* Predicate pushdown configuration */