/** * API - check the database for compatibility with the given XML-DDL configuration. Additional add * all DDL in the scripts to the schema. * * @param options - list with options per script (may be empty) - corresponding to index in * 'scripts' * @param scripts - scripts for schema (Soll-Zustand) Der Ist-Zustand steht in der Datenbank und * wird mit dem Soll-Zustand verglichen. * @throws Exception */ public void checkDatabaseSchema(final List<Options> options, URL[] scripts) throws Exception { CatalogDescription expectedCatalog; DDLScriptSqlMetaFactory factory = getDDLScriptSqlMetaFactory(); int idx = 0; for (URL script : scripts) { Options option = options != null && options.size() > idx ? options.get(idx++) : null; factory.fillCatalog(script, option == null ? null : option.format); } expectedCatalog = factory.getCatalog(); if (expectedCatalog == null) { assertTrue("No expected Catalog: neither schemaconfig nor scripts given!", false); throwAssertions(); } else { CatalogDescription databaseCatalog = readDatabaseCatalog(expectedCatalog.getTableNames()); print("Checking Database Schema " + databaseCatalog.getSchemaName() + ".."); assertCatalogsComplete(expectedCatalog, databaseCatalog); print("Schema : Check OK"); } }