aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/java/com/healthmarketscience/jackcess
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2008-03-24 17:06:24 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2008-03-24 17:06:24 +0000
commitfefc08596f2fd8e2c51150d14d78b0caa417ed4e (patch)
tree388974750bc2d4e320feecc2ab83b39a70c03e8d /test/src/java/com/healthmarketscience/jackcess
parentd0c37f811ddea274b5860941d52456d2678d0aaa (diff)
downloadjackcess-fefc08596f2fd8e2c51150d14d78b0caa417ed4e.tar.gz
jackcess-fefc08596f2fd8e2c51150d14d78b0caa417ed4e.zip
Need to store auto-number values back into row so that indexes can be
updated correctly. git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@296 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'test/src/java/com/healthmarketscience/jackcess')
-rw-r--r--test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java b/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
index 90c57b1..5592e8c 100644
--- a/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
+++ b/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
@@ -169,7 +169,7 @@ public class DatabaseTest extends TestCase {
public void testGetNextRow() throws Exception {
Database db = open();
- assertEquals(2, db.getTableNames().size());
+ assertEquals(3, db.getTableNames().size());
Table table = db.getTable("Table1");
Map<String, Object> row = table.getNextRow();
@@ -702,6 +702,23 @@ public class DatabaseTest extends TestCase {
.addColumn(new ColumnBuilder("b", DataType.TEXT).toColumn())
.toTable(db);
+ doTestAutoNumber(table);
+
+ db.close();
+ }
+
+ public void testAutoNumberPK() throws Exception {
+ Database db = openCopy(new File("test/data/test.mdb"));
+
+ Table table = db.getTable("Table3");
+
+ doTestAutoNumber(table);
+
+ db.close();
+ }
+
+ private void doTestAutoNumber(Table table) throws Exception
+ {
table.addRow(null, "row1");
table.addRow(13, "row2");
table.addRow("flubber", "row3");
@@ -732,10 +749,8 @@ public class DatabaseTest extends TestCase {
"b", "row5"));
assertTable(expectedRows, table);
-
- db.close();
- }
-
+ }
+
public void testWriteAndReadDate() throws Exception {
Database db = create();