diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2008-04-15 02:57:56 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2008-04-15 02:57:56 +0000 |
commit | 6a5928f754b6cfab8022f0ea1ad4d066ce32cb02 (patch) | |
tree | 8c0cbd1be067da5b3e407f689ac7a0f38ed02a50 /test/src/java | |
parent | a341781aa419d9b6eec105dc8a5d59ff52138e41 (diff) | |
download | jackcess-6a5928f754b6cfab8022f0ea1ad4d066ce32cb02.tar.gz jackcess-6a5928f754b6cfab8022f0ea1ad4d066ce32cb02.zip |
clean up big index handling; get unit tests passing
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@327 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'test/src/java')
-rw-r--r-- | test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java b/test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java index 31485ea..fdca807 100644 --- a/test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java +++ b/test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java @@ -96,6 +96,8 @@ public class BigIndexTest extends TestCase { "this is some more row data " + nextInt); } + ((BigIndex)index).validate(); + db.flush(); t = db.getTable("Table1"); index = t.getIndex("CD_AGENTE"); @@ -118,6 +120,8 @@ public class BigIndexTest extends TestCase { assertEquals(10512, rowCount); + ((BigIndex)index).validate(); + // remove all but the first two entries Cursor cursor = new CursorBuilder(t).setIndex(index) .afterLast().toCursor(); @@ -126,7 +130,7 @@ public class BigIndexTest extends TestCase { cursor.deleteCurrentRow(); } -// System.out.println("FOO: " + index); + ((BigIndex)index).validate(); List<Integer> found = new ArrayList<Integer>(); for(Map<String,Object> row : Cursor.createIndexCursor(t, index)) { @@ -135,18 +139,17 @@ public class BigIndexTest extends TestCase { assertEquals(firstTwo, found); - // FIXME, last entry removal still borked // remove remaining entries -// cursor = Cursor.createCursor(t); -// for(int i = 0; i < 2; ++i) { -// assertTrue(cursor.moveToNextRow()); -// cursor.deleteCurrentRow(); -// } - -// assertFalse(cursor.moveToNextRow()); -// assertFalse(cursor.moveToPreviousRow()); + cursor = Cursor.createCursor(t); + for(int i = 0; i < 2; ++i) { + assertTrue(cursor.moveToNextRow()); + cursor.deleteCurrentRow(); + } + + assertFalse(cursor.moveToNextRow()); + assertFalse(cursor.moveToPreviousRow()); -// System.out.println("FOO: " + index); + ((BigIndex)index).validate(); db.close(); |