forked from TeamDev-Archive/OpenFaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
201 lines (174 loc) · 9.59 KB
/
build.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
<project name="OpenFaces Project Build Script" default="build" basedir=".">
<property name="components.dir" location="openFaces"/>
<property name="target.dir" location="target"/>
<property name="target-lib.dir" location="${target.dir}/lib"/>
<property name="openfaces-jar.file" location="${target-lib.dir}/openfaces.jar"/>
<property name="openfaces-weblogic-jar.file" location="${target-lib.dir}/openfaces-weblogic-jsp.jar"/>
<property name="test-app-jsp.dir" location="testApp/jsp"/>
<property name="test-app-facelets.dir" location="testApp/facelets"/>
<property name="live-demo.dir" location="liveDemo/jsp"/>
<property name="live-demo-facelets.dir" location="liveDemo/facelets"/>
<property name="funcTests.dir" location="funcTests"/>
<property name="funcTests-source.dir" location="${funcTests.dir}/source"/>
<property name="funcTests-target.dir" location="${funcTests.dir}/target"/>
<property name="funcTests-target-reports.dir" location="${funcTests-target.dir}/test-reports"/>
<property name="funcTestsFramework.dir" location="OpenFacesInspectors"/>
<property name="funcTestsFramework-source.dir" location="${funcTestsFramework.dir}/source"/>
<property name="funcTestsFramework-target.dir" location="${funcTestsFramework.dir}/out"/>
<property name="funcTestsFramework-distrib.dir" location="${funcTestsFramework.dir}/distribution"/>
<property name="funcTestsFramework-temp.dir" location="${funcTestsFramework.dir}/temp"/>
<property name="openfaces-inspectors-jar.file" location="${funcTestsFramework-distrib.dir}/openfaces-inspectors.jar"/>
<property name="patched-selenium-server.file"
location="${funcTestsFramework-distrib.dir}/patched-selenium-server.jar"/>
<property name="funcTestsFrameworkManifest.file" location="${funcTestsFramework-target.dir}/manifest.mf"/>
<target name="init">
<tstamp/>
</target>
<!-- *** Public Targets ** -->
<target name="build" depends="clean" description="Build OpenFaces core and all the demo applications">
<mkdir dir="${target.dir}"/>
<echo>Building Open Faces core...</echo>
<ant dir="${components.dir}" target="build" inheritall="false">
<property name="target-jar.file" value="${openfaces-jar.file}"/>
<property name="target-weblogic-jar.file" value="${openfaces-weblogic-jar.file}"/>
<property name="lib.dir" value="../lib"/>
<property name="retain.classes.dir" value="true"/>
<property file="ofversion.properties"/>
</ant>
<echo>Open Faces core built successfully.</echo>
<echo>Building Test Application (JSP-based version)...</echo>
<ant dir="${test-app-jsp.dir}" target="build" inheritall="false">
<property name="components-jar.file" value="${openfaces-jar.file}"/>
</ant>
<echo>Test Application (JSP-based version) built successfully.</echo>
<echo>Building Test Application (Facelets-based version)...</echo>
<ant dir="${test-app-facelets.dir}" target="build" inheritall="false">
<property name="components-jar.file" value="${openfaces-jar.file}"/>
</ant>
<echo>Test Application (Facelets-based version) built successfully.</echo>
<echo>Building Live Demo (JSP-based version)...</echo>
<ant dir="${live-demo.dir}" target="build" inheritall="false">
<property name="components-jar.file" value="${openfaces-jar.file}"/>
</ant>
<echo>Live Demo (JSP-based version) build successfully.</echo>
<echo>Building Live Demo (Facelets-based version)...</echo>
<ant dir="${live-demo-facelets.dir}" target="build" inheritall="false">
<property name="components-jar.file" value="${openfaces-jar.file}"/>
</ant>
<echo>Live Demo (Facelets-based version) build successfully.</echo>
</target>
<target name="clean" depends="init" description="clean up">
<delete dir="${target.dir}"/>
</target>
<target name="compile-func-test-framework" description="Compile framework required for functional testing">
<mkdir dir="${funcTestsFramework-target.dir}"/>
<javac srcdir="${funcTestsFramework-source.dir}" destdir="${funcTestsFramework-target.dir}" debug="true"
source="1.5" target="1.5">
<classpath>
<pathelement path="lib/seleniuminspector/selenium-java-client-driver.jar"/>
<pathelement path="lib/seleniuminspector/selenium-server.jar"/>
<pathelement path="lib/seleniuminspector/seleniuminspector.jar"/>
<pathelement path="testLib/junit.jar"/>
<fileset file="${openfaces-jar.file}"/>
</classpath>
</javac>
<manifest file="${funcTestsFrameworkManifest.file}">
<attribute name="Implementation-Title" value="OpenFaces Selenium Inspectors"/>
<attribute name="Implementation-Vendor" value="TeamDev Ltd."/>
</manifest>
<mkdir dir="${funcTestsFramework-distrib.dir}"/>
<jar jarfile="${openfaces-inspectors-jar.file}" basedir="${funcTestsFramework-target.dir}"/>
<copy file="lib/seleniuminspector/patched-selenium-server.jar" todir="${funcTestsFramework-distrib.dir}"/>
<copy file="lib/seleniuminspector/selenium-java-client-driver.jar" todir="${funcTestsFramework-distrib.dir}"/>
</target>
<target name="compile-func-tests" depends="compile-func-test-framework" description="Compile functional tests">
<delete dir="${funcTests-target.dir}/classes"/>
<mkdir dir="${funcTests-target.dir}/classes"/>
<javac srcdir="${funcTests-source.dir}" destdir="${funcTests-target.dir}/classes" debug="true" encoding="UTF-8">
<classpath>
<pathelement path="${openfaces-jar.file}"/>
<pathelement path="${openfaces-inspectors-jar.file}"/>
<pathelement path="testLib/junit.jar"/>
<pathelement path="testLib/jai/mlibwrapper_jai.jar"/>
<pathelement path="testLib/jai/jai_core.jar"/>
<pathelement path="testLib/jai/jai_codec.jar"/>
<pathelement path="lib/seleniuminspector/selenium-java-client-driver.jar"/>
<pathelement path="lib/seleniuminspector/selenium-server.jar"/>
<pathelement path="lib/seleniuminspector/seleniuminspector.jar"/>
</classpath>
</javac>
<copy todir="${funcTests-target.dir}/classes">
<fileset dir="${funcTests-source.dir}">
<include name="**/*.properties"/>
<include name="**/*.lic"/>
<include name="**/*.png"/>
<include name="**/*.dll"/>
</fileset>
</copy>
</target>
<target name="run-func-tests" depends="compile-func-tests" description="Run functional tests">
<mkdir dir="${funcTests-target-reports.dir}"/>
<condition property="testAppContextPath" value="${context.path}">
<not>
<isset property="test.app.context.path"/>
</not>
</condition>
<condition property="testAppContextPath" value="${test.app.context.path}">
<isset property="test.app.context.path"/>
</condition>
<condition property="demoContextPath" value="${demoContext.path}">
<not>
<isset property="demo.context.path"/>
</not>
</condition>
<condition property="demoContextPath" value="${demo.context.path}">
<isset property="demo.context.path"/>
</condition>
<junit fork="yes" forkmode="once" failureproperty="junit_test_failed" dir="${funcTests-target.dir}">
<classpath>
<pathelement path="${openfaces-jar.file}"/>
<pathelement path="lib/seleniuminspector/patched-selenium-server.jar"/>
<pathelement path="lib/seleniuminspector/selenium-java-client-driver.jar"/>
<pathelement path="lib/seleniuminspector/seleniuminspector.jar"/>
<pathelement path="lib/mojarra/jsf-api-1.2_12-b01.jar"/>
<pathelement location="${funcTests-target.dir}/classes"/>
<pathelement path="${openfaces-inspectors-jar.file}"/>
<pathelement path="testLib/junit.jar"/>
<pathelement path="testLib/jai/mlibwrapper_jai.jar"/>
<pathelement path="testLib/jai/jai_core.jar"/>
<pathelement path="testLib/jai/jai_codec.jar"/>
</classpath>
<formatter type="xml"/>
<formatter usefile="false" type="plain"/>
<batchtest todir="${funcTests-target-reports.dir}">
<fileset dir="${funcTests-source.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<sysproperty key="test.app.jsf.implementation" value="${jsf.implementation}"/>
<sysproperty key="test.app.is.facelets" value="${is.facelets}"/>
<sysproperty key="test.app.context.path" value="${testAppContextPath}"/>
<sysproperty key="demo.context.path" value="${demoContextPath}"/>
</junit>
<copy todir="${funcTests-source.dir}">
<fileset dir="${funcTests-target.dir}/classes">
<include name="**/*.png"/>
</fileset>
</copy>
<fail if="junit_test_failed" message="FUNCTIONAL TEST(S) FAILED"/>
</target>
<target name="run-func-tests-jsp" description="Run functional tests in JSP-based JSF 1.2 environment">
<property name="jsf.implementation" value="SUN12"/>
<property name="is.facelets" value="false"/>
<property name="context.path" value="/TestAppJsp_2x"/>
<property name="demoContext.path" value="/LiveDemoJsp_2x"/>
<antcall target="run-func-tests"/>
</target>
<target name="run-func-tests-facelets" description="Run functional tests in Facelets-based JSF 1.2 environment">
<property name="jsf.implementation" value="SUN12"/>
<property name="is.facelets" value="true"/>
<property name="context.path" value="/TestAppFacelets_2x"/>
<property name="demoContext.path" value="/LiveDemoFacelets_2x"/>
<antcall target="run-func-tests"/>
</target>
</project>