@Test
public void testLoader() throws Exception {

    ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    DbaConfiguration config = mapper.readValue(getClass().getResourceAsStream("/loader.yml"),
                                               DbaConfiguration.class);
    try (Connection dbaConnection = config.getDbaConnection()) {
        dbaConnection.setAutoCommit(true);
        dbaConnection.prepareStatement("DROP DATABASE IF EXISTS testme")
                     .execute();
        dbaConnection.prepareStatement("DROP ROLE IF EXISTS scott")
                     .execute();
    }
    config.dropDatabase = true;
    Loader loader = new Loader(config);
    try {
        loader.execute();
        loader.execute();
        loader.clear();
        loader.rollback();
    } finally {
        loader.dropDatabase();
    }
}