diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/data/V1997/indexTestV1997.mdb | bin | 0 -> 112640 bytes | |||
-rw-r--r-- | test/src/java/com/healthmarketscience/jackcess/IndexTest.java | 20 | ||||
-rw-r--r-- | test/src/java/com/healthmarketscience/jackcess/RelationshipTest.java | 8 |
3 files changed, 23 insertions, 5 deletions
diff --git a/test/data/V1997/indexTestV1997.mdb b/test/data/V1997/indexTestV1997.mdb Binary files differnew file mode 100755 index 0000000..3441d23 --- /dev/null +++ b/test/data/V1997/indexTestV1997.mdb diff --git a/test/src/java/com/healthmarketscience/jackcess/IndexTest.java b/test/src/java/com/healthmarketscience/jackcess/IndexTest.java index 504a3b8..1738b07 100644 --- a/test/src/java/com/healthmarketscience/jackcess/IndexTest.java +++ b/test/src/java/com/healthmarketscience/jackcess/IndexTest.java @@ -112,8 +112,10 @@ public class IndexTest extends TestCase { checkIndexColumns(table, "id", "id", "PrimaryKey", "id", - "Table2Table1", "otherfk1", - "Table3Table1", "otherfk2"); + getRelationshipName(testDB.getExpectedFormat(), + "Table2Table1"), "otherfk1", + getRelationshipName(testDB.getExpectedFormat(), + "Table3Table1"), "otherfk2"); table = mdb.getTable("Table2"); for(Index idx : table.getIndexes()) { @@ -417,5 +419,17 @@ public class IndexTest extends TestCase { } } } - + + static String getRelationshipName(JetFormat format, String name) + { + if(format == JetFormat.VERSION_3) { + if(name.equals("Table2Table1")) { + return "{150B6687-5C64-4DC0-B934-A8CF92FF73FF}"; + } + if(name.equals("Table3Table1")) { + return "{D039E343-97A1-471F-B2E3-8DFCF1EEC597}"; + } + } + return name; + } } diff --git a/test/src/java/com/healthmarketscience/jackcess/RelationshipTest.java b/test/src/java/com/healthmarketscience/jackcess/RelationshipTest.java index 0311088..81c1fb0 100644 --- a/test/src/java/com/healthmarketscience/jackcess/RelationshipTest.java +++ b/test/src/java/com/healthmarketscience/jackcess/RelationshipTest.java @@ -54,7 +54,9 @@ public class RelationshipTest extends TestCase { List<Relationship> rels = db.getRelationships(t1, t2); assertEquals(1, rels.size()); Relationship rel = rels.get(0); - assertEquals("Table2Table1", rel.getName()); + assertEquals(IndexTest.getRelationshipName(testDB.getExpectedFormat(), + "Table2Table1"), + rel.getName()); assertEquals(t2, rel.getFromTable()); assertEquals(Arrays.asList(t2.getColumn("id")), rel.getFromColumns()); @@ -72,7 +74,9 @@ public class RelationshipTest extends TestCase { rels = db.getRelationships(t1, t3); assertEquals(1, rels.size()); rel = rels.get(0); - assertEquals("Table3Table1", rel.getName()); + assertEquals(IndexTest.getRelationshipName(testDB.getExpectedFormat(), + "Table3Table1"), + rel.getName()); assertEquals(t3, rel.getFromTable()); assertEquals(Arrays.asList(t3.getColumn("id")), rel.getFromColumns()); |