How to write test requiring a specific locale?
28 Aug
2015
28 Aug
'15
12:35 a.m.
Hi All In https://bugs.openjdk.java.net/browse/JDK-8133910, the test tries to grep certain text from tool output, but when the default locale is not "en_US" it might fail. I don't want to rewrite the test to check localized text so there are only 2 ways: 1. Force the text to run with "en_US". In Unix, seems setting LANG or LC_ALL to "en_US.UTF-8" (these are script tests), but it does not work on Windows. I can only think of adding "-J-Duser.language=en -J-Duser.country=US" into TESTTOOLVMOPTS. 2. Ignore the text when locale is not en_US. The @requires tag does not support user.encoding. Shall I check $LANG or $LC_ALL? Should they contain "en_US" on most test machines? Or it's "C"? Thanks Max
3846
Age (days ago)
3846
Last active (days ago)
0 comments
1 participants
participants (1)
-
Weijun Wang