01: package liquibase.parser.visitor;
02:
03: import liquibase.ChangeSet;
04: import liquibase.database.Database;
05: import static org.easymock.EasyMock.expectLastCall;
06: import static org.easymock.classextension.EasyMock.*;
07: import org.junit.Test;
08:
09: public class RollbackVisitorTest {
10: @Test
11: public void visit() throws Exception {
12: Database database = createMock(Database.class);
13:
14: ChangeSet changeSet = createMock(ChangeSet.class);
15: changeSet.rolback(database);
16: expectLastCall();
17:
18: database.removeRanStatus(changeSet);
19: expectLastCall();
20:
21: database.commit();
22: expectLastCall();
23:
24: replay(changeSet);
25: replay(database);
26:
27: RollbackVisitor visitor = new RollbackVisitor(database);
28: visitor.visit(changeSet);
29:
30: verify(database);
31: verify(changeSet);
32: }
33: }
|