diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2006-07-24 15:17:13 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2006-07-24 15:17:13 +0000 |
commit | 2097e47024fc0703960ec347e17113c4968031d2 (patch) | |
tree | e876ef5a100354709b800df5a95322b83821cc6b /test | |
parent | cea5a6b7155ecd632800c3d7b3ce3218352a3019 (diff) | |
download | jackcess-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.mdb | bin | 118784 -> 135168 bytes | |||
-rw-r--r-- | test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/data/test.mdb b/test/data/test.mdb Binary files differindex f1e47ae..caae8af 100644 --- a/test/data/test.mdb +++ b/test/data/test.mdb 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(); |