ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/util DateUtilsTest.java
Date Wed, 06 Feb 2002 00:22:44 GMT
adammurdoch    02/02/05 16:22:44

  Modified:    src/testcases/org/apache/tools/ant/util DateUtilsTest.java
  Log:
  Fix the date util tests for where the local timezone isn't GMT+1.
  
  Revision  Changes    Path
  1.2       +8 -4      jakarta-ant/src/testcases/org/apache/tools/ant/util/DateUtilsTest.java
  
  Index: DateUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/util/DateUtilsTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DateUtilsTest.java	5 Feb 2002 21:14:28 -0000	1.1
  +++ DateUtilsTest.java	6 Feb 2002 00:22:44 -0000	1.2
  @@ -55,6 +55,7 @@
   
   import java.util.Date;
   import java.util.Calendar;
  +import java.util.TimeZone;
   
   import junit.framework.TestCase;
   
  @@ -80,7 +81,8 @@
       }
   
       public void testDateTimeISO(){
  -        Calendar cal = Calendar.getInstance();
  +        TimeZone timeZone = TimeZone.getTimeZone("GMT+1");
  +        Calendar cal = Calendar.getInstance(timeZone);
           cal.set(2002,1,23,10,11,12);
           String text = DateUtils.format(cal.getTime(),
                   DateUtils.ISO8601_DATETIME_PATTERN);
  @@ -88,8 +90,9 @@
       }
   
       public void testDateISO(){
  -        Calendar cal = Calendar.getInstance();
  -        cal.set(2002,1,23);
  +        TimeZone timeZone = TimeZone.getTimeZone("GMT");
  +        Calendar cal = Calendar.getInstance(timeZone);
  +        emailtaskcal.set(2002,1,23);
           String text = DateUtils.format(cal.getTime(),
                   DateUtils.ISO8601_DATE_PATTERN);
           assertEquals("2002-02-23", text);
  @@ -97,7 +100,8 @@
   
       public void testTimeISODate(){
           // make sure that elapsed time in set via date works
  -        Calendar cal = Calendar.getInstance();
  +        TimeZone timeZone = TimeZone.getTimeZone("GMT+1");
  +        Calendar cal = Calendar.getInstance(timeZone);
           cal.set(2002,1,23, 21, 11, 12);
           String text = DateUtils.format(cal.getTime(),
                   DateUtils.ISO8601_TIME_PATTERN);
  
  
  

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


Mime
View raw message