lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/document TestDateTools.java
Date Wed, 13 Oct 2004 18:08:51 GMT
dnaber      2004/10/13 11:08:51

  Modified:    src/test/org/apache/lucene/document TestDateTools.java
  Log:
  make the test case timezone independent
  
  Submitted by: Anatol Pomozov
  
  Revision  Changes    Path
  1.3       +12 -5     jakarta-lucene/src/test/org/apache/lucene/document/TestDateTools.java
  
  Index: TestDateTools.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/document/TestDateTools.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestDateTools.java	11 Oct 2004 20:32:44 -0000	1.2
  +++ TestDateTools.java	13 Oct 2004 18:08:51 -0000	1.3
  @@ -114,12 +114,19 @@
       assertEquals("1961-03-05 23:00:00:000", isoFormat(DateTools.stringToDate(dateString)));
   
       // timeToString:
  -    dateString = DateTools.timeToString(0, DateTools.Resolution.MILLISECOND);
  -    assertEquals("19700101010000000", dateString);
  -
  -    dateString = DateTools.timeToString(123000, DateTools.Resolution.MILLISECOND);
  +    cal.set(1970, 0, 1, // year=1970, month=january, day=1
  +        0, 0, 0); // hour, minute, second
  +    cal.set(Calendar.MILLISECOND, 0);
  +    dateString = DateTools.timeToString(cal.getTime().getTime(),
  +        DateTools.Resolution.MILLISECOND);
  +    assertEquals("19700101000000000", dateString);
  +        
  +    cal.set(1970, 0, 1, // year=1970, month=january, day=1
  +        1, 2, 3); // hour, minute, second
  +    cal.set(Calendar.MILLISECOND, 0);
  +    dateString = DateTools.timeToString(cal.getTime().getTime(),
  +        DateTools.Resolution.MILLISECOND);
       assertEquals("19700101010203000", dateString);
  -    
     }
     
     public void testRound() {
  
  
  

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


Mime
View raw message