public void test() throws Exception {
try {
if (TEST_DATABASE) {
DbDataStore dds = new DbDataStore();
String dbPath = (testDir + "/db").replace('\\', '/');
// 3 sec
String url = "jdbc:h2:mem:" + dbPath + "/db";
// 4 sec
// String url = "jdbc:h2:" + dbPath + "/db";
// 26 sec
// String url = "jdbc:derby:" + dbPath + "/db";
new File(dbPath).mkdirs();
dds.setUrl(url + ";create=true");
dds.setUser("sa");
dds.setPassword("sa");
dds.setCopyWhenReading(false);
dds.init(dbPath);
// doTest(dds, 0);
doTestMultiThreaded(dds, 4);
dds.close();
shutdownDatabase(url);
FileUtils.deleteDirectory(testDir);
new File(dbPath).mkdirs();
dds = new DbDataStore();
dds.setUrl(url + ";create=true");
dds.setUser("sa");
dds.setPassword("sa");
dds.setCopyWhenReading(true);
dds.init(dbPath);
// doTest(dds, 0);
doTestMultiThreaded(dds, 4);
dds.close();
shutdownDatabase(url);
}
FileDataStore fds = new FileDataStore();
fds.init(testDir + "/file");