diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2019-02-06 01:14:51 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2019-02-06 01:14:51 +0000 |
commit | d231efd46cd5f1e4c5c0fff850e10f860b7fced2 (patch) | |
tree | 184d70f9ca54fb22cdda8e600a505c0ec0d70f57 /src/test/java/com/healthmarketscience/jackcess/impl/DatabaseReadWriteTest.java | |
parent | 67240a9bb59b3ddf05ce3833fde27de7d38b6ca5 (diff) | |
parent | 116fad0ad42bf89867091710d64ef8ef5d4ee0d4 (diff) | |
download | jackcess-d231efd46cd5f1e4c5c0fff850e10f860b7fced2.tar.gz jackcess-d231efd46cd5f1e4c5c0fff850e10f860b7fced2.zip |
merge branch jdk8 changes through r1279
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1280 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test/java/com/healthmarketscience/jackcess/impl/DatabaseReadWriteTest.java')
-rw-r--r-- | src/test/java/com/healthmarketscience/jackcess/impl/DatabaseReadWriteTest.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/DatabaseReadWriteTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/DatabaseReadWriteTest.java index 561f1e8..104b266 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/DatabaseReadWriteTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/DatabaseReadWriteTest.java @@ -16,6 +16,9 @@ limitations under the License. package com.healthmarketscience.jackcess.impl; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneOffset; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -53,7 +56,7 @@ public class DatabaseReadWriteTest extends TestCase db.close(); } } - + public void testWriteAndReadInMem() throws Exception { for (final FileFormat fileFormat : SUPPORTED_FILEFORMATS) { Database db = createMem(fileFormat); @@ -61,7 +64,7 @@ public class DatabaseReadWriteTest extends TestCase db.close(); } } - + private static void doTestWriteAndRead(Database db) throws Exception { createTestTable(db); Object[] row = createTestRow(); @@ -117,7 +120,7 @@ public class DatabaseReadWriteTest extends TestCase } } - public void testUpdateRow() throws Exception + public void testUpdateRow() throws Exception { for (final FileFormat fileFormat : SUPPORTED_FILEFORMATS) { Database db = createMem(fileFormat); @@ -250,11 +253,18 @@ public class DatabaseReadWriteTest extends TestCase final long timeRange = 100000000L; final long timeStep = 37L; - for(long time = testTime - timeRange; time < testTime + timeRange; + for(long time = testTime - timeRange; time < testTime + timeRange; time += timeStep) { double accTime = ColumnImpl.toLocalDateDouble(time); long newTime = ColumnImpl.fromLocalDateDouble(accTime); assertEquals(time, newTime); + + Instant inst = Instant.ofEpochMilli(time); + LocalDateTime ldt = LocalDateTime.ofInstant(inst, ZoneOffset.UTC); + + accTime = ColumnImpl.toDateDouble(ldt); + LocalDateTime newLdt = ColumnImpl.ldtFromLocalDateDouble(accTime); + assertEquals(ldt, newLdt); } } } |