diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2008-04-22 15:09:38 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2008-04-22 15:09:38 +0000 |
commit | d2d14fe7ee6dad07eab83cc37c1bb5c0fa42aad6 (patch) | |
tree | ef040e515ac0d12f3d2fcdaeb2882bec6bb4fa8c /test/src/java/com | |
parent | e59184ffac6005b69d4f71155cc43ec3df2a0fd9 (diff) | |
download | jackcess-d2d14fe7ee6dad07eab83cc37c1bb5c0fa42aad6.tar.gz jackcess-d2d14fe7ee6dad07eab83cc37c1bb5c0fa42aad6.zip |
update unit tests to cover more of big index code; fix tail promotion/demotion
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@339 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'test/src/java/com')
-rw-r--r-- | test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java b/test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java index 1a7ab87..522148e 100644 --- a/test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java +++ b/test/src/java/com/healthmarketscience/jackcess/BigIndexTest.java @@ -89,7 +89,7 @@ public class BigIndexTest extends TestCase { DatabaseTest._autoSync = false; try { - String extraText = " some random text to fill out the index and make it fill up pages"; + String extraText = " some random text to fill out the index and make it fill up pages with lots of extra bytes so i will keep typing until i think that i probably have enough text in the index entry so that i do not need to add as many entries in order"; // copy to temp file and attempt to edit db = openCopy(origFile); @@ -137,9 +137,16 @@ public class BigIndexTest extends TestCase { ((BigIndex)index).validate(); - // remove all but the first two entries - Cursor cursor = new CursorBuilder(t).setIndex(index) - .afterLast().toCursor(); + // delete an entry in the middle + Cursor cursor = Cursor.createIndexCursor(t, index); + for(int i = 0; i < (rowCount / 2); ++i) { + assertTrue(cursor.moveToNextRow()); + } + cursor.deleteCurrentRow(); + --rowCount; + + // remove all but the first two entries (from the end) + cursor.afterLast(); for(int i = 0; i < (rowCount - 2); ++i) { assertTrue(cursor.moveToPreviousRow()); cursor.deleteCurrentRow(); @@ -193,19 +200,4 @@ public class BigIndexTest extends TestCase { } } -// public void testBigIndex2() throws Exception -// { -// File f = new File("test/data/databaseTest19731_ind.mdb"); -// Database db = open(f); -// Table t = db.getTable("test"); -// System.out.println("FOO reading index"); -// Index index = t.getIndexes().get(0); -// index.initialize(); -// index.forceInit(); -// index.validate(); -// System.out.println(index); -// db.close(); -// } - - } |