[ 
https://issues.apache.org/jira/browse/NIFI-5675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16644590#comment-16644590
 ] 

ASF GitHub Bot commented on NIFI-5675:
--------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/3058


> Some tests in ConvertExcelToCSVProcessorTest fail because of locale-dependent 
> expressions
> -----------------------------------------------------------------------------------------
>
>                 Key: NIFI-5675
>                 URL: https://issues.apache.org/jira/browse/NIFI-5675
>             Project: Apache NiFi
>          Issue Type: Test
>            Reporter: Kotaro Terada
>            Priority: Major
>
> Some tests in {{ConvertExcelToCSVProcessorTest}} fail in some locales because 
> text in the assertions is locale-dependent.
> The problem is that DateTime expressions (such as "Sunday, January 01, 2017") 
> are based on English and locale-dependent. When the locale of JVM is "ja_JP" 
> for example, the tests fail as follows:
> {noformat}
> [INFO] Running org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest
> [ERROR] Tests run: 13, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 5.32 
> s <<< FAILURE! - in 
> org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest
> [ERROR] 
> testSkipRows(org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest)  
> Time elapsed: 0.146 s  <<< FAILURE!
> org.junit.ComparisonFailure: 
> expected:<1234.46,12:00:00 [PM,£   123.45
> 1234.5,Sunday\, January 01\, 2017,¥   123.45
> 1\,234.46,1/1/17 12:00,$   1\,023.45
> 1\,234.4560,12:00 PM],£   1\,023.45
> 9.88E...> but was:<1234.46,12:00:00 [午後,£   123.45
> 1234.5,日曜日\, 1月 01\, 2017,¥   123.45
> 1\,234.46,1/1/17 12:00,$   1\,023.45
> 1\,234.4560,12:00 午後],£   1\,023.45
> 9.88E...>
>       at 
> org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest.testSkipRows(ConvertExcelToCSVProcessorTest.java:153)
> [ERROR] 
> testCustomDelimiters(org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest)
>   Time elapsed: 0.03 s  <<< FAILURE!
> org.junit.ComparisonFailure: 
> expected:<...5
> 1234.46|12:00:00 [PM|£   123.45
> 1234.5|Sunday, January 01, 2017|¥   123.45
> 1,234.46|1/1/17 12:00|$   1,023.45
> 1,234.4560|12:00 PM]|£   1,023.45
> 9.88E...> but was:<...5
> 1234.46|12:00:00 [午後|£   123.45
> 1234.5|日曜日, 1月 01, 2017|¥   123.45
> 1,234.46|1/1/17 12:00|$   1,023.45
> 1,234.4560|12:00 午後]|£   1,023.45
> 9.88E...>
>       at 
> org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest.testCustomDelimiters(ConvertExcelToCSVProcessorTest.java:266)
> [ERROR] 
> testQuoting(org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest)  
> Time elapsed: 0.029 s  <<< FAILURE!
> org.junit.ComparisonFailure: 
> expected:<...45
> 1234.46,12:00:00 [PM,£   123.45
> 1234.5,"Sunday, January 01, 2017",¥   123.45
> "1,234.46",1/1/17 12:00,"$   1,023.45"
> "1,234.4560",12:00 PM],"£   1,023.45"
> 9.88...> but was:<...45
> 1234.46,12:00:00 [午後,£   123.45
> 1234.5,"日曜日, 1月 01, 2017",¥   123.45
> "1,234.46",1/1/17 12:00,"$   1,023.45"
> "1,234.4560",12:00 午後],"£   1,023.45"
> 9.88...>
>       at 
> org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest.testQuoting(ConvertExcelToCSVProcessorTest.java:125)
> [ERROR] 
> testSkipRowsWithEL(org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest)
>   Time elapsed: 0.02 s  <<< FAILURE!
> org.junit.ComparisonFailure: 
> expected:<1234.46,12:00:00 [PM,£   123.45
> 1234.5,Sunday\, January 01\, 2017,¥   123.45
> 1\,234.46,1/1/17 12:00,$   1\,023.45
> 1\,234.4560,12:00 PM],£   1\,023.45
> 9.88E...> but was:<1234.46,12:00:00 [午後,£   123.45
> 1234.5,日曜日\, 1月 01\, 2017,¥   123.45
> 1\,234.46,1/1/17 12:00,$   1\,023.45
> 1\,234.4560,12:00 午後],£   1\,023.45
> 9.88E...>
>       at 
> org.apache.nifi.processors.poi.ConvertExcelToCSVProcessorTest.testSkipRowsWithEL(ConvertExcelToCSVProcessorTest.java:181)
> {noformat}
> To fix this, we can convert the expected DateTime strings using 
> `DateTimeFormatter` in the assertions.
> Note that similar issues and fixes (for a different class) are here:
> - https://issues.apache.org/jira/browse/NIFI-2683
> - https://issues.apache.org/jira/browse/NIFI-3483



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to