commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1432186 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java
Date Fri, 11 Jan 2013 17:44:10 GMT
Author: bodewig
Date: Fri Jan 11 17:44:09 2013
New Revision: 1432186

URL: http://svn.apache.org/viewvc?rev=1432186&view=rev
Log:
this should take care of regions with DST in January as well

Modified:
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java?rev=1432186&r1=1432185&r2=1432186&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java
Fri Jan 11 17:44:09 2013
@@ -123,7 +123,7 @@ public class X5455_ExtendedTimestampTest
                         switch (year) {
                             case 2107:
                                 // Zip time is okay up to 2107.
-                                assertEquals(year  + "-01-01/00:00:02 +0000", zipTime);
+                                assertEquals(year + "-01-01/00:00:02 +0000", zipTime);
                                 // But the X5455 data has overflowed:
                                 assertEquals("1970-11-24/17:31:45 +0000", modTime);
                                 assertEquals("1970-11-24/17:31:47 +0000", accTime);
@@ -469,8 +469,10 @@ public class X5455_ExtendedTimestampTest
     private static Date adjustFromGMTToExpectedOffset(Date from) {
         Calendar cal = Calendar.getInstance();
         cal.setTime(from);
-        // we may even need to take DST into account for the southern hemisphere
         cal.add(Calendar.MILLISECOND, cal.get(Calendar.ZONE_OFFSET));
+        if (cal.getTimeZone().inDaylightTime(from)) {
+            cal.add(Calendar.MILLISECOND, cal.get(Calendar.DST_OFFSET));
+        }
         cal.add(Calendar.HOUR, 8);
         return cal.getTime();
     }



Mime
View raw message