-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtests
More file actions
executable file
·167 lines (127 loc) · 4.49 KB
/
tests
File metadata and controls
executable file
·167 lines (127 loc) · 4.49 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/usr/bin/env bash
source "$( pwd )/test/utils"
source "$( pwd )/test/helpers"
default_jvm_version="1.8"
default_tomcat_version="9.0.112.0"
test::war::defaults() {
# Tests a deployment of a war app
# With default settings
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${default_jvm_version}." "${default_tomcat_version}"
}
test::war::jvm1-8() {
# Tests a deployment of a war app
# Specifying we want JVM 1.8 via environment
JAVA_VERSION="1.8"
export JAVA_VERSION
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${JAVA_VERSION}." "${default_tomcat_version}"
}
test::war::jvm17() {
# Tests a deployment of a war app
# Specifying we want JVM 17 via environment
JAVA_VERSION="17"
export JAVA_VERSION
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${JAVA_VERSION}." "${default_tomcat_version}"
}
test::war::jvm18() {
# Tests a deployment of a war app
# Specifying we want JVM 18 via environment
JAVA_VERSION="18"
export JAVA_VERSION
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${JAVA_VERSION}." "${default_tomcat_version}"
}
test::war::jvm19() {
# Tests a deployment of a war app
# Specifying we want JVM 19 via environment
JAVA_VERSION="19"
export JAVA_VERSION
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${JAVA_VERSION}." "${default_tomcat_version}"
}
test::war::tomcat9() {
# Tests a deployment of a war app
# Specifying we want Tomcat 9.0.85.0 via environment
JAVA_WEBAPP_RUNNER_VERSION="9.0.85.0"
export JAVA_WEBAPP_RUNNER_VERSION
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${default_jvm_version}." "${JAVA_WEBAPP_RUNNER_VERSION}"
}
test::war::tomcat10() {
# Tests a deployment of a war app
# Specifying we want Tomcat 10.1.18.0 via environment
# Specifying we want JVM17 via environment (required for Tomcat 10).
JAVA_VERSION="17"
export JAVA_VERSION
JAVA_WEBAPP_RUNNER_VERSION="10.1.18.0"
export JAVA_WEBAPP_RUNNER_VERSION
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${JAVA_VERSION}." "${JAVA_WEBAPP_RUNNER_VERSION}"
}
test::war::war_in_rootdir() {
# Tests a deployment of a war app
# With the .war file in the root directory of the project
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${default_jvm_version}." "${default_tomcat_version}"
}
test::war::war_in_subir() {
# Tests a deployment of a war app
# With the .war file in a subdirectory of the project
# This must fail at the `bin/detect` step since we only look in the project
# root directory.
test::utils::setupFixture "war_in_subdir"
test::utils::detect
test::utils::assertCapturedError
test::utils::assertCapturedEquals "no"
}
test::war::war_in_rootdir_specified() {
# Tests a deployment of a war app
# Specifying the path to the .war file via environment
# With the .war file in the root directory of the project
WAR_PATH="sample.war"
export WAR_PATH
test::utils::setupFixture "war_defaults"
test::helpers::common_deploy "WAR" \
"${default_jvm_version}." "${default_tomcat_version}"
}
test::war::war_in_subir_specified() {
# Tests a deployment of a war app
# Specifying the path to the .war file via environment
# With the .war file in a subdirectory of the project
WAR_PATH="subdir/sample.war"
export WAR_PATH
test::utils::setupFixture "war_in_subdir"
test::helpers::common_deploy "WAR" \
"${default_jvm_version}." "${default_tomcat_version}"
}
test::war::no_war() {
# Tests a deployment of a war app
# Where there is no .war file!
# This must fail at the `bin/detect` step.
test::utils::setupFixture "no_war"
test::utils::detect
test::utils::assertCapturedError
test::utils::assertCapturedEquals "no"
}
suite_addTest test::war::defaults
suite_addTest test::war::jvm1-8
suite_addTest test::war::jvm17
suite_addTest test::war::jvm18
suite_addTest test::war::jvm19
suite_addTest test::war::tomcat9
suite_addTest test::war::tomcat10
suite_addTest test::war::war_in_rootdir
suite_addTest test::war::war_in_subir
suite_addTest test::war::war_in_rootdir_specified
suite_addTest test::war::war_in_subir_specified
suite_addTest test::war::no_war