| 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 |
| 13 |
|
|
|
|
|
| 0% |
Uncovered Elements: 25 (25) |
Complexity: 8 |
Complexity Density: 0.47 |
|
| 14 |
|
public abstract class AbstractMssqlIntegrationTest extends AbstractIntegrationTest{ |
| 15 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 16 |
0
|
public AbstractMssqlIntegrationTest(String changelogDir, String url) throws Exception {... |
| 17 |
0
|
super(changelogDir, url); |
| 18 |
|
} |
| 19 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 20 |
0
|
@Override... |
| 21 |
|
protected boolean shouldRollBack() { |
| 22 |
0
|
return false; |
| 23 |
|
} |
| 24 |
|
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.33 |
4
-
|
|
| 25 |
0
|
@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 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
4
-
|
|
| 46 |
0
|
@Override... |
| 47 |
|
|
| 48 |
|
|
| 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 |
|
} |