Clover Coverage Report - Liquibase Core 2.0.2
Coverage timestamp: Wed Aug 3 2011 19:29:16 EDT
../../../img/srcFileCovDistChart6.png 28% of files have more coverage
11   73   12   0.92
0   55   1.09   12
12     1  
1    
 
  ExampleCustomSqlChange       Line # 12 11 0% 12 10 56.5% 0.5652174
 
  (1)
 
1    package liquibase.change.custom;
2   
3    import liquibase.database.Database;
4    import liquibase.exception.RollbackImpossibleException;
5    import liquibase.exception.SetupException;
6    import liquibase.exception.UnsupportedChangeException;
7    import liquibase.exception.ValidationErrors;
8    import liquibase.resource.ResourceAccessor;
9    import liquibase.statement.SqlStatement;
10    import liquibase.statement.core.RawSqlStatement;
11   
 
12    public class ExampleCustomSqlChange implements CustomSqlChange, CustomSqlRollback {
13   
14    private String tableName;
15    private String columnName;
16    private String newValue;
17   
18    @SuppressWarnings({"UnusedDeclaration", "FieldCanBeLocal"})
19    private ResourceAccessor resourceAccessor;
20   
21   
 
22  1 toggle public String getTableName() {
23  1 return tableName;
24    }
25   
 
26  1 toggle public void setTableName(String tableName) {
27  1 this.tableName = tableName;
28    }
29   
 
30  1 toggle public String getColumnName() {
31  1 return columnName;
32    }
33   
 
34  1 toggle public void setColumnName(String columnName) {
35  1 this.columnName = columnName;
36    }
37   
 
38  0 toggle public String getNewValue() {
39  0 return newValue;
40    }
41   
 
42  0 toggle public void setNewValue(String newValue) {
43  0 this.newValue = newValue;
44    }
45   
 
46  1 toggle public SqlStatement[] generateStatements(Database database) {
47  1 return new SqlStatement[]{
48    new RawSqlStatement("update "+tableName+" set "+columnName+" = "+newValue)
49    };
50    }
51   
 
52  0 toggle public SqlStatement[] generateRollbackStatements(Database database) throws UnsupportedChangeException, RollbackImpossibleException {
53  0 return new SqlStatement[]{
54    new RawSqlStatement("update "+tableName+" set "+columnName+" = null")
55    };
56    }
57   
 
58  0 toggle public String getConfirmationMessage() {
59  0 return "Custom class updated "+tableName+"."+columnName;
60    }
61   
 
62  1 toggle public void setUp() throws SetupException {
63    }
64   
 
65  1 toggle public void setFileOpener(ResourceAccessor resourceAccessor) {
66  1 this.resourceAccessor = resourceAccessor;
67    }
68   
 
69  0 toggle public ValidationErrors validate(Database database) {
70  0 return new ValidationErrors();
71    }
72   
73    }