@Test public void visit() throws Exception { Database database = createMock(Database.class); ChangeSet changeSet = createMock(ChangeSet.class); changeSet.rollback(database); expectLastCall(); database.removeRanStatus(changeSet); expectLastCall(); database.commit(); expectLastCall(); replay(changeSet); replay(database); RollbackVisitor visitor = new RollbackVisitor(database); visitor.visit(changeSet, new DatabaseChangeLog(), database); verify(database); verify(changeSet); }
public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) throws LiquibaseException { LogFactory.getLogger().info("Rolling Back Changeset:" + changeSet); changeSet.rollback(this.database); this.database.removeRanStatus(changeSet); this.database.commit(); }
RollbackVisitor implements ChangeSetVisitor { public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) throws LiquibaseException { LogFactory.getLogger().info("Rolling Back Changeset:" + changeSet); changeSet.rollback(this.database); this.database.removeRanStatus(changeSet); this.database.commit(); } }
RollbackVisitor implements ChangeSetVisitor { public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) throws LiquibaseException { LogFactory.getLogger().info("Rolling Back Changeset:" + changeSet); changeSet.rollback(this.database); this.database.removeRanStatus(changeSet); this.database.commit(); } RollbackVisitor(Database database); }
RollbackVisitor implements ChangeSetVisitor { public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) throws LiquibaseException { LogFactory.getLogger().info("Rolling Back Changeset:" + changeSet); changeSet.rollback(this.database); this.database.removeRanStatus(changeSet); this.database.commit(); } RollbackVisitor(Database database); Direction getDirection(); void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database); }
RollbackVisitor implements ChangeSetVisitor { public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database) throws LiquibaseException { LogFactory.getLogger().info("Rolling Back Changeset:" + changeSet); changeSet.rollback(this.database); this.database.removeRanStatus(changeSet); this.database.commit(); } RollbackVisitor(Database database); Direction getDirection(); void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database);  }