-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-test-tck.xml
184 lines (156 loc) · 6.92 KB
/
build-test-tck.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
<?xml version="1.0"?>
<project basedir="." default="test" name="portal-test-tck" xmlns:antelope="antlib:ise.antelope.tasks" xmlns:if="ant:if">
<import file="build-test.xml" />
<import file="build-test-batch.xml" />
<fail message="Please set the property ${tck.home}." unless="tck.home" />
<target name="tck-jdk8">
<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"
/>
<get-database-property property.name="database.version" />
<replace
file="${app.server.dir}/webapps/ROOT/WEB-INF/web.xml"
token="<session-timeout>30</session-timeout>"
value="<session-timeout>${test.session.timeout[tck]}</session-timeout>"
/>
<antcall target="prepare-portal-ext-properties">
<param name="app.server.classes.portal.dir" value="${app.server.classes.portal.dir}" />
</antcall>
<echo append="true" file="${app.server.classes.portal.dir}/portal-ext.properties"><![CDATA[
browser.launcher.url=
javascript.single.page.application.enabled=false
layout.parallel.render.enable=false
module.framework.auto.deploy.interval=2000
session.timeout=${test.session.timeout[tck]}
setup.wizard.enabled=false
terms.of.use.required=false
theme.portlet.decorate.default=false
users.reminder.queries.enabled=false
users.reminder.queries.custom.question.enabled=false
web.server.https.port=8443]]></echo>
<!--
Due to a Liferay-specific performance optimization, the Portlet Hub dependency must be
configured statically in order for top_head.jsp to output render data
-->
<exec dir="${tck.home}/.." executable="git" failonerror="true">
<arg value="apply" />
<arg value="tck/pluto-patch.diff" />
</exec>
<execute dir="${tck.home}/..">
mvn -P all,liferay clean install
</execute>
<copy
flatten="true"
todir="${liferay.home}/deploy/"
>
<fileset
dir="${tck.home}"
includes="**/target/tck-V*.war"
/>
</copy>
<gradle-execute dir="modules/test/portlet-tck-theme" task="deploy" />
<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>
<delete file="${liferay.home}/osgi/modules/com.liferay.chat.api.jar" />
<delete file="${liferay.home}/osgi/modules/com.liferay.chat.service.jar" />
<delete file="${liferay.home}/osgi/modules/com.liferay.chat.web.jar" />
<echo
file="${liferay.home}/osgi/modules/com.liferay.portlet.tck.bridge.configuration.PortletTCKBridgeConfiguration.cfg"
>tckDeployFilesDir=${tck.home}/deploy/target/deploy-files</echo>
<gradle-execute dir="modules/test/portlet-tck-bridge" task="deploy" />
<wait-for-app-server-log-message log.message="Portlet TCK Bridge is ready" />
<tempfile
createfile="true"
deleteonexit="true"
destDir="tck"
prefix="tck-tests_"
property="tck.tests.xml"
suffix=".xml"
/>
<basename file="${tck.tests.xml}" property="tck.tests.xml.file.name" />
<dirname file="${tck.tests.xml}" property="tck.tests.xml.parent.dir" />
<copy
file="${tck.home}/driver/target/classes/generated-resources/xml/final/test.xml"
tofile="${tck.tests.xml}"
overwrite="true"
/>
<xmltask preserveType="true" source="tck/htmlunit-tests.xml">
<call path="//*[local-name()='entry'][@key]">
<param name="key" path="@key" />
<actions>
<replaceregexp
file="${tck.tests.xml}"
flags="im"
match="<entry[^>]+key="@{key}"[^>]*>[^<]*</entry>"
replace=""
/>
</actions>
</call>
</xmltask>
<var
name="tck.properties"
value="-Dtest.context.base='${test.context.base[tck]}' -Dtest.server.login.url='${test.server.login.url[tck]}' -Dtest.server.username.id='${test.server.username.id[tck]}' -Dtest.server.username='${test.server.username[tck]}' -Dtest.server.password.id='${test.server.password.id[tck]}' -Dtest.server.password='${test.server.password[tck]}' -Dtest.timeout='${test.timeout[tck]}' -Dtest.ignore.list.file=tck/ignoredTestCases.xml"
/>
<execute dir="${tck.home}">
echo mvn -Pliferay,run-tck -Djava.awt.headless=true ${tck.properties} -Dtest.browser=htmlunit -Dtest.browser.binary= -Dtest.browser.webDriver= -Dtest.list.dir=tck -Dtest.list.name=htmlunit-tests.xml test
</execute>
<if>
<available
file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml"
/>
<then>
<mkdir dir="${project.dir}/tck/test-results" />
<copy
file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml"
tofile="${project.dir}/tck/test-results/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver-htmlunit.xml"
/>
</then>
<else>
<fail message="No TCK tests were run with HTMLUnit." />
</else>
</if>
<prepare-chrome-driver />
<propertycopy
from="browser.${browser.type[tck]}.bin.file[${browser.${browser.type[tck]}.version}]"
name="browser.bin.file" silent="true"
/>
<propertycopy
from="selenium.${browser.type[tck]}.driver.executable"
name="selenium.tck.browser.driver.executable" silent="true"
/>
<execute dir="${tck.home}">
echo mvn -Pliferay,run-tck -Djava.awt.headless=true ${tck.properties} -Dtest.browser=${browser.type[tck]} -Dtest.browser.binary='${browser.bin.file}' -Dtest.browser.webDriver=${selenium.executable.dir.name}${selenium.tck.browser.driver.executable} -Dtest.list.dir=${tck.tests.xml.parent.dir} -Dtest.list.name=${tck.tests.xml.file.name} test
</execute>
<if>
<available
file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml"
/>
<then>
<mkdir dir="${project.dir}/tck/test-results" />
<copy
file="${tck.home}/driver/target/surefire-reports/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver.xml"
tofile="${project.dir}/tck/test-results/TEST-javax.portlet.tck.driver.TCKLiferayTestDriver-${browser.type[tck]}.xml"
/>
</then>
<else>
<fail message="No TCK tests were run with ${browser.type[tck]}." />
</else>
</if>
</test-action>
</database-test-run-test>
</test-action>
</run-batch-test>
</target>
</project>