com.healthmarketscience.jackcess
Class TestUtil
java.lang.Object
com.healthmarketscience.jackcess.TestUtil
public class TestUtil
- extends Object
Utilty code for the test cases.
- Author:
- James Ahlborn
Method Summary |
static void |
assertCursor(List<? extends Map<String,Object>> expectedTable,
Cursor cursor)
|
static void |
assertTable(List<? extends Map<String,Object>> expectedTable,
Table table)
|
static void |
clearTableCache(Database db)
|
static int |
countRows(Table table)
|
static Database |
create(Database.FileFormat fileFormat)
|
static Database |
create(Database.FileFormat fileFormat,
boolean keep)
|
static RowImpl |
createExpectedRow(Object... rowElements)
|
static List<Row> |
createExpectedTable(Row... rows)
|
static Database |
createMem(Database.FileFormat fileFormat)
|
static String |
createString(int len)
|
static Object[] |
createTestRow()
|
static void |
createTestTable(Database db)
|
static void |
dumpDatabase(Database mdb)
|
static void |
dumpDatabase(Database mdb,
boolean systemTables)
|
static void |
dumpTable(Table table)
|
static Database |
open(Database.FileFormat fileFormat,
File file)
|
static Database |
open(Database.FileFormat fileFormat,
File file,
boolean inMem)
|
static Database |
open(JetFormatTest.TestDB testDB)
|
static Database |
openCopy(Database.FileFormat fileFormat,
File file)
|
static Database |
openCopy(Database.FileFormat fileFormat,
File file,
boolean keep)
|
static Database |
openCopy(JetFormatTest.TestDB testDB)
|
static Database |
openCopy(JetFormatTest.TestDB testDB,
boolean keep)
|
static Database |
openMem(JetFormatTest.TestDB testDB)
|
static byte[] |
toByteArray(File file)
|
static byte[] |
toByteArray(InputStream in,
long length)
|
TEST_TZ
public static final TimeZone TEST_TZ
open
public static Database open(Database.FileFormat fileFormat,
File file)
throws Exception
- Throws:
Exception
open
public static Database open(Database.FileFormat fileFormat,
File file,
boolean inMem)
throws Exception
- Throws:
Exception
open
public static Database open(JetFormatTest.TestDB testDB)
throws Exception
- Throws:
Exception
openMem
public static Database openMem(JetFormatTest.TestDB testDB)
throws Exception
- Throws:
Exception
create
public static Database create(Database.FileFormat fileFormat)
throws Exception
- Throws:
Exception
create
public static Database create(Database.FileFormat fileFormat,
boolean keep)
throws Exception
- Throws:
Exception
createMem
public static Database createMem(Database.FileFormat fileFormat)
throws Exception
- Throws:
Exception
openCopy
public static Database openCopy(JetFormatTest.TestDB testDB)
throws Exception
- Throws:
Exception
openCopy
public static Database openCopy(JetFormatTest.TestDB testDB,
boolean keep)
throws Exception
- Throws:
Exception
openCopy
public static Database openCopy(Database.FileFormat fileFormat,
File file)
throws Exception
- Throws:
Exception
openCopy
public static Database openCopy(Database.FileFormat fileFormat,
File file,
boolean keep)
throws Exception
- Throws:
Exception
createTestRow
public static Object[] createTestRow()
createTestTable
public static void createTestTable(Database db)
throws Exception
- Throws:
Exception
createString
public static String createString(int len)
countRows
public static int countRows(Table table)
throws Exception
- Throws:
Exception
assertTable
public static void assertTable(List<? extends Map<String,Object>> expectedTable,
Table table)
throws IOException
- Throws:
IOException
assertCursor
public static void assertCursor(List<? extends Map<String,Object>> expectedTable,
Cursor cursor)
createExpectedRow
public static RowImpl createExpectedRow(Object... rowElements)
createExpectedTable
public static List<Row> createExpectedTable(Row... rows)
dumpDatabase
public static void dumpDatabase(Database mdb)
throws Exception
- Throws:
Exception
dumpDatabase
public static void dumpDatabase(Database mdb,
boolean systemTables)
throws Exception
- Throws:
Exception
dumpTable
public static void dumpTable(Table table)
throws Exception
- Throws:
Exception
clearTableCache
public static void clearTableCache(Database db)
throws Exception
- Throws:
Exception
toByteArray
public static byte[] toByteArray(File file)
throws IOException
- Throws:
IOException
toByteArray
public static byte[] toByteArray(InputStream in,
long length)
throws IOException
- Throws:
IOException
Copyright © 2005-2015 Health Market Science. All Rights Reserved.