You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by pi...@apache.org on 2008/07/08 13:19:09 UTC
svn commit: r674767 - in /incubator/pig/branches/types: CHANGES.txt
test/org/apache/pig/test/TestLogicalPlanBuilder.java
Author: pisong
Date: Tue Jul 8 04:19:08 2008
New Revision: 674767
URL: http://svn.apache.org/viewvc?rev=674767&view=rev
Log:
Santhosh's string comparator unit tests
Modified:
incubator/pig/branches/types/CHANGES.txt
incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java
Modified: incubator/pig/branches/types/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/CHANGES.txt?rev=674767&r1=674766&r2=674767&view=diff
==============================================================================
--- incubator/pig/branches/types/CHANGES.txt (original)
+++ incubator/pig/branches/types/CHANGES.txt Tue Jul 8 04:19:08 2008
@@ -134,4 +134,6 @@
PIG-213: Remove non-static references to logger from data bags and tuples,
as it causes significant overhead (vgeschel via gates).
- PIG-284: target for building source jar (oae via olgan)
+ PIG-284: target for building source jar (oae via olgan)
+
+ PIG-294: string comparator unit tests (sms via pi_song)
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java?rev=674767&r1=674766&r2=674767&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java Tue Jul 8 04:19:08 2008
@@ -923,17 +923,22 @@
printPlan(buildPlan(query));
}
- //TODO
- //The parser does not handle logical operators (AND/OR) in conjunction
- //with comparison operators (>, <, ...)
- /*
@Test
public void testQuery81() {
buildPlan("a = load 'input1' using PigStorage() as (name, age, gpa);");
- //buildPlan("split a into b if name lt 'f', c if (name ge 'f' and name le 'h'), d if name gt 'h';");
- buildPlan("split a into b if name lt 'f', c if (name ge 'f') and (name le 'h');");
+ buildPlan("split a into b if name lt 'f', c if (name gte 'f' and name lte 'h'), d if name gt 'h';");
}
- */
+
+ @Test
+ public void testQueryFail81() {
+ buildPlan("a = load 'input1' using PigStorage() as (name, age, gpa);");
+ try {
+ buildPlan("split a into b if name lt 'f', c if (name ge 'f' and name le 'h'), d if name gt 'h';");
+ } catch (AssertionFailedError e) {
+ assertTrue(e.getMessage().contains("Exception"));
+ }
+ }
+
private void printPlan(LogicalPlan lp) {
LOPrinter graphPrinter = new LOPrinter(System.err, lp);
@@ -996,7 +1001,7 @@
}
*/
- assertTrue(lp != null);
+ assertNotNull(lp != null);
return lp;
} catch (IOException e) {
// log.error(e);