Skip to content

Commit

Permalink
TEIID-5628 upgrading poi
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Jan 25, 2019
1 parent 4d31d89 commit dc17730
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -24,6 +24,7 @@
import java.util.List;
import java.util.TimeZone;

import org.apache.poi.util.LocaleUtil;
import org.junit.Test;
import org.mockito.Mockito;
import org.teiid.cdk.api.TranslationUtility;
Expand Down Expand Up @@ -322,7 +323,7 @@ public void testStartBeyondRows() throws Exception {
//typed as time
assertEquals("[]", results.toString());
}
@Test
public void testTime() throws Exception {
VirtualFileConnection connection = Mockito.mock(VirtualFileConnection.class);
Expand All @@ -339,7 +340,10 @@ public void testTime() throws Exception {
assertEquals("[[10:12:14 AM]]", results.toString());


TimestampWithTimezone.resetCalendar(TimeZone.getTimeZone("America/New_York")); //$NON-NLS-1$
TimeZone timeZone = TimeZone.getTimeZone("America/New_York");
TimeZone defaultTz = TimeZone.getDefault();
TimestampWithTimezone.resetCalendar(timeZone); //$NON-NLS-1$
LocaleUtil.setUserTimeZone(timeZone);
try {
results = helpExecute(ddl, connection, "select \"time\" from Sheet1", false);
//typed as string without formatting - SQL / Teiid format
Expand All @@ -348,6 +352,7 @@ public void testTime() throws Exception {
assertEquals("[[1899-12-31 10:12:14.0]]", results.toString());
} finally {
TimestampWithTimezone.resetCalendar(null);
LocaleUtil.setUserTimeZone(defaultTz);
}
}

Expand Down

0 comments on commit dc17730

Please sign in to comment.