Return-Path: X-Original-To: apmail-pig-dev-archive@www.apache.org Delivered-To: apmail-pig-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A022317E77 for ; Fri, 3 Oct 2014 20:23:34 +0000 (UTC) Received: (qmail 26843 invoked by uid 500); 3 Oct 2014 20:23:34 -0000 Delivered-To: apmail-pig-dev-archive@pig.apache.org Received: (qmail 26792 invoked by uid 500); 3 Oct 2014 20:23:34 -0000 Mailing-List: contact dev-help@pig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pig.apache.org Delivered-To: mailing list dev@pig.apache.org Received: (qmail 26779 invoked by uid 500); 3 Oct 2014 20:23:34 -0000 Delivered-To: apmail-hadoop-pig-dev@hadoop.apache.org Received: (qmail 26776 invoked by uid 99); 3 Oct 2014 20:23:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Oct 2014 20:23:34 +0000 Date: Fri, 3 Oct 2014 20:23:34 +0000 (UTC) From: "Juan Gentile (JIRA)" To: pig-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PIG-2692) Make the Pig unit faciliities more generalizable and update javadocs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PIG-2692?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D141584= 75#comment-14158475 ]=20 Juan Gentile commented on PIG-2692: ----------------------------------- +1 for being able to override multiple inputs. Regarding the ordering of re= sults, I did my own assert: void assertUnsortedOutput(String[] expected, String alias) throws IOExcepti= on, ParseException, AssertionError { List expectedResults =3D new LinkedList<>(Arrays.asList(expecte= d)); Iterator resultsIterator =3D getAlias(alias); int size =3D 0; while (resultsIterator.hasNext()) { String result =3D resultsIterator.next().toString(); assertTrue(expectedResults.contains(result)); expectedResults.remove(result); size++; } Assert.assertEquals(expected.length, size); } > Make the Pig unit faciliities more generalizable and update javadocs > -------------------------------------------------------------------- > > Key: PIG-2692 > URL: https://issues.apache.org/jira/browse/PIG-2692 > Project: Pig > Issue Type: Improvement > Reporter: Jeremy Hanna > Priority: Minor > > This ticket has two goals for Pig unit: > 1) Pig unit has a really nice method assertOutput(String inputAlias, Stri= ng[] inputValues, String outputAlias, String[] expectedOutputValues). That= method lets you override an input alias variable with a hardcoded list of = values. That way, the script doesn't actually have to read that input varia= ble from hdfs or cassandra. Then, it runs the script and checks the specifi= ed output alias variable against the expected set of values. It's a really= nice way to test your entire pig script with a single method call, but onl= y IF your script has exactly 1 input and 1 output. If you want to test mor= e complicated scripts, you have to jump through some hoops in order to over= ride more input variables. But, it would be fairly easy to change PigUnit s= o that it can override any number of inputs and check any number of outputs= and do so easily. That's basically the change that I put into the base te= sting class I wrote. But, it would be better to push that into PigUnit itse= lf, and it's something that could easily be done in an afternoon. > 2) Update javadocs for the pig unit test classes to make them more readab= le. -- This message was sent by Atlassian JIRA (v6.3.4#6332)