Coverage Report - liquibase.integration.ant.DatabaseRollbackFutureTask
 
Classes in this File Line Coverage Branch Coverage Complexity
DatabaseRollbackFutureTask
0%
0/15
0%
0/2
5
 
 1  
 package liquibase.integration.ant;
 2  
 
 3  
 import liquibase.Liquibase;
 4  
 import org.apache.tools.ant.BuildException;
 5  
 
 6  
 import java.io.Writer;
 7  
 
 8  
 /**
 9  
  * Ant task for rolling back a database.
 10  
  */
 11  0
 public class DatabaseRollbackFutureTask extends BaseLiquibaseTask {
 12  
 
 13  
     @Override
 14  
     public void execute() throws BuildException {
 15  0
         super.execute();
 16  
 
 17  0
         Liquibase liquibase = null;
 18  
         try {
 19  0
             Writer writer = createOutputWriter();
 20  0
             if (writer == null) {
 21  0
                 throw new BuildException("rollbackFutureDatabase requires outputFile to be set");
 22  
             }
 23  
 
 24  0
             liquibase = createLiquibase();
 25  
 
 26  0
             liquibase.futureRollbackSQL(getContexts(), writer);
 27  
 
 28  0
             writer.flush();
 29  0
             writer.close();
 30  0
         } catch (Exception e) {
 31  0
             throw new BuildException(e);
 32  
         } finally {
 33  0
             closeDatabase(liquibase);
 34  0
         }
 35  0
     }
 36  
 }