From 4920d75eeecf1f064403c567deb8f2d8c0ac2839 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Sun, 26 Apr 2015 19:13:29 +0000 Subject: use inmem dbs to speed up slow unit tests git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@937 f203690c-595d-4dc9-a70b-905162fa7fd2 --- src/test/java/com/healthmarketscience/jackcess/CursorTest.java | 8 ++++---- src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/test/java/com') diff --git a/src/test/java/com/healthmarketscience/jackcess/CursorTest.java b/src/test/java/com/healthmarketscience/jackcess/CursorTest.java index a75c59a..7834d18 100644 --- a/src/test/java/com/healthmarketscience/jackcess/CursorTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/CursorTest.java @@ -85,7 +85,7 @@ public class CursorTest extends TestCase { private static Database createTestTable(final FileFormat fileFormat) throws Exception { - Database db = create(fileFormat); + Database db = createMem(fileFormat); Table table = new TableBuilder("test") .addColumn(new ColumnBuilder("id", DataType.LONG)) @@ -143,7 +143,7 @@ public class CursorTest extends TestCase { private static Database createDupeTestTable(final FileFormat fileFormat) throws Exception { - Database db = create(fileFormat); + Database db = createMem(fileFormat); Table table = new TableBuilder("test") .addColumn(new ColumnBuilder("id", DataType.LONG)) @@ -1069,7 +1069,7 @@ public class CursorTest extends TestCase { { for (final TestDB testDB : TestDB.getSupportedForBasename(Basename.INDEX)) { - Database db = open(testDB); + Database db = openMem(testDB); Table t1 = db.getTable("Table1"); Index idx = t1.getIndex(IndexBuilder.PRIMARY_KEY_NAME); IndexCursor cursor = CursorBuilder.createCursor(idx); @@ -1278,7 +1278,7 @@ public class CursorTest extends TestCase { public void testIterationEarlyExit() throws Exception { for (final FileFormat fileFormat : JetFormatTest.SUPPORTED_FILEFORMATS) { - Database db = create(fileFormat); + Database db = createMem(fileFormat); Table table = new TableBuilder("test") .addColumn(new ColumnBuilder("id", DataType.LONG)) diff --git a/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java b/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java index 0752fec..b78d7ff 100644 --- a/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java @@ -390,7 +390,7 @@ public class DatabaseTest extends TestCase public void testWriteAndReadInBatch() throws Exception { for (final FileFormat fileFormat : SUPPORTED_FILEFORMATS) { - Database db = create(fileFormat); + Database db = createMem(fileFormat); createTestTable(db); int count = 1000; List rows = new ArrayList(count); @@ -1203,7 +1203,7 @@ public class DatabaseTest extends TestCase public void testUpdateRow() throws Exception { for (final FileFormat fileFormat : SUPPORTED_FILEFORMATS) { - Database db = create(fileFormat); + Database db = createMem(fileFormat); Table t = new TableBuilder("test") .addColumn(new ColumnBuilder("name", DataType.TEXT)) @@ -1528,7 +1528,7 @@ public class DatabaseTest extends TestCase public void testUnicodeCompression() throws Exception { File dbFile = new File("src/test/data/V2003/testUnicodeCompV2003.mdb"); - Database db = open(Database.FileFormat.V2003, new File("src/test/data/V2003/testUnicodeCompV2003.mdb")); + Database db = open(Database.FileFormat.V2003, new File("src/test/data/V2003/testUnicodeCompV2003.mdb"), true); StringBuilder sb = new StringBuilder(127); for(int i = 1; i <= 0xFF; ++i) { -- cgit v1.2.3