}
static Database open() throws Exception {
- return Database.open(new File("test/data/test.mdb"));
+ return open(new File("test/data/test.mdb"));
+ }
+
+ static Database open(File file) throws Exception {
+ return Database.open(file, true, Database.DEFAULT_AUTO_SYNC);
}
static Database create() throws Exception {
}
public void testReadDeletedRows() throws Exception {
- Table table = Database.open(new File("test/data/delTest.mdb")).getTable("Table");
+ Table table = open(new File("test/data/delTest.mdb")).getTable("Table");
int rows = 0;
while (table.getNextRow() != null) {
rows++;
public void testReadLongValue() throws Exception {
- Database db = Database.open(new File("test/data/test2.mdb"));
+ Database db = open(new File("test/data/test2.mdb"));
Table table = db.getTable("MSP_PROJECTS");
Map<String, Object> row = table.getNextRow();
assertEquals("Jon Iles this is a a vawesrasoih aksdkl fas dlkjflkasjd flkjaslkdjflkajlksj dfl lkasjdf lkjaskldfj lkas dlk lkjsjdfkl; aslkdf lkasjkldjf lka skldf lka sdkjfl;kasjd falksjdfljaslkdjf laskjdfk jalskjd flkj aslkdjflkjkjasljdflkjas jf;lkasjd fjkas dasdf asd fasdf asdf asdmhf lksaiyudfoi jasodfj902384jsdf9 aw90se fisajldkfj lkasj dlkfslkd jflksjadf as", row.get("PROJ_PROP_AUTHOR"));
File bogusFile = new File("fooby-dooby.mdb");
assertTrue(!bogusFile.exists());
try {
- Database db = Database.open(bogusFile);
+ Database db = open(bogusFile);
fail("FileNotFoundException should have been thrown");
} catch(FileNotFoundException e) {
}
}
public void testReadWithDeletedCols() throws Exception {
- Table table = Database.open(new File("test/data/delColTest.mdb")).getTable("Table1");
+ Table table = open(new File("test/data/delColTest.mdb")).getTable("Table1");
Map<String, Object> expectedRow0 = new LinkedHashMap<String, Object>();
expectedRow0.put("id", 0);
public void testOverflow() throws Exception
{
- Database mdb = Database.open(new File("test/data/overflowTest.mdb"));
+ Database mdb = open(new File("test/data/overflowTest.mdb"));
Table table = mdb.getTable("Table1");
// 7 rows, 3 and 5 are overflow
public void testIndexCodes() throws Exception
{
- Database db = Database.open(new File("test/data/testIndexCodes.mdb"));
+ Database db = open(new File("test/data/testIndexCodes.mdb"));
for(Table t : db) {
for(Index index : t.getIndexes()) {
public void x_testReadIsoMdb() throws Exception
{
-// Database db = Database.open(new File("/tmp/test_ind.mdb"));
-// Database db = Database.open(new File("/tmp/test_ind2.mdb"));
- Database db = Database.open(new File("/tmp/test_ind3.mdb"));
-// Database db = Database.open(new File("/tmp/test_ind4.mdb"));
+// Database db = open(new File("/tmp/test_ind.mdb"));
+// Database db = open(new File("/tmp/test_ind2.mdb"));
+ Database db = open(new File("/tmp/test_ind3.mdb"));
+// Database db = open(new File("/tmp/test_ind4.mdb"));
Table t = db.getTable("Table1");
Index index = t.getIndex("B");
public void x_testReverseIsoMdb() throws Exception
{
-// Database db = Database.open(new File("/tmp/test_ind.mdb"));
- Database db = Database.open(new File("/tmp/test_ind2.mdb"));
-// Database db = Database.open(new File("/tmp/databaseTest14366_ind.mdb"));
-// Database db = Database.open(new File("/tmp/databaseTest56165_ind.mdb"));
-// Database db = Database.open(new File("/tmp/databaseTest53970_ind.mdb"));
+// Database db = open(new File("/tmp/test_ind.mdb"));
+ Database db = open(new File("/tmp/test_ind2.mdb"));
+// Database db = open(new File("/tmp/databaseTest14366_ind.mdb"));
+// Database db = open(new File("/tmp/databaseTest56165_ind.mdb"));
+// Database db = open(new File("/tmp/databaseTest53970_ind.mdb"));
Table t = db.getTable("Table1");
Index index = t.getIndex("B");
public void testIndexSlots() throws Exception
{
- Database mdb = Database.open(new File("test/data/indexTest.mdb"));
+ Database mdb = open(new File("test/data/indexTest.mdb"));
Table table = mdb.getTable("Table1");
for(Index idx : table.getIndexes()) {
{
// this file has an index with "compressed" entries and node pages
File origFile = new File("test/data/compIndexTest.mdb");
- Database db = Database.open(origFile);
+ Database db = open(origFile);
Table t = db.getTable("Table1");
Index index = t.getIndexes().get(0);
assertFalse(index.isInitialized());