1 |
|
package liquibase.change.core; |
2 |
|
|
3 |
|
import liquibase.change.AbstractChangeTest; |
4 |
|
import liquibase.database.core.MockDatabase; |
5 |
|
import liquibase.statement.SqlStatement; |
6 |
|
import liquibase.statement.core.DropViewStatement; |
7 |
|
import static org.junit.Assert.*; |
8 |
|
import org.junit.Test; |
9 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 3 |
Complexity Density: 0.25 |
|
10 |
|
public class DropViewChangeTest extends AbstractChangeTest { |
11 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
12 |
1
|
@Override... |
13 |
|
@Test |
14 |
|
public void getRefactoringName() throws Exception { |
15 |
1
|
assertEquals("Drop View", new DropViewChange().getChangeMetaData().getDescription()); |
16 |
|
} |
17 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1
PASS
|
|
18 |
1
|
@Override... |
19 |
|
@Test |
20 |
|
public void generateStatement() throws Exception { |
21 |
1
|
DropViewChange change = new DropViewChange(); |
22 |
1
|
change.setSchemaName("SCHEMA_NAME"); |
23 |
1
|
change.setViewName("VIEW_NAME"); |
24 |
|
|
25 |
1
|
SqlStatement[] sqlStatements = change.generateStatements(new MockDatabase()); |
26 |
1
|
assertEquals(1, sqlStatements.length); |
27 |
1
|
assertTrue(sqlStatements[0] instanceof DropViewStatement); |
28 |
1
|
assertEquals("SCHEMA_NAME", ((DropViewStatement) sqlStatements[0]).getSchemaName()); |
29 |
1
|
assertEquals("VIEW_NAME", ((DropViewStatement) sqlStatements[0]).getViewName()); |
30 |
|
} |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
32 |
1
|
@Override... |
33 |
|
@Test |
34 |
|
public void getConfirmationMessage() throws Exception { |
35 |
1
|
DropViewChange change = new DropViewChange(); |
36 |
1
|
change.setViewName("VIEW_NAME"); |
37 |
|
|
38 |
1
|
assertEquals("View VIEW_NAME dropped", change.getConfirmationMessage()); |
39 |
|
} |
40 |
|
} |