You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Bill Graham (JIRA)" <ji...@apache.org> on 2013/01/22 04:36:14 UTC

[jira] [Updated] (PIG-3070) PigTest - Patch for PIG-3027 - Pls review to see if trim required after replacing all "\r\n" with "\n" to avoid additional newline at end of expected string.

     [ https://issues.apache.org/jira/browse/PIG-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Graham updated PIG-3070:
-----------------------------

    Fix Version/s:     (was: 0.11)
                   0.12
    
> PigTest - Patch for PIG-3027 - Pls review to see if trim required after replacing all "\r\n" with "\n" to avoid additional newline at end of expected string. 
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-3070
>                 URL: https://issues.apache.org/jira/browse/PIG-3070
>             Project: Pig
>          Issue Type: Bug
>          Components: build
>    Affects Versions: 0.10.0
>            Reporter: Raghavendra Saravanamurthy
>            Assignee: Daniel Dai
>            Priority: Minor
>             Fix For: 0.12
>
>
> Ref Patch: https://issues.apache.org/jira/secure/attachment/12552008/PIG-3027.trunk.1.patch
> With the above patch fix:
> readFile(expected).replaceAll("\r\n", "\n") gives the expected file contents as (note: the exp file does not contain a "\n" after the last line of text):
> ~~~~~~~~~~~~~~~~~~~~
> (yahoo,25)
> (facebook,15)
> (twitter,7)
> 12/11/28 02:59:06 INFO pigunit.PigTest:..............
> ~~~~~~~~~~~~~~~~~~~~
> And the test case fails with:
> ~~~~~~~~~~~~~~~~~~~~
> junit.framework.ComparisonFailure: expected:<...book,15)
> (twitter,7)[
> ]> but was:<...book,15)
> (twitter,7)[]>
>         at junit.framework.Assert.assertEquals(Assert.java:85)
>         at junit.framework.Assert.assertEquals(Assert.java:91)
> ~~~~~~~~~~~~~~~~~~~~
> After adding trim to the above patch:
> readFile(expected).replaceAll("\r\n", "\n").trim() gives the expected file contents as:
> ~~~~~~~~~~~~~~~~~~~~
> (yahoo,25)
> (facebook,15)
> (twitter,7)
> 12/11/28 03:10:06 INFO pigunit.PigTest:..............
> ~~~~~~~~~~~~~~~~~~~~
> And the above test case passed.
> Please review if trim should be added to avoid the additional newline at the end of expected string.
> Pls note: I was running the tests in rhel environment.
> Thank you.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira