Clover Coverage Report - Liquibase Integration Tests 2.0.2
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
17   57   8   4.25
4   44   0.47   4
4     2  
1    
 
  AbstractMssqlIntegrationTest       Line # 14 17 0% 8 25 0% 0.0
 
No Tests
 
1    package liquibase.dbtest.mssql;
2   
3    import java.util.Date;
4    import liquibase.Liquibase;
5    import liquibase.dbtest.AbstractIntegrationTest;
6    import liquibase.exception.MigrationFailedException;
7    import liquibase.exception.ValidationFailedException;
8    import org.junit.Test;
9   
10    /**
11    *
12    * @author lujop
13    */
 
14    public abstract class AbstractMssqlIntegrationTest extends AbstractIntegrationTest{
15   
 
16  0 toggle public AbstractMssqlIntegrationTest(String changelogDir, String url) throws Exception {
17  0 super(changelogDir, url);
18    }
19   
 
20  0 toggle @Override
21    protected boolean shouldRollBack() {
22  0 return false;
23    }
24   
 
25  0 toggle @Test
26    public void smartDataLoad() throws Exception {
27  0 if (this.getDatabase() == null) {
28  0 return;
29    }
30  0 Liquibase liquibase = createLiquibase("changelogs/common/smartDataLoad.changelog.xml");
31  0 clearDatabase(liquibase);
32  0 try {
33  0 liquibase.update(this.contexts);
34    } catch (ValidationFailedException e) {
35  0 e.printDescriptiveError(System.out);
36  0 throw e;
37    }
38  0 try {
39  0 liquibase.rollback(new Date(0), this.contexts);
40    } catch (ValidationFailedException e) {
41  0 e.printDescriptiveError(System.out);
42  0 throw e;
43    }
44    }
45   
 
46  0 toggle @Override
47    //Mssql has problems with insert data in autoincrement tables. Because diff detects the id of that inserts and when it is ran the diff
48    //it tries to insert values in identity columns that isn't allowed in mssql
49    @Test(expected = MigrationFailedException.class)
50    public void testRerunDiffChangeLog() throws Exception {
51  0 if (getDatabase() == null) {
52  0 throw new MigrationFailedException();
53    }
54  0 super.testRerunDiffChangeLog();
55    }
56   
57    }