logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r391638 - /logging/log4j/trunk/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
Date Wed, 05 Apr 2006 15:31:27 GMT
Author: carnold
Date: Wed Apr  5 08:31:24 2006
New Revision: 391638

URL: http://svn.apache.org/viewcvs?rev=391638&view=rev
Log:
Bug 39135: Eliminated JDK 1.4 dependency on ISO and DateTimeDateFormat tests

Modified:
    logging/log4j/trunk/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java?rev=391638&r1=391637&r2=391638&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java Wed Apr
 5 08:31:24 2006
@@ -23,6 +23,7 @@
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 
+import java.util.Calendar;
 import java.util.TimeZone;
 import java.util.Date;
 
@@ -236,7 +237,10 @@
      */
   public void testISO8601Format() {
       DateFormat format = new ISO8601DateFormat();
-      String actual = format.format(new Date(-TimeZone.getDefault().getOffset(0)));
+      Calendar calendar = Calendar.getInstance();
+      calendar.clear();
+      calendar.set(1970, 0, 1, 0, 0, 0);
+      String actual = format.format(calendar.getTime());
       assertEquals("1970-01-01 00:00:00,000", actual);
   }
 
@@ -246,7 +250,10 @@
      */
   public void testDateTimeFormat() {
       DateFormat format = new DateTimeDateFormat();
-      String actual = format.format(new Date(-TimeZone.getDefault().getOffset(0)));
+      Calendar calendar = Calendar.getInstance();
+      calendar.clear();
+      calendar.set(1970, 0, 1, 0, 0, 0);
+      String actual = format.format(calendar.getTime());
       assertEquals("01 Jan 1970 00:00:00,000", actual);
   }
 



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


Mime
View raw message