forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsf.xml
449 lines (366 loc) · 15.8 KB
/
jsf.xml
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<?xml version="1.0"?>
<project basedir="../" name="portal-test-batch" xmlns:antelope="antlib:ise.antelope.tasks" xmlns:if="ant:if" xmlns:unless="ant:unless">
<import file="../build-test-batch.xml" />
<target name="jsf-jdk8">
<get-database-property property.name="database.version" />
<run-batch-test>
<test-action>
<database-test-run-test database.type="mysql" database.version="${database.version}" stop.app.server="true">
<test-action>
<propertycopy from="app.server.${app.server.type}.classes.portal.dir" name="app.server.classes.portal.dir" override="true" />
<antcall if:set="env.JENKINS_HOME" target="prepare-portal-ext-properties">
<param name="app.server.classes.portal.dir" value="${app.server.classes.portal.dir}" />
</antcall>
<antcall target="run-jsf-tests" />
</test-action>
</database-test-run-test>
</test-action>
<test-set-up>
<set-tomcat-version-number liferay.portal.bundle="${test.portal.bundle.version}" />
<propertycopy from="app.server.${app.server.type}.bin.dir" name="test.app.server.bin.dir" />
<if>
<and>
<or>
<matches pattern="https?://" string="${test.portal.bundle.war.url}" />
<matches pattern="https?://" string="${test.portal.bundle.zip.url}" />
</or>
<matches pattern="https?://" string="${test.sql.zip.url}" />
</and>
<then>
<antcall inheritAll="false" target="prepare-test-bundle">
<param name="app.server.type" value="${app.server.type}" />
<param name="test.app.server.bin.dir" value="${test.app.server.bin.dir}" />
<param name="test.build.bundle.zip.url" value="${test.portal.bundle.zip.url}" />
<param name="test.build.fix.pack.zip.url" value="${test.build.fix.pack.zip.url}" />
<param name="test.build.portal.dependencies.zip.url" value="${test.portal.bundle.dependencies.zip.url}" />
<param name="test.build.portal.osgi.zip.url" value="${test.portal.bundle.osgi.zip.url}" />
<param name="test.build.portal.tools.zip.url" value="${test.portal.bundle.tools.zip.url}" />
<param name="test.build.portal.war.url" value="${test.portal.bundle.war.url}" />
<param name="test.fix.pack.base.url" value="${test.fix.pack.base.url}" />
</antcall>
<antcall target="deploy-license-xml">
<param name="test.build.license.xml.zip.url" value="${test.license.xml.url}" />
</antcall>
<antcall target="deploy-sql-zip">
<param name="test.sql.zip.url" value="${test.sql.zip.url}" />
</antcall>
<antcall inheritAll="false" target="setup-sdk" />
<antcall inheritAll="false" target="setup-yarn" />
<setup-test-batch-testable-tomcat test.portal.bundle.version="${test.portal.bundle.version}" />
</then>
<elseif>
<and>
<available file="liferay-portal-bundle-${app.server.type}.tar.gz" />
<available file="liferay-portal-source.tar.gz" />
</and>
<then>
<prepare-test-environment app.server.type="${app.server.type}" />
</then>
</elseif>
</if>
</test-set-up>
</run-batch-test>
</target>
<target name="run-jsf-tests">
<property name="max.metaspace.size" value="-XX:MaxMetaspaceSize=1024m" />
<propertycopy from="app.server.${app.server.type}.bin.dir" name="test.app.server.bin.dir" />
<replaceregexp
file="${test.app.server.bin.dir}/setenv.sh"
flags="gi"
match="-XX:MaxMetaspaceSize=[0-9]+[a-zA-Z]+"
replace="${max.metaspace.size}"
/>
<replaceregexp
file="${test.app.server.bin.dir}/setenv.bat"
flags="gi"
match="-XX:MaxMetaspaceSize=[0-9]+[a-zA-Z]+"
replace="${max.metaspace.size}"
/>
<if>
<not>
<or>
<resourcecontains
resource="${test.app.server.bin.dir}/setenv.sh"
substring="${max.metaspace.size}"
/>
<resourcecontains
resource="${test.app.server.bin.dir}/setenv.bat"
substring="${max.metaspace.size}"
/>
</or>
</not>
<then>
<fail message="Unable to set custom max metaspace of "${max.metaspace.size}" for ${test.app.server.bin.dir}/setenv.sh and setenv.bat." />
</then>
</if>
<propertycopy from="app.server.${app.server.type}.classes.portal.dir" name="app.server.classes.portal.dir" override="true" />
<echo append="true" file="${app.server.classes.portal.dir}/portal-ext.properties"><![CDATA[
terms.of.use.required=false
users.reminder.queries.enabled=false
users.reminder.queries.custom.question.enabled=false]]></echo>
<local name="portal.ext.properties" />
<loadfile
property="portal.ext.properties"
srcFile="${app.server.classes.portal.dir}/portal-ext.properties"
>
<filterchain>
<tokenfilter>
<replacestring from="captcha.max.challenges=-1" to="" />
</tokenfilter>
<trim />
<ignoreblank />
</filterchain>
</loadfile>
<echo file="${app.server.classes.portal.dir}/portal-ext.properties">${portal.ext.properties}</echo>
<propertycopy from="browser.firefox.bin.file[${liferay.faces.test.browser.version}]" name="browser.firefox.bin.file" silent="true" />
<prepare-gecko-driver />
<property location="${selenium.executable.dir.name}${selenium.gecko.driver.executable}" name="gecko.driver.path" />
<!--
LRQA-60084 Temporary workaround until new release branch is available
from the Faces repos
-->
<exec dir="${liferay.faces.alloy.dir}" executable="git">
<arg line="checkout" />
<arg line="c387002579a8883c737639310fb1000baee6e0b2" />
</exec>
<exec dir="${liferay.faces.alloy.dir}" executable="git">
<arg line="cherry-pick" />
<arg line="b51c1251c04bb8b130e364805f09e457220a1737" />
<arg line="--strategy-option " />
<arg line="theirs " />
</exec>
<exec dir="${liferay.faces.alloy.dir}" executable="git">
<arg line="cherry-pick" />
<arg line="2fe709c461ecc70bd416b855c15f5c6bebae1426" />
<arg line="--strategy-option " />
<arg line="theirs " />
</exec>
<exec dir="${liferay.faces.bridge.impl.dir}" executable="git">
<arg line="checkout" />
<arg line="31e19c170bbdce3e98e08a560a8c935392ebd69d" />
</exec>
<exec dir="${liferay.faces.bridge.impl.dir}" executable="git">
<arg line="cherry-pick" />
<arg line="c868b05d7abea77421c36b5ffb580ee9e2de8563" />
<arg line="--strategy-option " />
<arg line="theirs " />
</exec>
<exec dir="${liferay.faces.bridge.impl.dir}" executable="git">
<arg line="cherry-pick" />
<arg line="434358cb40c1ff30243062bfc1d8db5850efcbdf" />
<arg line="--strategy-option " />
<arg line="theirs " />
</exec>
<exec dir="${liferay.faces.portal.dir}" executable="git">
<arg line="checkout" />
<arg line="f7819860f0d4619f1e5214b50de9fdf54dbb4bae" />
</exec>
<exec dir="${liferay.faces.portal.dir}" executable="git">
<arg line="cherry-pick" />
<arg line="296dff949be89d4ca674f3e32be583d97c51bde6" />
<arg line="--strategy-option " />
<arg line="theirs " />
</exec>
<exec dir="${liferay.faces.portal.dir}" executable="git">
<arg line="cherry-pick" />
<arg line="b9e923481b6e842bb873cb100ab5576e4d4250b0" />
<arg line="--strategy-option " />
<arg line="theirs " />
</exec>
<exec dir="${liferay.faces.showcase.dir}" executable="git">
<arg line="checkout" />
<arg line="95dcd30f260ee3e219db7c1109c02832200dd517" />
</exec>
<exec dir="${liferay.faces.showcase.dir}" executable="git">
<arg line="cherry-pick" />
<arg line="cbaf33df7b508a990d30414a7e2f06bc815283e1" />
<arg line="--strategy-option " />
<arg line="theirs " />
</exec>
<exec dir="${liferay.faces.showcase.dir}" executable="git">
<arg line="cherry-pick" />
<arg line="6dfe2e3880caa28e13a5ae64cc48990d9e6d7612" />
<arg line="--strategy-option " />
<arg line="theirs " />
</exec>
<execute dir="${liferay.faces.bridge.impl.dir}/demo">
mvn clean package -P liferay,liferay73,mojarra,tomcat
</execute>
<execute dir="${liferay.faces.bridge.impl.dir}/issue">
mvn clean package -P liferay,liferay73,mojarra,tomcat
</execute>
<execute dir="${liferay.faces.bridge.impl.dir}/tck">
mvn clean package -P liferay,liferay73,mojarra,tomcat
</execute>
<execute dir="${liferay.faces.portal.dir}/demo">
mvn clean package -P liferay,liferay73,mojarra,tomcat,validateCaptchaForTest
</execute>
<execute dir="${liferay.faces.portal.dir}/test/test-setup-hook">
mvn clean package -P liferay,liferay73,mojarra,tomcat
</execute>
<copy
flatten="true"
todir="${liferay.home}/deploy/"
>
<fileset
dir="${liferay.faces.bridge.impl.dir}"
includes="**/target/*.war"
/>
<fileset
dir="${liferay.faces.portal.dir}"
excludes="**/target/com.liferay.faces.test.setup.hook*.war"
includes="**/target/*.war"
/>
</copy>
<copy
flatten="true"
todir="${liferay.home}/osgi/configs"
>
<fileset
dir="${liferay.faces.portal.dir}"
includes="**/configs/*.config"
/>
</copy>
<propertycopy from="app.server.${app.server.type}.bin.dir" name="app.server.bin.dir" override="true" />
<antcall inheritall="false" target="start-app-server">
<param name="app.server.bin.dir" value="${app.server.bin.dir}" />
</antcall>
<copy
flatten="true"
todir="${liferay.home}/deploy/"
>
<fileset
dir="${liferay.faces.portal.dir}"
includes="**/target/com.liferay.faces.test.setup.hook*.war"
/>
</copy>
<wait-for-app-server-log-message log.message="Hook for com.liferay.faces.test.setup.hook is available for use" />
<execute dir="${liferay.faces.bridge.impl.dir}/tck">
mvn clean install --quiet
</execute>
<execute dir="${liferay.faces.bridge.impl.dir}/tck/bridge-tck-main-portlet" failonerror="false">
mvn verify -P selenium,firefox -Dwebdriver.firefox.bin=${browser.firefox.bin.file} -Dwebdriver.gecko.driver=${gecko.driver.path} -Dintegration.browser.driver.wait.time.out=${liferay.faces.test.timeout}
</execute>
<!--
In order to build the Bridge Impl and Portal tests, first build the JSF Showcase
tests since the Alloy, Bridge Impl, and Portal Showcase tests depend on the JSF
Showcase tests.
-->
<execute dir="${liferay.faces.showcase.dir}/jsf-showcase-webapp">
mvn clean install --quiet -P selenium -Dit.test=none -DfailIfNoTests=false
</execute>
<!--
Next build the Alloy Showcase tests that the Bridge Impl tests depend on. In
order to build the Alloy Showcase, ensure that the Alloy Showcase depends on the
current JSF Showcase version (built above) and its transitive dependencies like
Test Selenium:
1. Extract the Test Selenium version used by the JSF Showcase.
-->
<xmltask source="${liferay.faces.showcase.dir}/jsf-showcase-webapp/pom.xml">
<copy
path="//*[local-name()='artifactId'][text()='com.liferay.faces.test.selenium']/../*[local-name()='version']/text()"
property="liferay.faces.test.selenium.version"
/>
</xmltask>
<!--
2. Replace the Test Selenium dependency version in the Alloy Showcase with the
one extracted from the JSF Showcase above.
-->
<xmltask
dest="${liferay.faces.alloy.dir}/demo/alloy-showcase-webapp/pom.xml"
source="${liferay.faces.alloy.dir}/demo/alloy-showcase-webapp/pom.xml"
>
<replace
path="//*[local-name()='artifactId'][text()='com.liferay.faces.test.selenium']/../*[local-name()='version']/text()"
withText="${liferay.faces.test.selenium.version}"
/>
</xmltask>
<!--
3. Extract the current JSF Showcase version.
-->
<xmltask source="${liferay.faces.showcase.dir}/pom.xml">
<copy
path="/*[local-name()='project']/*[local-name()='version']/text()"
property="liferay.faces.showcase.version"
/>
</xmltask>
<!--
4. Replace the JSF Showcase dependency version in the Alloy Showcase with the
one extracted from the JSF Showcase above.
-->
<xmltask dest="${liferay.faces.alloy.dir}/pom.xml" source="${liferay.faces.alloy.dir}/pom.xml">
<replace
path="//*[local-name()='liferay.faces.showcase.version']/text()"
withText="${liferay.faces.showcase.version}"
/>
</xmltask>
<execute dir="${liferay.faces.alloy.dir}/demo/alloy-showcase-webapp">
mvn clean install --quiet -P selenium -Dit.test=none -DfailIfNoTests=false
</execute>
<execute dir="${liferay.faces.bridge.impl.dir}/test/integration">
mvn clean install --quiet
</execute>
<execute dir="${liferay.faces.bridge.impl.dir}/test/integration" failonerror="false">
mvn verify -P selenium,firefox -Dwebdriver.firefox.bin=${browser.firefox.bin.file} -Dwebdriver.gecko.driver=${gecko.driver.path} -Dintegration.browser.driver.wait.time.out=${liferay.faces.test.timeout} -Dit.test='!ADF*ApplicantPortletTester,!*Ice*,issue/*,issue/primefaces/*,demo/JSF*,applicant/*Applicant*'
</execute>
<execute dir="${liferay.faces.bridge.impl.dir}/test/integration" failonerror="false">
mvn verify -P selenium,firefox -Dwebdriver.firefox.bin=${browser.firefox.bin.file} -Dwebdriver.gecko.driver=${gecko.driver.path} -Dintegration.browser.driver.wait.time.out=${liferay.faces.test.timeout} -Dit.test='showcase/bridge/*,showcase/portlet/*'
</execute>
<!--
Move the Bridge Impl test results to a different folder so they are not
overwritten by the Showcase test results.
-->
<move
file="${liferay.faces.bridge.impl.dir}/test/integration/target/failsafe-reports"
tofile="${liferay.faces.bridge.impl.dir}/test/integration/target/selenium-bridge-impl-failsafe-reports"
/>
<execute dir="${liferay.faces.bridge.impl.dir}/test/integration" failonerror="false">
mvn verify -P selenium-alloy-showcase,firefox -Dwebdriver.firefox.bin=${browser.firefox.bin.file} -Dwebdriver.gecko.driver=${gecko.driver.path} -Dintegration.browser.driver.wait.time.out=${liferay.faces.test.timeout}
</execute>
<!--
Move the Alloy Showcase test results to a different folder so they are not
overwritten by the JSF Showcase test results.
-->
<move
file="${liferay.faces.bridge.impl.dir}/test/integration/target/failsafe-reports"
tofile="${liferay.faces.bridge.impl.dir}/test/integration/target/selenium-alloy-showcase-failsafe-reports"
/>
<execute dir="${liferay.faces.bridge.impl.dir}/test/integration" failonerror="false">
mvn verify -P selenium-jsf-showcase,firefox -Dwebdriver.firefox.bin=${browser.firefox.bin.file} -Dwebdriver.gecko.driver=${gecko.driver.path} -Dintegration.browser.driver.wait.time.out=${liferay.faces.test.timeout}
</execute>
<execute dir="${liferay.faces.portal.dir}/test/integration">
mvn clean install --quiet
</execute>
<execute dir="${liferay.faces.portal.dir}/test/integration" failonerror="false">
mvn verify -P selenium,firefox -Dwebdriver.firefox.bin=${browser.firefox.bin.file} -Dwebdriver.gecko.driver=${gecko.driver.path} -Dintegration.browser.driver.wait.time.out=${liferay.faces.test.timeout}
</execute>
<!--
Move the Portal test results to a different folder so they are not overwritten
by the Showcase test results.
-->
<move
file="${liferay.faces.portal.dir}/test/integration/target/failsafe-reports"
tofile="${liferay.faces.portal.dir}/test/integration/target/selenium-portal-failsafe-reports"
/>
<execute dir="${liferay.faces.portal.dir}/test/integration" failonerror="false">
mvn verify -P selenium-portal-showcase,firefox -Dwebdriver.firefox.bin=${browser.firefox.bin.file} -Dwebdriver.gecko.driver=${gecko.driver.path} -Dintegration.browser.driver.wait.time.out=${liferay.faces.test.timeout}
</execute>
<!-- LRQA-60084 Temporary workaround cleanup -->
<exec dir="${liferay.faces.alloy.dir}" executable="git">
<arg line="checkout" />
<arg line="2fe709c461ecc70bd416b855c15f5c6bebae1426" />
</exec>
<exec dir="${liferay.faces.bridge.impl.dir}" executable="git">
<arg line="checkout" />
<arg line="434358cb40c1ff30243062bfc1d8db5850efcbdf" />
</exec>
<exec dir="${liferay.faces.portal.dir}" executable="git">
<arg line="checkout" />
<arg line="b9e923481b6e842bb873cb100ab5576e4d4250b0" />
</exec>
<exec dir="${liferay.faces.showcase.dir}" executable="git">
<arg line="checkout" />
<arg line="6dfe2e3880caa28e13a5ae64cc48990d9e6d7612" />
</exec>
</target>
</project>