/** * non-delegate method; calls deploy w/ the passed-in args. */ @Override public DbDeployerAppContext deploy() { return delegate.deploy(defaultArgs); }
/** * non-delegate method; calls deploy w/ the passed-in args. */ @Override public DbDeployerAppContext deploy() { return delegate.deploy(defaultArgs); }
@Override public DbDeployerAppContext deploy(MainDeployerArgs deployerArgs) { return delegate.deploy(deployerArgs); }
@Override public DbDeployerAppContext deploy(Collection<ChangeInput> changes, MainDeployerArgs deployerArgs) { return delegate.deploy(changes, deployerArgs); }
@Override public DbDeployerAppContext deploy(Collection<ChangeInput> changes) { return delegate.deploy(changes); }
@Override public DbDeployerAppContext deploy(Collection<ChangeInput> changes) { return delegate.deploy(changes); }
@Override public DbDeployerAppContext deploy(Collection<ChangeInput> changes, MainDeployerArgs deployerArgs) { return delegate.deploy(changes, deployerArgs); }
@Override public DbDeployerAppContext deploy(MainDeployerArgs deployerArgs) { return delegate.deploy(deployerArgs); }
@Override public void value(DbEnvironment dbEnvironment) { dbEnvironment.buildAppContext() .setupEnvInfra().cleanEnvironment() .deploy(); } });
@Test @Ignore("Ignoring re-deploy in the flow") public void testRedeploy() { File outputDir = new File("./target/outputReveng/final"); DbEnvironment prod = DbEnvironmentFactory.getInstance().readOneFromSourcePath(outputDir.getPath(), "prod"); prod.setCleanBuildAllowed(true); prod.buildAppContext("deploybuilddbo", "deploybuilddb0") .cleanEnvironment() .deploy(); } }
@Test public void testIQ_Ver_15_4() { DbDeployerAppContext dbDeployerAppContext = getAppContext.valueOf(1); dbDeployerAppContext .cleanEnvironment() .setupEnvInfra() .deploy(); // TODO add an assertion against the DB that a table did get created } }
@Test public void testIQ_Ver_15_4() { DbDeployerAppContext dbDeployerAppContext = getAppContext.valueOf(1); dbDeployerAppContext .cleanEnvironment() .setupEnvInfra() .deploy(); // TODO add an assertion against the DB that a table did get created } }
@Test @Ignore("Ignoring re-deploy in the flow") public void testRedeploy() { File outputDir = new File("./target/outputReveng/final"); DbEnvironment prod = DbEnvironmentFactory.getInstance().readOneFromSourcePath(outputDir.getPath(), "prod"); prod.setCleanBuildAllowed(true); prod.buildAppContext("deploybuilddbo", "deploybuilddb0") .cleanEnvironment() .deploy(); } }
@Test public void testDeploy() { // step 1 - deploy the tables with FKs DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/metadata-group/step1") .buildAppContext() .setupEnvInfra().cleanEnvironment() .deploy(); // step 2 - now deploy the metadata, ensure that the logic is fine DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/metadata-group/step2") .buildAppContext() .deploy(); } }
@Test(expected = DeployerRuntimeException.class) public void testNonAutoInitExpectFailure() { setupPreExistingEnvironmentForAutoInitTests(); // Now try rerunning the deploy when autoInitEnabled == false. This should fail as it tries to recreate an existing table DbEnvironment dbEnvironment = DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/initusecase/step1"); dbEnvironment.buildAppContext("abc", "abc").deploy(); // should fail here }
@Test public void testFailureDeploy() { DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/initusecase/step1") .buildAppContext("abc", "abc") .setupEnvInfra().cleanEnvironment() .deploy(); try { DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/initusecase/step2") .buildAppContext("abc", "abc") .deploy(); // don't do init this time fail("Expecting a failure here as we have changed the files w/out doing the -performInitOnly step"); } catch (IllegalArgumentException expected) { } }
@Test public void testThatDeploySucceedsWithWarningsIfGrantsFail() { DbDeployerAppContext dbDeployerAppContext = DbEnvironmentFactory.getInstance() .readOneFromSourcePath("scenariotests/permsynctest/step1") .buildAppContext() .setupEnvInfra().cleanEnvironment(); dbDeployerAppContext.deploy(); // TODO add validations around the grants } }
/** * builds a base environment w/ tables but without the audit table so that we can simulate the auto-init behavior. */ private void setupPreExistingEnvironmentForAutoInitTests() { DbDeployerAppContext dbDeployerAppContext = DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/initusecase/step1") .buildAppContext("abc", "abc"); dbDeployerAppContext.setupEnvInfra().cleanEnvironment() .deploy(); jdbc.update(conn, "DROP TABLE SCHEMA1.ARTIFACTDEPLOYMENT"); } }
@Ignore("Not yet trying this out") @Test public void verifyThatReverseEngineeredSqlCanBeDeployed() { DbEnvironment prod = DbEnvironmentFactory.getInstance().readOneFromSourcePath("./target/outputReveng", "prod"); prod.setCleanBuildAllowed(true); prod.buildAppContext("deploybuilddbo", "deploybuilddb0") .cleanEnvironment() .deploy(); } }
@Test public void testChangesetAppliedAtOnce() { DbDeployerAppContext dbDeployerAppContext = DbEnvironmentFactory.getInstance() .readOneFromSourcePath("scenariotests/changesetDeploy/step1") .buildAppContext() .setupEnvInfra().cleanEnvironment(); dbDeployerAppContext.deploy(new MainDeployerArgs().allChangesets(true)); checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true); checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true); checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", true); }