[
https://jira.duraspace.org/browse/DS-1331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26554#comment-26554
]
Mark H. Wood commented on DS-1331:
----------------------------------
Notice that line 64 is testing getCountryName(String), while line 76 is testing
getCountryName(String, Locale). That's why there are two tests.
The real problem is that testGetCountryNameString is using a constant string of
the English name for the expected value, which will of course fail in a
non-English locale. My mistake. Replacing the constant string with
Locale.US.getDisplayCountry() should work, yes?
> testGetCountryNameString fails
> ------------------------------
>
> Key: DS-1331
> URL: https://jira.duraspace.org/browse/DS-1331
> Project: DSpace
> Issue Type: Bug
> Components: Unit Testing Framework
> Affects Versions: 3.0
> Environment: *Location*: http://demo.dspace.org/
> *User-Agent*: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.4 (KHTML, like
> Gecko) Chrome/22.0.1229.94 Safari/537.4
> *Screen Resolution*: 1680 x 1050
> Reporter: Keiji Suzuki
> Assignee: Mark H. Wood
> Labels: collector-60e7afac
>
> When I did "mvn package" dspace-3.0-rc1-release at dsapce-src, the above test
> was failure.
> The report says as follows.
> -------------------------------------------------------------------------------
> Test set: org.dspace.statistics.util.TestLocationUtils
> -------------------------------------------------------------------------------
> Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.109 sec <<<
> FAILURE!
> testGetCountryNameString(org.dspace.statistics.util.TestLocationUtils) Time
> elapsed: 0.016 sec <<< FAILURE!
> org.junit.ComparisonFailure: expected:<[United States]> but was:<[アメリカ合衆国]>
> at
> org.dspace.statistics.util.TestLocationUtils.testGetCountryNameString(TestLocationUtils.java:64)
> ---------------
> My default locale is Locale.Japanese. This failure is fixed when I changed
> the line 64 of TestLocationUtils.java
> as follows (added Locale.ENGLISH as the second parameter).
> assertEquals("United States", LocationUtils.getCountryName(
> "US", Locale.ENGLISH));
> *Reporter*: Keiji Suzuki
> *E-mail*: [mailto:[email protected]]
--
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
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel