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");
DefaultSelectionPolicyType type =
new DefaultSelectionPolicyType();
type.addKeyword("k1");
type.addKeyword("k2");
type.complete();
descriptor.setPolicyType(type);
accessor.addPolicyDescriptor(connection, "selection", descriptor);
// Check the database contents
checkPolicyTypeRow(conn, null, "selection", 0, 0);
checkTypesRow(conn, null, 0, 4);
checkCategoryRow(conn, null, 0, "category");
checkTypesSelectionRow(conn, "KEYWORD='k1'", 0, "k1");
checkTypesSelectionRow(conn, "KEYWORD='k2'", 0, "k2");
connection.disconnect();
repository.terminate();
}
});
}