You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2021/03/13 07:13:26 UTC
svn commit: r1887565 -
/pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/DateConverterTest.java
Author: tilman
Date: Sat Mar 13 07:13:26 2021
New Revision: 1887565
URL: http://svn.apache.org/viewvc?rev=1887565&view=rev
Log:
PDFBOX-5127: set timezone due to failing build test on the ci server
Modified:
pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/DateConverterTest.java
Modified: pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/DateConverterTest.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/DateConverterTest.java?rev=1887565&r1=1887564&r2=1887565&view=diff
==============================================================================
--- pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/DateConverterTest.java (original)
+++ pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/DateConverterTest.java Sat Mar 13 07:13:26 2021
@@ -17,6 +17,7 @@ package org.apache.jempbox.xmp;
import java.io.IOException;
import java.text.SimpleDateFormat;
+import java.util.TimeZone;
import junit.framework.TestCase;
import org.apache.jempbox.impl.DateConverter;
@@ -30,11 +31,16 @@ public class DateConverterTest extends T
{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ TimeZone timezone = TimeZone.getDefault();
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
// this hits the NumberFormatException segment
- assertEquals("2020-12-23 12:00:00",
+ assertEquals("2020-12-23 01:00:00",
sdf.format(DateConverter.toCalendar("12/23/2020").getTime()));
assertEquals("2012-10-30 12:24:59",
sdf.format(DateConverter.toCalendar("2012-10-30T12:24:59+01:00").getTime()));
+
+ TimeZone.setDefault(timezone);
}
}