Skip to content

Commit

Permalink
Test time zone - try to fix issue with running in non-UTC time zones (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored Oct 28, 2021
1 parent f01f403 commit 938c560
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ dependencies {
testRuntimeOnly 'org.slf4j:slf4j-simple:1.7.32'
}

test {
options {
systemProperties(System.getProperties())
}
}

java {
withJavadocJar()
withSourcesJar()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import javax.xml.stream.XMLEventReader;
import java.io.FileInputStream;
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.util.Date;

public class StreamingSheetReaderTest {
@Test
Expand All @@ -28,7 +26,7 @@ public void testStrictDates() throws Exception {
Assert.assertEquals("2021-02-28", firstRow.getCell(0).getStringCellValue());
Assert.assertEquals(LocalDate.parse("2021-02-28").atStartOfDay(),
firstRow.getCell(0).getLocalDateTimeCellValue());
Assert.assertEquals(Date.from(LocalDate.parse("2021-02-28").atStartOfDay().toInstant(ZoneOffset.UTC)),
Assert.assertEquals(java.sql.Date.valueOf(LocalDate.parse("2021-02-28")),
firstRow.getCell(0).getDateCellValue());
Assert.assertEquals(CellType.NUMERIC, firstRow.getCell(1).getCellType());
Assert.assertEquals("12:00:00.000", firstRow.getCell(1).getStringCellValue());
Expand Down

0 comments on commit 938c560

Please sign in to comment.