Clover Coverage Report - Liquibase Maven Plugin 2.0.2
Coverage timestamp: Wed Aug 3 2011 19:38:24 EDT
../../../../img/srcFileCovDistChart0.png 17% of files have more coverage
7   41   4   3.5
4   21   0.57   2
2     2  
1    
 
  LiquibaseUpdate       Line # 13 7 0% 4 13 0% 0.0
 
No Tests
 
1    package org.liquibase.maven.plugins;
2   
3    import liquibase.exception.LiquibaseException;
4    import liquibase.Liquibase;
5   
6    /**
7    * Applies the DatabaseChangeLogs to the database. Useful as part of the build process.
8    *
9    * @author Peter Murray
10    * @description Liquibase Update Maven plugin
11    * @goal update
12    */
 
13    public class LiquibaseUpdate extends AbstractLiquibaseUpdateMojo {
14   
15    /**
16    * Whether or not to perform a drop on the database before executing the change.
17    *
18    * @parameter expression="${liquibase.dropFirst}" default-value="false"
19    */
20    protected boolean dropFirst;
21   
 
22  0 toggle @Override
23    protected void doUpdate(Liquibase liquibase) throws LiquibaseException {
24  0 if (dropFirst) {
25  0 liquibase.dropAll();
26    }
27   
28  0 if (changesToApply > 0) {
29  0 liquibase.update(changesToApply, contexts);
30    } else {
31  0 liquibase.update(contexts);
32    }
33    }
34   
 
35  0 toggle @Override
36    protected void printSettings(String indent) {
37  0 super.printSettings(indent);
38  0 getLog().info(indent + "drop first? " + dropFirst);
39   
40    }
41    }