Package com.dbdeploy

Examples of com.dbdeploy.DbDeploy.go()


    public void execute() throws MojoExecutionException {
        DbDeploy dbDeploy = getConfiguredDbDeploy();

        try {
            dbDeploy.go();
        } catch (Exception e) {
            getLog().error(e);
            throw new MojoExecutionException("dbdeploy change script create failed", e);
        }
    }
View Full Code Here


    public void execute() throws MojoExecutionException {
        DbDeploy dbDeploy = getConfiguredDbDeploy();

        try {
            dbDeploy.go();
        } catch (Exception e) {
            getLog().error(e);
            throw new MojoExecutionException("dbdeploy update failed", e);
        }
    }
View Full Code Here

  public static void main(String[] args) {
    try {
      DbDeploy dbDeploy = new DbDeploy();
      commandLineParser.parse(args, dbDeploy);
      dbDeploy.go();
    } catch (UsageException ex) {
      System.err.println("ERROR: " + ex.getMessage());
      commandLineParser.printUsage();
    } catch (Exception ex) {
      System.err.println("Failed to apply changes: " + ex);
View Full Code Here

    DbDeploy dbDeploy = new DbDeploy();
    db.applyDatabaseSettingsTo(dbDeploy);
    dbDeploy.setScriptdirectory(findScriptDirectory("src/it/db/deltas"));
    dbDeploy.setOutputfile(outputFile);
    dbDeploy.go();

    db.applyScript(outputFile);

    assertThat(db.getChangelogEntries(), hasItems(1L, 2L));
View Full Code Here

    DbDeploy dbDeploy = new DbDeploy();
    db.applyDatabaseSettingsTo(dbDeploy);
    dbDeploy.setScriptdirectory(findScriptDirectory("src/it/db/invalid_deltas"));
    dbDeploy.setOutputfile(outputFile);
    dbDeploy.go();

    try {
      db.applyScript(outputFile);
    } catch (SQLException ex) {
      //expected
View Full Code Here

    assertThat(results.size(), is(0));

    // now run dbdeploy again with valid scripts, should recover
    dbDeploy.setScriptdirectory(findScriptDirectory("src/it/db/deltas"));
    dbDeploy.setOutputfile(outputFile);
    dbDeploy.go();

    db.applyScript(outputFile);

    assertThat(db.getChangelogEntries(), hasItems(1L, 2L));
View Full Code Here

        DbDeploy dbDeploy = new DbDeploy();
        db.applyDatabaseSettingsTo(dbDeploy);
        dbDeploy.setScriptdirectory(findScriptDirectory("src/it/db/deltas"));
        dbDeploy.setOutputfile(outputFile);
        dbDeploy.setChangeLogTableName("user_defined_changelog_table");
        dbDeploy.go();

        db.applyScript(outputFile);

        assertThat(db.getChangelogEntries(), hasItems(1L, 2L));
    }
View Full Code Here

    DbDeploy dbDeploy = new DbDeploy();
    db.applyDatabaseSettingsTo(dbDeploy);
    dbDeploy.setScriptdirectory(findScriptDirectory("src/it/db/high_numbers"));
    dbDeploy.setOutputfile(outputFile);
    dbDeploy.go();

    db.applyScript(outputFile);
  }

  private File findScriptDirectory(String directoryName) {
View Full Code Here

    db.createSchemaVersionTable();

    DbDeploy dbDeploy = new DbDeploy();
    db.applyDatabaseSettingsTo(dbDeploy);
    dbDeploy.setScriptdirectory(findScriptDirectory("src/it/db/deltas"));
    dbDeploy.go();

    assertThat(db.getChangelogEntries(), hasItems(1L, 2L));

    List<Object[]> results = db.executeQuery("select id from Test");
    assertThat(results.size(), is(1));
View Full Code Here

        db.createSchemaVersionTable();

        DbDeploy dbDeploy = new DbDeploy();
        db.applyDatabaseSettingsTo(dbDeploy);
        dbDeploy.setScriptdirectory(findScriptDirectory("src/it/db/multi_statement_deltas"));
        dbDeploy.go();

        assertThat(db.getChangelogEntries(), hasItems(1L, 2L));

        List<Object[]> results = db.executeQuery("select id from Test");
        assertThat(results.size(), is(2));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.