forked from RESOStandards/web-api-commander
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
276 lines (236 loc) · 8.69 KB
/
Copy pathbuild.gradle
File metadata and controls
276 lines (236 loc) · 8.69 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building an application
id 'application'
}
// Define the main class for the application
mainClassName = 'org.reso.commander.App'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}
dependencies {
compile 'com.google.guava:guava:31.1-jre'
compile 'com.google.inject:guice:5.1.0'
compile 'commons-cli:commons-cli:1.5.0'
compile 'org.apache.logging.log4j:log4j-api:2.17.2'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2'
compile 'org.apache.logging.log4j:log4j-1.2-api:2.17.2'
compile 'org.apache.logging.log4j:log4j-core:2.17.2'
compile 'org.apache.olingo:odata-client-api:4.9.0'
compile 'org.apache.olingo:odata-commons-core:4.9.0'
compile 'org.apache.olingo:odata-client-core:4.9.0'
compile 'org.apache.poi:poi:5.2.2'
compile 'org.apache.poi:poi-ooxml:5.2.2'
compile 'io.rest-assured:rest-assured:5.1.1'
compile 'io.rest-assured:json-path:5.1.1'
compile 'io.rest-assured:json-schema-validator:5.1.1'
compile 'io.cucumber:cucumber-java8:7.1.0'
compile 'io.cucumber:cucumber-java:7.1.0'
compile 'io.cucumber:cucumber-junit:7.1.0'
compile 'io.cucumber:cucumber-guice:7.1.0'
compile 'io.cucumber:cucumber-core:7.1.0'
//TODO: choose one schema validator between this and rest-assured
compile 'com.networknt:json-schema-validator:1.0.70'
compile 'com.google.code.gson:gson:2.9.0'
compile 'org.apache.commons:commons-text:1.9'
}
configurations {
cucumberRuntime {
extendsFrom compile
}
}
jar {
manifest {
attributes "Main-Class": mainClassName
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
exclude 'META-INF/*.RSA'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
}
// don't suppress warnings or deprecation notices
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}
String pathToMetadata = null,
pathToRESOScript = null,
certFileName = null
final String certOutputDir = 'build/certification',
cucumberJsonPath = certOutputDir + '/cucumberJson',
certReportsDir = certOutputDir + '/reports'
task testWebApiCore_2_0_0() {
group = 'RESO Certification'
description = 'Web API Core 2.0.0 Acceptance Tests' +
'\nExample: ' +
'\n ./gradlew testWebApiCore_2_0_0 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript -DshowResponses=true' +
'\n\nNote: by default the Web API tests assume Collection(Edm.EnumType).' +
'\nPass -DuseCollections=false if using OData IsFlags.' +
'\n\n[Report location: ' + certReportsDir + ']' +
'\n\n'
String reportName = 'web-api-server.core.2.0.0'
dependsOn jar
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
systemProperties = System.getProperties()
args = [
'--plugin',
'pretty',
'--plugin',
'json:' + cucumberJsonPath + '/' + reportName + '.json',
'--plugin',
'html:' + certReportsDir + '/' + reportName + '.html',
'--glue',
'org.reso.certification.stepdefs#WebAPIServerCore',
'src/main/java/org/reso/certification/features/web-api',
'--tags',
'@core-endorsement'
]
}
}
}
task testDataDictionary_1_7() {
group = 'RESO Certification'
description = 'Data Dictionary 1.7 Acceptance Tests' +
'\nRESOScript Example:' +
'\n ./gradlew testDataDictionary_1_7 -DpathToRESOScript=/path/to/dd17.resoscript -DshowResponses=true -Dstrict=true' +
'\n\nMetadata File Example:' +
'\n ./gradlew testDataDictionary_1_7 -DpathToMetadata=/path/to/RESODataDictionary-1.7.xml' +
'\n\nTo disable strict mode, remove the -Dstrict=true parameter. All applicants MUST pass strict mode tests to be certified!' +
'\n\n[Report location: ' + certReportsDir + ']' +
'\n\n'
String reportName = 'data-dictionary-1.7'
dependsOn jar
doLast {
javaexec {
main = 'io.cucumber.core.cli.Main'
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
systemProperties = System.getProperties()
pathToMetadata = System.getProperty('pathToMetadata', null)
pathToRESOScript = System.getProperty('pathToRESOScript', null)
if (pathToMetadata != null) {
certFileName = pathToMetadata
.substring(Math.max(pathToMetadata.lastIndexOf(File.separator) + 1, 0), pathToMetadata.lastIndexOf('.'))
} else if (pathToRESOScript != null) {
certFileName = pathToRESOScript
.substring(Math.max(pathToRESOScript.lastIndexOf(File.separator) + 1, 0), pathToRESOScript.lastIndexOf('.'))
}
args = [
'--plugin',
'pretty',
'--plugin',
'json:' + cucumberJsonPath + '/' + reportName + '.json',
'--plugin',
'html:' + certReportsDir + '/' + reportName + '.html',
'--glue',
'org.reso.certification.stepdefs#DataDictionary',
'src/main/java/org/reso/certification/features/data-dictionary/v1-7-0'
]
if (systemProperties.hasProperty('cucumber.filter.tags')) {
args.add('--tags')
args.add(systemProperties.get('cucumber.filter.tags').toString())
}
}
}
}
task testDataAvailability_1_7() {
group = 'RESO Certification'
description = 'Data Dictionary 1.7 Data Availability Tests' +
'\nExample:' +
'\n ./gradlew testDataAvailability_1_7 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript' +
'\n\n[Report location: ' + certReportsDir + ']' +
'\n\n'
String reportName = 'data-availability.dd-1.7'
dependsOn jar
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
systemProperties = System.getProperties()
args = [
'--plugin',
'pretty',
'--plugin',
'json:' + cucumberJsonPath + '/' + reportName + '.json',
'--plugin',
'html:' + certReportsDir + '/' + reportName + '.html',
'--glue',
'org.reso.certification.stepdefs#DataAvailability',
'src/main/java/org/reso/certification/features/payloads/data-availability.feature'
]
}
}
}
task testIdxPayload_1_7() {
group = 'RESO Certification'
description = 'Data Dictionary 1.7 Payloads Sampling Tests' +
'\nExample:' +
'\n ./gradlew testIdxPayload_1_7 -DpathToRESOScript=/path/to/web-api-core-2.0.0.resoscript' +
'\n\n[Report location: ' + certReportsDir + ']' +
'\n\n'
String reportName = 'idx-payload.dd-1.7'
dependsOn jar
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
systemProperties = System.getProperties()
args = [
'--plugin',
'pretty',
'--plugin',
'json:' + cucumberJsonPath + '/' + reportName + '.json',
'--plugin',
'html:' + certReportsDir + '/' + reportName + '.html',
'--glue',
'org.reso.certification.stepdefs#IdxPayload',
'src/main/java/org/reso/certification/features/payloads/idx-payload.feature'
]
}
}
}
task testDataDictionaryReferenceMetadata_1_7() {
description = 'Runs Data Dictionary tests against reference metadata'
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
System.setProperty('pathToMetadata', 'src/main/resources/RESODataDictionary-1.7.xml')
systemProperties = System.getProperties()
args = [
'--plugin',
'pretty',
'--glue',
'org.reso.certification.stepdefs#DataDictionary',
'src/main/java/org/reso/certification/features/data-dictionary/v1-7-0'
]
}
}
}
//used for internal Commander Web API acceptance testing
test {
dependsOn assemble, compileTestJava, testDataDictionaryReferenceMetadata_1_7
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin',
'pretty',
'--glue',
'org.reso.commander.test.stepdefs',
'src/test/java/org/reso/commander/test/features'
]
}
}
}