summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2006-07-24 15:17:13 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2006-07-24 15:17:13 +0000
commit2097e47024fc0703960ec347e17113c4968031d2 (patch)
treee876ef5a100354709b800df5a95322b83821cc6b /test
parentcea5a6b7155ecd632800c3d7b3ce3218352a3019 (diff)
downloadjackcess-2097e47024fc0703960ec347e17113c4968031d2.tar.gz
jackcess-2097e47024fc0703960ec347e17113c4968031d2.zip
add index primary key info; possibly fix some bugs around reading indexes (or possibly introduce)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@66 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'test')
-rw-r--r--test/data/test.mdbbin118784 -> 135168 bytes
-rw-r--r--test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java15
2 files changed, 15 insertions, 0 deletions
diff --git a/test/data/test.mdb b/test/data/test.mdb
index f1e47ae..caae8af 100644
--- a/test/data/test.mdb
+++ b/test/data/test.mdb
Binary files differ
diff --git a/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java b/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
index 84f5a22..2dba448 100644
--- a/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
+++ b/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
@@ -7,6 +7,7 @@ import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -233,6 +234,20 @@ public class DatabaseTest extends TestCase {
}
assertTrue(!bogusFile.exists());
}
+
+ public void testPrimaryKey() throws Exception {
+ Table table = open().getTable("Table1");
+ Map<String, Boolean> foundPKs = new HashMap<String, Boolean>();
+ for(Index index : table.getIndexes()) {
+ System.out.println(index);
+ foundPKs.put(index.getColumns().iterator().next().getName(),
+ index.isPrimaryKey());
+ }
+ Map<String, Boolean> expectedPKs = new HashMap<String, Boolean>();
+ expectedPKs.put("A", Boolean.TRUE);
+ expectedPKs.put("B", Boolean.FALSE);
+ assertEquals(expectedPKs, foundPKs);
+ }
private int countRows(Table table) throws Exception {
table.reset();