diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2018-11-18 00:01:40 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2018-11-18 00:01:40 +0000 |
commit | 42af181065e99775ed94698e8fa8d8ffea2ddade (patch) | |
tree | aaed02321ec6dd6f61ace2429aee48bd0de47bea /src/scratchpad/testcases | |
parent | 0bb47ba1e4c0d52bc021c9fabccc4fb3ea6bb478 (diff) | |
download | poi-42af181065e99775ed94698e8fa8d8ffea2ddade.tar.gz poi-42af181065e99775ed94698e8fa8d8ffea2ddade.zip |
#62921 - Provide OOXMLLite alternative for Java 12+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846809 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad/testcases')
3 files changed, 6 insertions, 9 deletions
diff --git a/src/scratchpad/testcases/org/apache/poi/hmef/TestAttachments.java b/src/scratchpad/testcases/org/apache/poi/hmef/TestAttachments.java index 18f59725bb..87655cb3ae 100644 --- a/src/scratchpad/testcases/org/apache/poi/hmef/TestAttachments.java +++ b/src/scratchpad/testcases/org/apache/poi/hmef/TestAttachments.java @@ -18,6 +18,7 @@ package org.apache.poi.hmef; import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.List; import java.util.Locale; @@ -83,9 +84,7 @@ public final class TestAttachments extends HMEFTest { List<Attachment> attachments = quick.getAttachments(); // Pick a predictable date format + timezone - DateFormat fmt = DateFormat.getDateTimeInstance( - DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.UK - ); + DateFormat fmt = new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss", Locale.UK); fmt.setTimeZone(LocaleUtil.TIMEZONE_UTC); // They should all have the same date on them diff --git a/src/scratchpad/testcases/org/apache/poi/hmef/attribute/TestMAPIAttributes.java b/src/scratchpad/testcases/org/apache/poi/hmef/attribute/TestMAPIAttributes.java index f854394816..7fcad02042 100644 --- a/src/scratchpad/testcases/org/apache/poi/hmef/attribute/TestMAPIAttributes.java +++ b/src/scratchpad/testcases/org/apache/poi/hmef/attribute/TestMAPIAttributes.java @@ -20,6 +20,7 @@ package org.apache.poi.hmef.attribute; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.Locale; import org.apache.poi.POIDataSamples; @@ -159,9 +160,7 @@ protected void tearDown() throws Exception { assertEquals(MAPIDateAttribute.class, attr.getClass()); MAPIDateAttribute date = (MAPIDateAttribute)attr; - DateFormat fmt = DateFormat.getDateTimeInstance( - DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.UK - ); + DateFormat fmt = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss", Locale.UK); fmt.setTimeZone(LocaleUtil.TIMEZONE_UTC); assertEquals("15-Dec-2010 14:46:31", fmt.format(date.getDate())); diff --git a/src/scratchpad/testcases/org/apache/poi/hmef/attribute/TestTNEFAttributes.java b/src/scratchpad/testcases/org/apache/poi/hmef/attribute/TestTNEFAttributes.java index cd13b94b39..04004fae23 100644 --- a/src/scratchpad/testcases/org/apache/poi/hmef/attribute/TestTNEFAttributes.java +++ b/src/scratchpad/testcases/org/apache/poi/hmef/attribute/TestTNEFAttributes.java @@ -19,6 +19,7 @@ package org.apache.poi.hmef.attribute; import java.io.ByteArrayInputStream; import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.Locale; import org.apache.poi.POIDataSamples; @@ -159,9 +160,7 @@ public final class TestTNEFAttributes extends TestCase { // Ask for it as a Java date, and have it converted // Pick a predictable format + location + timezone TNEFDateAttribute date = (TNEFDateAttribute)attr; - DateFormat fmt = DateFormat.getDateTimeInstance( - DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.UK - ); + DateFormat fmt = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss", Locale.UK); fmt.setTimeZone(LocaleUtil.TIMEZONE_UTC); assertEquals("28-Apr-2010 12:40:56", fmt.format(date.getDate())); } |