diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2016-03-21 02:15:47 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2016-03-21 02:15:47 +0000 |
commit | 914e5af35c01d96754b9aa267c1ed4ff4062d43c (patch) | |
tree | f0789ad64d54353f2070d0aa689fcabd00c36e1b /src/test | |
parent | 4e5fe7ec04eff9ea4e64a8c6d1e3f7fd51257e06 (diff) | |
download | jackcess-914e5af35c01d96754b9aa267c1ed4ff4062d43c.tar.gz jackcess-914e5af35c01d96754b9aa267c1ed4ff4062d43c.zip |
Allow null values in foreign key fields when enforcing referential integrity. Fixes issue #136
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@980 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/healthmarketscience/jackcess/impl/FKEnforcerTest.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/FKEnforcerTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/FKEnforcerTest.java index c3150ea..2567f12 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/FKEnforcerTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/FKEnforcerTest.java @@ -102,6 +102,8 @@ public class FKEnforcerTest extends TestCase assertTrue(ignored.getMessage().contains("Table3[id]")); } + t1.addRow(21, null, null, "null fks", null); + Cursor c = CursorBuilder.createCursor(t3); Column col = t3.getColumn("id"); for(Row row : c) { @@ -115,7 +117,8 @@ public class FKEnforcerTest extends TestCase createT1Row(0, 0, 30, "baz0", 0), createT1Row(1, 1, 31, "baz11", 0), createT1Row(2, 1, 31, "baz11-2", 0), - createT1Row(3, 2, 33, "baz13", 0)); + createT1Row(3, 2, 33, "baz13", 0), + createT1Row(21, null, null, "null fks", null)); assertTable(expectedRows, t1); @@ -125,7 +128,7 @@ public class FKEnforcerTest extends TestCase iter.remove(); } - assertEquals(0, t1.getRowCount()); + assertEquals(1, t1.getRowCount()); db.close(); } @@ -133,7 +136,7 @@ public class FKEnforcerTest extends TestCase } private static Row createT1Row( - int id1, int fk1, int fk2, String data, int fk3) + int id1, Integer fk1, Integer fk2, String data, Integer fk3) { return createExpectedRow("id", id1, "otherfk1", fk1, "otherfk2", fk2, "data", data, "otherfk3", fk3); |