[
https://issues.apache.org/jira/browse/NIFI-5675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16644340#comment-16644340
]
ASF GitHub Bot commented on NIFI-5675:
--------------------------------------
GitHub user kotarot opened a pull request:
https://github.com/apache/nifi/pull/3058
NIFI-5675: Fix some locale-dependent tests in ConvertExcelToCSVProcessorTest
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [X] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [X] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number
you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [X] Has your PR been rebased against the latest commit within the target
branch (typically master)?
- [X] Is your initial contribution a single, squashed commit?
### For code changes:
- [X] Have you ensured that the full suite of tests is executed via mvn
-Pcontrib-check clean install at the root nifi folder?
- [X] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file, including the main
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to
.name (programmatic access) for each of the new properties?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in
which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check travis-ci for build
issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kotarot/nifi NIFI-5675
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/3058.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3058
----
commit 9d35f331ccf3c97c9063dc21cb80a73999b00a2e
Author: Kotaro Terada <koterada@...>
Date: 2018-10-05T07:43:44Z
Fix some locale-dependent tests in ConvertExcelToCSVProcessorTest
----
> 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)