You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/11/12 17:00:08 UTC

DO NOT REPLY [Bug 24648] - Properties files are not properly loaded when testing class under junit task

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24648>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24648

Properties files are not properly loaded when testing class under junit task

peter.reilly@corvil.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From peter.reilly@corvil.com  2003-11-12 16:00 -------
You need to set the locale and not just
the "user.language" system property.
If the locale is not specified, the default locale is used. BUT
this is only set once: in java.util.Locale#getDefault()
which uses the "user.language" property to find the
default locale if the default is null.
By the time you call junit, the default locale would have
been retrieved many times.

You can do one of two things:
1) set default locale by hand in the test:
   Locale.setDefault(new Locale(System.getProperty("user.language")))
2) call "junit" with the attribute "fork" = yes

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org