@Test
public void testSchemaGenIndex() throws Exception {
Path create = Paths.get("/tmp/create.sql");
assertTrue(Files.exists(create));
Path drop = Paths.get("/tmp/drop.sql");
assertTrue(Files.exists(create));
String line;
BufferedReader reader = Files.newBufferedReader(create, Charset.defaultCharset());
boolean createGenerated = false;
boolean createIndex = false;
while ((line = reader.readLine()) != null) {
if (line.toLowerCase().contains("create table employee_schema_gen_index")) {
createGenerated = true;
}
if (line.toLowerCase().contains("create index")) {
createIndex = true;
}
}
reader = Files.newBufferedReader(drop, Charset.defaultCharset());
boolean dropGenerated = false;
while ((line = reader.readLine()) != null) {
if (line.toLowerCase().contains("drop table employee_schema_gen_index")) {
dropGenerated = true;
break;
}
}
assertTrue(createGenerated);
assertTrue(createIndex);
assertTrue(dropGenerated);
}