Bug 64179: Adjust to ensure a fixed timezone for date parsing in test

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1874949 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2020-03-07 15:33:46 +00:00
parent ee61d3eb56
commit cbf7275a0d
1 changed files with 232 additions and 230 deletions

View File

@ -850,7 +850,9 @@ public class TestCellFormat {
@Test @Test
public void testApplyObjectDate() throws ParseException { public void testApplyObjectDate() throws ParseException {
CellFormat cf1 = CellFormat.getInstance("m/d/yyyy"); CellFormat cf1 = CellFormat.getInstance("m/d/yyyy");
Date date1 = new SimpleDateFormat("M/d/y", Locale.ROOT).parse("01/11/2012"); SimpleDateFormat sdf1 = new SimpleDateFormat("M/d/y", Locale.ROOT);
sdf1.setTimeZone(TimeZone.getTimeZone("CET"));
Date date1 = sdf1.parse("01/11/2012");
assertEquals("1/11/2012", cf1.apply(date1).text); assertEquals("1/11/2012", cf1.apply(date1).text);
} }