-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
dbDoc.test.groovy
77 lines (67 loc) · 2.37 KB
/
dbDoc.test.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package liquibase.extension.testing.command
import liquibase.exception.CommandValidationException
CommandTests.define {
command = ["dbDoc"]
signature = """
Short Description: Generates JavaDoc documentation for the existing database and changelogs
Long Description: NOT SET
Required Args:
changelogFile (String) The root changelog
outputDirectory (String) The directory where the documentation is generated
url (String) The JDBC database connection URL
OBFUSCATED
Optional Args:
defaultCatalogName (String) The default catalog name to use for the database connection
Default: null
defaultSchemaName (String) The default schema name to use for the database connection
Default: null
driver (String) The JDBC driver class
Default: null
driverPropertiesFile (String) The JDBC driver properties file
Default: null
password (String) The database password
Default: null
OBFUSCATED
username (String) The database username
Default: null
"""
run "Happy path", {
arguments = [
url: { it.url },
username: { it.username },
password: { it.password },
outputDirectory: "target/test-classes",
changelogFile : "changelogs/h2/complete/simple.changelog.xml",
]
expectedResults = [
statusCode : 0
]
}
run "Run without an outputDirectory should throw an exception", {
arguments = [
changelogFile: "changelogs/h2/complete/rollback.tag.changelog.xml",
outputDirectory: ""
]
expectedException = CommandValidationException.class
}
run "Run without a changeLogFile should throw an exception", {
arguments = [
outputDirectory: "target/test-classes"
]
expectedException = CommandValidationException.class
}
run "Run without a URL should throw an exception", {
arguments = [
url : "",
changelogFile: "changelogs/h2/complete/rollback.tag.changelog.xml",
outputDirectory: "version_2.0"
]
expectedException = CommandValidationException.class
}
run "Run without any arguments should throw an exception", {
arguments = [
url: ""
]
expectedException = CommandValidationException.class
}
}