ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Failing Junit test only under Ant
Date Sat, 10 Nov 2001 21:01:46 GMT

I have a unit test that uses Junit and deals with Dates.
All Date operations are done in UTC time zone, so that is what Junit tests expect.
I have my environment variable TZ set to EST5EDT.

When I run the unit test from the command line all tests pass.

When I run the unit test from Ant it fails because all time values are off by 5 hours (UTC
is 5 hours ahead of my time zone).

Has anyone encountered this?
Does anyone have a solution?

My solution was to unset my TZ environment variable.
As soon as I did that the tests started running fine even from Ant.

However, I don't quite like that solution as it forces my to modify my environment in order
to let the tests pass when I run them under Ant.  Now `date` gives me time in GMT :(

I would prefer it if I could do something within Ant to prevent it from looking at my TZ.
I tried fooling Ant like this:

<property name="env.TZ" value="UTC"/>

However, that had no effect on the outcome.

Any ideas?


_________________________________________________________________ Solutions for Your Life 
Check out the most exciting women's community on the Web

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message