// Use the in-memory hypersonic db - no background threads!
final HypersonicManager hypersonicMgr = new HypersonicManager(
HypersonicManager.IN_MEMORY_SOURCE);
hypersonicMgr.useCleanupWith(new Executor() {
public void execute() throws Exception {
InternalJDBCRepository repository = createRepository(
hypersonicMgr.getSource(), null, "#dp");
JDBCRepositoryConnection connection =
(JDBCRepositoryConnection) repository.connect();
JDBCDeviceRepositoryAccessor accessor =
new JDBCDeviceRepositoryAccessor(repository, location);
Connection conn = connection.getConnection();
createTables(conn);
DefaultPolicyDescriptor descriptor =
new DefaultPolicyDescriptor();
descriptor.setCategory("category");
PolicyType type = new DefaultBooleanPolicyType();
descriptor.setPolicyType(type);
accessor.addPolicyDescriptor(connection, "boolean", descriptor);
// Check the database contents
checkPolicyTypeRow(conn, null, "boolean", 0, 0);
checkTypesRow(conn, null, 0, 0);
checkCategoryRow(conn, null, 0, "category");
connection.disconnect();
repository.terminate();
}
});
}