aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2018-12-11 02:07:56 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2018-12-11 02:07:56 +0000
commitabf32c90b101a0c1f76d89e8cdf80cd24e72f6c8 (patch)
treef7815eaf54d4389173c269e62b2ff391caf30613 /src/test
parent6626d6b28f21d550e5bde637ed3b9cea1806ab40 (diff)
downloadjackcess-abf32c90b101a0c1f76d89e8cdf80cd24e72f6c8.tar.gz
jackcess-abf32c90b101a0c1f76d89e8cdf80cd24e72f6c8.zip
initial support for LocalDateTime and Temporal types
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jdk8@1235 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java5
-rw-r--r--src/test/java/com/healthmarketscience/jackcess/TableTest.java22
2 files changed, 15 insertions, 12 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java b/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java
index 2ce343b..de6bd94 100644
--- a/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java
+++ b/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
@@ -990,7 +991,9 @@ public class DatabaseTest extends TestCase
{
ColumnImpl col = new ColumnImpl(null, null, DataType.SHORT_DATE_TIME, 0, 0, 0) {
@Override
- protected Calendar getCalendar() { return Calendar.getInstance(tz); }
+ protected TimeZone getTimeZone() { return tz; }
+ @Override
+ protected ZoneId getZoneId() { return null; }
};
SimpleDateFormat df = new SimpleDateFormat("yyyy.MM.dd");
diff --git a/src/test/java/com/healthmarketscience/jackcess/TableTest.java b/src/test/java/com/healthmarketscience/jackcess/TableTest.java
index 339ba39..3bc2dbd 100644
--- a/src/test/java/com/healthmarketscience/jackcess/TableTest.java
+++ b/src/test/java/com/healthmarketscience/jackcess/TableTest.java
@@ -21,8 +21,8 @@ import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Calendar;
import java.util.List;
+import java.util.TimeZone;
import com.healthmarketscience.jackcess.impl.ColumnImpl;
import com.healthmarketscience.jackcess.impl.JetFormat;
@@ -40,8 +40,8 @@ public class TableTest extends TestCase {
private TestTable _testTable;
private int _varLenIdx;
private int _fixedOffset;
-
-
+
+
public TableTest(String name) {
super(name);
}
@@ -52,14 +52,14 @@ public class TableTest extends TestCase {
_varLenIdx = 0;
_fixedOffset = 0;
}
-
+
public void testCreateRow() throws Exception {
reset();
newTestColumn(DataType.INT, false);
newTestColumn(DataType.TEXT, false);
newTestColumn(DataType.TEXT, false);
newTestTable();
-
+
int colCount = _columns.size();
ByteBuffer buffer = createRow(9, "Tim", "McCune");
@@ -91,10 +91,10 @@ public class TableTest extends TestCase {
newTestColumn(DataType.TEXT, true);
newTestColumn(DataType.TEXT, true);
newTestTable();
-
+
ByteBuffer[] bufCmp1 = encodeColumns(small, large);
ByteBuffer[] bufCmp2 = encodeColumns(smallNotAscii, largeNotAscii);
-
+
assertEquals(buf1[0].remaining(),
(bufCmp1[0].remaining() + small.length() - 2));
assertEquals(buf1[1].remaining(),
@@ -111,7 +111,7 @@ public class TableTest extends TestCase {
}
- private ByteBuffer createRow(Object... row)
+ private ByteBuffer createRow(Object... row)
throws IOException
{
return _testTable.createRow(row);
@@ -146,7 +146,7 @@ public class TableTest extends TestCase {
return b;
}
- private TableImpl newTestTable()
+ private TableImpl newTestTable()
throws Exception
{
_testTable = new TestTable();
@@ -185,8 +185,8 @@ public class TableTest extends TestCase {
return getFormat().CHARSET;
}
@Override
- protected Calendar getCalendar() {
- return Calendar.getInstance();
+ protected TimeZone getTimeZone() {
+ return TimeZone.getDefault();
}
@Override
public boolean isCompressedUnicode() {