1 |
|
package liquibase.statementexecute; |
2 |
|
|
3 |
|
import liquibase.database.*; |
4 |
|
import liquibase.database.core.*; |
5 |
|
import liquibase.statement.SqlStatement; |
6 |
|
import liquibase.statement.core.CreateDatabaseChangeLogLockTableStatement; |
7 |
|
|
8 |
|
import java.util.List; |
9 |
|
|
10 |
|
import org.junit.Test; |
11 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
|
12 |
|
public class CreateDatabaseChangeLogLockTableExecuteTest extends AbstractExecuteTest { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
13 |
0
|
@Override... |
14 |
|
protected List<? extends SqlStatement> setupStatements(Database database) { |
15 |
0
|
return null; |
16 |
|
} |
17 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
4
-
|
|
18 |
0
|
@Test... |
19 |
|
public void generate() throws Exception { |
20 |
0
|
this.statementUnderTest = new CreateDatabaseChangeLogLockTableStatement(); |
21 |
|
|
22 |
0
|
assertCorrect(new String[]{"create table [databasechangeloglock] (" + |
23 |
|
"[id] int not null, " + |
24 |
|
"[locked] boolean not null, " + |
25 |
|
"[lockgranted] datetime, " + |
26 |
|
"[lockedby] text, " + |
27 |
|
"constraint [pk_databasechangeloglock] primary key ([id]))", |
28 |
|
"insert into [databasechangeloglock] ([id], [locked]) values (1, 0)"}, SQLiteDatabase.class); |
29 |
|
|
30 |
0
|
assertCorrect(new String[]{"create table [databasechangeloglock] (" + |
31 |
|
"[id] int not null, " + |
32 |
|
"[locked] bit not null, " + |
33 |
|
"[lockgranted] datetime null, " + |
34 |
|
"[lockedby] varchar(255) null, " + |
35 |
|
"constraint [pk_databasechangeloglock] primary key ([id]))", |
36 |
|
"insert into [databasechangeloglock] ([id], [locked]) values (1, 0)"}, SybaseDatabase.class, SybaseASADatabase.class); |
37 |
|
|
38 |
0
|
assertCorrect(new String[]{"create table [databasechangeloglock] (" + |
39 |
|
"[id] int not null primary key, " + |
40 |
|
"[locked] boolean not null, " + |
41 |
|
"[lockgranted] datetime, " + |
42 |
|
"[lockedby] varchar(255))", |
43 |
|
"insert into [databasechangeloglock] ([id], [locked]) values (1, 'f')"}, InformixDatabase.class); |
44 |
|
|
45 |
0
|
assertCorrect(new String[]{"create table [dbo].[databasechangeloglock] (" + |
46 |
|
"[id] int not null, " + |
47 |
|
"[locked] boolean not null, " + |
48 |
|
"[lockgranted] datetime, " + |
49 |
|
"[lockedby] varchar(255), " + |
50 |
|
"constraint [pk_databasechangeloglock] primary key ([id]))", |
51 |
|
"insert into [dbo].[databasechangeloglock] ([id], [locked]) values (1, 0)"}, MSSQLDatabase.class); |
52 |
|
|
53 |
0
|
assertCorrect(new String[]{"create table [databasechangeloglock] (" + |
54 |
|
"[id] int not null, " + |
55 |
|
"[locked] smallint not null, " + |
56 |
|
"[lockgranted] timestamp, " + |
57 |
|
"[lockedby] varchar(255), " + |
58 |
|
"constraint [pk_databasechange] primary key ([id]))", |
59 |
|
"insert into [databasechangeloglock] ([id], [locked]) values (1, 0)"}, DB2Database.class); |
60 |
|
|
61 |
0
|
assertCorrect(new String[]{"create table [databasechangeloglock] (" + |
62 |
|
"[id] int not null, " + |
63 |
|
"[locked] number(1) not null, " + |
64 |
|
"[lockgranted] timestamp, " + |
65 |
|
"[lockedby] varchar2(255), " + |
66 |
|
"constraint [pk_databasechangeloglock] primary key ([id]))", |
67 |
|
"insert into [databasechangeloglock] ([id], [locked]) values (1, 0)"}, OracleDatabase.class); |
68 |
|
|
69 |
0
|
assertCorrect(new String[]{"create table [databasechangeloglock] (" + |
70 |
|
"[id] int not null, " + |
71 |
|
"[locked] boolean not null, " + |
72 |
|
"[lockgranted] datetime, " + |
73 |
|
"[lockedby] varchar(255), " + |
74 |
|
"constraint [pk_databasechangeloglock] primary key ([id]))", |
75 |
|
"insert into [databasechangeloglock] ([id], [locked]) values (1, FALSE)"}); |
76 |
|
|
77 |
|
} |
78 |
|
} |