if (doCheck) {
checked = true;
// first check parsing (if an assert occurs here it means there is a discrepancy between toXml and parse
SqlInfoParser parser = new SqlInfoParser();
parser.init(info);
SqlInfo dbUpdateInfo = parser.parse(msg);
String createStatement = dbSpecific.getCreateTableStatement(dbUpdateInfo.getDescription(), null);
log.fine("=============================================");
log.fine(createStatement);
log.fine("=============================================");
String msg1 = dbUpdateInfo.toXml("");
log.fine("original message: " + message);
log.fine("parsed message: " + msg1);
int numOfCols = dbUpdateInfo.getDescription().getColumns().length;
assertTrue("Number of columns must be at least one (to detect that metadata is retrieved)", numOfCols > 0);
assertXMLEqual("Parsing of message is working correctly: output xml is not the same as input xml", msg, msg1);
TableToWatchInfo tableToWatch = new TableToWatchInfo();
tableToWatch.setActions("IDU");
String functionAndTrigger = dbSpecific.createTableTrigger(dbUpdateInfo.getDescription(), tableToWatch);
log.fine("-- ---------------------------------------------------------------------------");
log.fine(functionAndTrigger);
log.fine("-- ---------------------------------------------------------------------------");
// check now the creation of the table
String sql = "DROP TABLE TEST_CREATION";
try {
dbPool.update(sql);
}
catch (Exception e) {
}
dbUpdateInfo.getDescription().setIdentity("TEST_CREATION");
sql = dbSpecific.getCreateTableStatement(dbUpdateInfo.getDescription(), null);
try {
dbPool.update(sql);
}
catch (Exception ex) {
ex.printStackTrace();