logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r391719 - /logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
Date Wed, 05 Apr 2006 19:00:07 GMT
Author: carnold
Date: Wed Apr  5 12:00:05 2006
New Revision: 391719

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

Modified:
    logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java

Modified: logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
URL: http://svn.apache.org/viewcvs/logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java?rev=391719&r1=391718&r2=391719&view=diff
==============================================================================
--- logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
(original)
+++ logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
Wed Apr  5 12:00:05 2006
@@ -25,6 +25,7 @@
 
 import java.util.TimeZone;
 import java.util.Date;
+import java.util.Calendar;
 
 
 /**
@@ -224,7 +225,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);
   }
 
@@ -234,7 +238,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