ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Leal "Valmaņa" <achepat...@yahoo.es>
Subject RE: Properties files are not properly loaded when testing class under junit task (possible bug)
Date Fri, 14 Nov 2003 14:02:57 GMT

Dear Stefan,

-----Mensaje original-----

De: Stefan Bodewig [mailto:bodewig@apache.org]

Enviado el: viernes, 14 de noviembre de 2003 14:18

Para: user@ant.apache.org

Asunto: Re: Properties files are not properly loaded when testing class

under junit task (possible bug)

 

On Tue, 11 Nov 2003, David Leal <achepati67@yahoo.es> wrote:

> I have detected that the junit task doesn't take into account a

> change on the variable user.language, for example on the invokation:

It does, as your own Syste.out output shows. I think the problem is

in the ResourceBundle class (ot the classes supporting it). If you

change the locale related system properties, this won't affect

ResourceBundle at all, much like changing java.class.path doesn't have

any effect on the classes your VM can load.

I DON'T KNOW, BECAUSE IF I RUN THE TEST CLASS DIRECTLY FROM JAVA, IT WORKS!!!!

I fear you have to set your properties before you start a new VM (and

as a corrolary have to start a new VM whenever you want the change to

take any effect). And then, I'm not sure whether user.language is the

property that get's consulted by ResourceBundle at all.

DO YOU MEAN TO FORK THE VM?, I HAVE PROBLEMS WHEN I DO THAT, I GET A CLASS NOT FOUND

MESSAGE. THAT IS WHY I AM USING YOUR RECOMENDATION ABOUT TO USE THE NESTED ELEMENT: <sysproperty>

> ant -Duser.language=en

Sets an Ant property, not a Java system property. For a system

property you have to use the ANT_OPTS environment variable.

OK, I HAVE USED IT, BUT IT DOESN'T WORK TOO.

I HAVE SET TO THE VALUE:

SET ANT_OPTS=-Duser.language=en

AND IT WORKS, SO NOW THE QUESTION IS HOW TO CONTROL ON THE ANT INVOKATIO, DO I HAVE THE VALUE
OF THIS ENVIRONMENT VARIABLE IN ORDER TO TEST EJECUTION USING DIFERENT LOCALES? I SHOULD BE
A SIMPLER WAY? NOW FOR TESTING A DIFFERENT LOCALE CONFIGURATION, I HAVE TO SET BY HAND THE
VALUE OF THE VARIABLE ANT_OPTS.

Thanks,



---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message