Lines 29-40
Link Here
|
29 |
* - Ant properties are lower case. |
29 |
* - Ant properties are lower case. |
30 |
* |
30 |
* |
31 |
* Contributors: |
31 |
* Contributors: |
32 |
* tware - initial API and implementation |
32 |
* tware - initial API and implementation |
33 |
* egwin Update and add to nightly process. |
33 |
* egwin Update and add to nightly process. |
|
|
34 |
* agoerler prepare for server-tests |
34 |
#******************************************************************************/--> |
35 |
#******************************************************************************/--> |
35 |
|
36 |
|
36 |
<!-- This ant project includes the following tasks: |
37 |
<!-- This ant project includes the following tasks: |
37 |
- all (default) : compiles all JPA tests, packages test jars |
38 |
- build (default) : compiles all JPA tests, packages test jars |
38 |
- compile : compiles all JPA tests |
39 |
- compile : compiles all JPA tests |
39 |
- package : jars JPA persistent units and tests jars |
40 |
- package : jars JPA persistent units and tests jars |
40 |
- test : runs als JPA WDF tests |
41 |
- test : runs als JPA WDF tests |
Lines 63-68
Link Here
|
63 |
<property name="wdf_test.2.moxy.dir" value="${wdf_test.2.trunk.dir}/moxy/org.eclipse.persistence.moxy"/> |
64 |
<property name="wdf_test.2.moxy.dir" value="${wdf_test.2.trunk.dir}/moxy/org.eclipse.persistence.moxy"/> |
64 |
<property name="wdf_test.2.core.test.dir" value="${wdf_test.2.trunk.dir}/foundation/eclipselink.core.test"/> |
65 |
<property name="wdf_test.2.core.test.dir" value="${wdf_test.2.trunk.dir}/foundation/eclipselink.core.test"/> |
65 |
<property name="env" environment="env" value="env"/> |
66 |
<property name="env" environment="env" value="env"/> |
|
|
67 |
<property name="eclipselink.jpa.test" value="../eclipselink.jpa.test"/> |
66 |
|
68 |
|
67 |
<!-- Allows a user to overide certain user specific properties. --> |
69 |
<!-- Allows a user to overide certain user specific properties. --> |
68 |
<property file="${user.home}/build.properties"/> |
70 |
<property file="${user.home}/build.properties"/> |
Lines 76-84
Link Here
|
76 |
<target name="build-against-jar" depends="clean, init_against_jar, compile, package" description="build JPA WDF testing jars"/> |
78 |
<target name="build-against-jar" depends="clean, init_against_jar, compile, package" description="build JPA WDF testing jars"/> |
77 |
<target name="build-against-classes" depends="clean, init_against_classes, compile, package" description="build JPA WDF testing jars"/> |
79 |
<target name="build-against-classes" depends="clean, init_against_classes, compile, package" description="build JPA WDF testing jars"/> |
78 |
<target name="build-against-bundles" depends="clean, init_against_bundles, compile, package" description="build JPA WDF testing jars"/> |
80 |
<target name="build-against-bundles" depends="clean, init_against_bundles, compile, package" description="build JPA WDF testing jars"/> |
79 |
<target name="test-against-jar" depends="clean-test, init_against_jar, init_runtime, test-lrg" description="run JPA WDF tests"/> |
81 |
<target name="test-against-jar" depends="clean-test, init_against_jar, init_runtime, test-lrg" description="run JPA WDF tests"/> |
80 |
<target name="test-against-classes" depends="clean-test, init_against_classes, init_runtime, test-lrg" description="run JPA WDF tests"/> |
82 |
<target name="test-against-classes" depends="clean-test, init_against_classes, init_runtime, test-lrg" description="run JPA WDF tests"/> |
81 |
<target name="test-against-bundles" depends="clean-test, init_against_bundles, init_runtime, test-lrg" description="run JPA WDF tests"/> |
83 |
<target name="test-against-bundles" depends="clean-test, init_against_bundles, init_runtime, test-lrg" description="run JPA WDF tests"/> |
|
|
84 |
<target name="server-test" depends="server-test-internal" description="run JPA WDF tests on server configured by property server.name"/> |
82 |
<!-- convienience targets --> |
85 |
<!-- convienience targets --> |
83 |
<target name="build" depends="build-against-jar"/> |
86 |
<target name="build" depends="build-against-jar"/> |
84 |
<target name="test" depends="test-against-jar"/> |
87 |
<target name="test" depends="test-against-jar"/> |
Lines 100-110
Link Here
|
100 |
<pathelement path="${wdf_test.2.core.test.dir}/${classes.dir}"/> |
103 |
<pathelement path="${wdf_test.2.core.test.dir}/${classes.dir}"/> |
101 |
<pathelement path="${wdf_test.2.core.test.dir}/${eclipselink.tests.jar}"/> |
104 |
<pathelement path="${wdf_test.2.core.test.dir}/${eclipselink.tests.jar}"/> |
102 |
<pathelement path="${wdf_test.2.jpa.plugins.dir}/${persistence20.jar}"/> |
105 |
<pathelement path="${wdf_test.2.jpa.plugins.dir}/${persistence20.jar}"/> |
|
|
106 |
<pathelement path="${wdf_test.2.common.plugins.dir}/${ejb.jar}"/> |
103 |
<!-- These paths are unneeded for compile or run (from core.depend) may be needed in future --> |
107 |
<!-- These paths are unneeded for compile or run (from core.depend) may be needed in future --> |
104 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${unsigned.persistence10.jar}"/ --> |
108 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${unsigned.persistence10.jar}"/ --> |
105 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${activation.jar}"/ --> |
109 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${activation.jar}"/ --> |
106 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${resource.jar}"/ --> |
110 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${resource.jar}"/ --> |
107 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${ejb.jar}"/ --> |
|
|
108 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${jms.jar}"/ --> |
111 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${jms.jar}"/ --> |
109 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${stax_api.jar}"/ --> |
112 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${stax_api.jar}"/ --> |
110 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${mail.jar}"/ --> |
113 |
<!-- pathelement path="${wdf_test.2.common.plugins.dir}/${mail.jar}"/ --> |
Lines 178-210
Link Here
|
178 |
<path refid="compile.path"/> |
181 |
<path refid="compile.path"/> |
179 |
</classpath> |
182 |
</classpath> |
180 |
</javac> |
183 |
</javac> |
|
|
184 |
<javac |
185 |
srcdir="${wdf_test.2.core.test.dir}/${src.dir}" |
186 |
destdir="${classes.dir}" |
187 |
debug="${javac.debug}" |
188 |
debuglevel="${javac.debuglevel}" |
189 |
optimize="${javac.optimize}" |
190 |
source="${javac.version}" |
191 |
target="${javac.version}" |
192 |
deprecation="${javac.deprecation}" |
193 |
failonerror="true" |
194 |
includes="org/eclipse/persistence/testing/framework/junit/**, |
195 |
org/eclipse/persistence/testing/framework/AutoVerifyTestCase.java, |
196 |
org/eclipse/persistence/testing/framework/TestCase.java, |
197 |
org/eclipse/persistence/testing/framework/TestEntity.java, |
198 |
org/eclipse/persistence/testing/framework/TestModel.java, |
199 |
org/eclipse/persistence/testing/framework/*TestHelper.java, |
200 |
org/eclipse/persistence/testing/framework/QuerySQLTracker.java, |
201 |
org/eclipse/persistence/testing/framework/TestWarningException.java, |
202 |
org/eclipse/persistence/testing/framework/TestException.java, |
203 |
org/eclipse/persistence/testing/framework/TestErrorException.java, |
204 |
org/eclipse/persistence/testing/framework/TestProblemException.java, |
205 |
org/eclipse/persistence/testing/framework/ResultInterface.java, |
206 |
org/eclipse/persistence/testing/framework/TestCollection.java, |
207 |
org/eclipse/persistence/testing/framework/PerformanceComparisonTest.java, |
208 |
org/eclipse/persistence/testing/framework/PerformanceComparisonTestCase.java, |
209 |
org/eclipse/persistence/testing/framework/TestResult.java, |
210 |
org/eclipse/persistence/testing/framework/PerformanceComparisonTestResult.java, |
211 |
org/eclipse/persistence/testing/framework/PerformanceRegressionTest.java, |
212 |
org/eclipse/persistence/testing/framework/PerformanceRegressionTestCase.java, |
213 |
org/eclipse/persistence/testing/framework/ConcurrencyTestAdapter.java, |
214 |
org/eclipse/persistence/testing/framework/ConcurrentPerformanceComparisonTest.java, |
215 |
org/eclipse/persistence/testing/framework/ConcurrentPerformanceRegressionTest.java"> |
216 |
<classpath refid="compile.path"/> |
217 |
</javac> |
181 |
</target> |
218 |
</target> |
|
|
219 |
|
220 |
<target name="get-server-properties"> |
221 |
<property file="${user.home}/${server.name}.properties"/> |
222 |
<property file="${eclipselink.jpa.test}/${server.name}.properties"/> |
223 |
<echo message="server.lib=${server.lib}"/> |
224 |
<echo message="server.depend=${server.depend}"/> |
225 |
<echo message="server.name=${server.name}"/> |
226 |
<echo message="server.platform=${server.platform}"/> |
227 |
</target> |
182 |
|
228 |
|
183 |
<!-- Packages JPA persistent unit test jars. --> |
229 |
<!-- Packages JPA persistent unit test jars. --> |
184 |
<target name="package" depends="package-wdf-jpa2-model, package-wdf-jpa1-model" description="build EclipseLink jar"> |
230 |
<target name="package" depends="package-tests, package-wdf-jpa2-model, package-wdf-jpa1-model" description="build EclipseLink jar"/> |
|
|
231 |
|
232 |
|
233 |
<target name="package-tests" depends="get-server-properties"> |
234 |
<mkdir dir="${wdf_test.build.location}/stage"/> |
235 |
<filter token="server.user" value="${server.user}"/> |
236 |
<filter token="server.pwd" value="${server.pwd}"/> |
237 |
<filter token="server.factory" value="${server.factory}"/> |
238 |
<echo message="eclipselink.jpa.test=${eclipselink.jpa.test}"/> |
239 |
|
240 |
<copy file="${wdf_test.build.location}/../eclipselink.jpa.test/resource/server/jndi.properties" todir="stage" filtering="true"/> |
241 |
|
185 |
<jar jarfile="${wdf_test.build.location}/${eclipselink.tests.jar}"> |
242 |
<jar jarfile="${wdf_test.build.location}/${eclipselink.tests.jar}"> |
|
|
243 |
<zipfileset dir="${wdf_test.build.location}/resource/ejb" includes="*.xml" prefix="META-INF"/> |
186 |
<fileset dir="${wdf_test.build.location}/${classes.dir}" |
244 |
<fileset dir="${wdf_test.build.location}/${classes.dir}" |
187 |
includes="org/eclipse/persistence/testing/framework/**/*.class, |
245 |
includes="org/eclipse/persistence/testing/framework/**/*.class, |
188 |
org/eclipse/persistence/testing/tests/**/*.class"/> |
246 |
org/eclipse/persistence/testing/tests/**/*.class"/> |
|
|
247 |
<fileset dir="${wdf_test.build.location}/stage" |
248 |
includes="jndi.properties"/> |
189 |
</jar> |
249 |
</jar> |
|
|
250 |
<delete dir="stage"/> |
190 |
</target> |
251 |
</target> |
191 |
|
252 |
|
192 |
<target name="package-wdf-jpa2-model"> |
253 |
<target name="package-model" depends="get-server-properties,set-app-name"> |
193 |
<jar jarfile="${wdf_test.build.location}/${eclipselink.wdf.jpa2.model}.jar"> |
254 |
<copy overwrite="true" file="${wdf_test.build.location}/resource/${MODEL}/persistence.xml" todir="${build.dir}/META-INF"/> |
194 |
<zipfileset dir="${wdf_test.build.location}/resource/${eclipselink.wdf.jpa2.model}" includes="*.xml" prefix="META-INF"/> |
255 |
<replace dir="${build.dir}/META-INF" token='%%database-platform%%' value="${db.platform}"> |
|
|
256 |
<include name="persistence.xml"/> |
257 |
</replace> |
258 |
<replace dir="${build.dir}/META-INF" token='%%data-source-name%%' value="${DS_NAME}"> |
259 |
<include name="persistence.xml"/> |
260 |
</replace> |
261 |
<replace dir="${build.dir}/META-INF" token='%%server-platform%%' value="${server.platform}"> |
262 |
<include name="persistence.xml"/> |
263 |
</replace> |
264 |
<jar jarfile="${wdf_test.build.location}/${MODEL}.jar"> |
265 |
<zipfileset dir="${build.dir}/META-INF" includes="*.xml" prefix="META-INF"/> |
195 |
<fileset dir="${wdf_test.build.location}/${classes.dir}" |
266 |
<fileset dir="${wdf_test.build.location}/${classes.dir}" |
196 |
includes="org/eclipse/persistence/testing/models/wdf/jpa2/**"/> |
267 |
includes="${PACKAGE}"/> |
197 |
</jar> |
268 |
</jar> |
|
|
269 |
<delete dir="${build.dir}/META-INF"/> |
198 |
</target> |
270 |
</target> |
199 |
|
271 |
|
200 |
<target name="package-wdf-jpa1-model"> |
272 |
<target name="package-wdf-jpa1-model"> |
201 |
<jar jarfile="${wdf_test.build.location}/${eclipselink.wdf.jpa1.model}.jar"> |
273 |
<antcall target="package-model"> |
202 |
<zipfileset dir="${wdf_test.build.location}/resource/${eclipselink.wdf.jpa1.model}" includes="*.xml" prefix="META-INF"/> |
274 |
<param name="MODEL" value="${eclipselink.wdf.jpa1.model}"/> |
203 |
<fileset dir="${wdf_test.build.location}/${classes.dir}" |
275 |
<param name="PACKAGE" value="org/eclipse/persistence/testing/models/wdf/jpa1/**"/> |
204 |
includes="org/eclipse/persistence/testing/models/wdf/jpa1/**"/> |
276 |
</antcall> |
205 |
</jar> |
|
|
206 |
</target> |
277 |
</target> |
207 |
|
278 |
|
|
|
279 |
<target name="package-wdf-jpa2-model"> |
280 |
<antcall target="package-model"> |
281 |
<param name="MODEL" value="${eclipselink.wdf.jpa2.model}"/> |
282 |
<param name="PACKAGE" value="org/eclipse/persistence/testing/models/wdf/jpa2/**"/> |
283 |
</antcall> |
284 |
</target> |
285 |
|
208 |
<!-- Testing --> |
286 |
<!-- Testing --> |
209 |
|
287 |
|
210 |
<!-- Clean all build generated content. --> |
288 |
<!-- Clean all build generated content. --> |
Lines 227-240
Link Here
|
227 |
</target> |
305 |
</target> |
228 |
|
306 |
|
229 |
<!-- Default test target, run the LRG --> |
307 |
<!-- Default test target, run the LRG --> |
230 |
<target name="test-lrg" depends="clean-test"> |
308 |
<target name="test-lrg"> |
231 |
<antcall target="run-test" inheritRefs="true"> |
309 |
<antcall target="run-test" inheritRefs="true"> |
232 |
<param name="TEST_CLASS" value="${test.class}"/> |
310 |
<param name="TEST_CLASS" value="${test.class}"/> |
233 |
<param name="TEST_AGENT" value="${test.agent}"/> |
311 |
<param name="TEST_AGENT" value="${test.agent}"/> |
234 |
<param name="TEST_WEAVING" value="${test.weaving}"/> |
312 |
<param name="TEST_WEAVING" value="${test.weaving}"/> |
235 |
<param name="ORM_TESTING" value="-Dorm.testing=jpa"/> |
313 |
<param name="ORM_TESTING" value="-Dorm.testing=jpa"/> |
236 |
<param name="RUN_PATH" value="run.path"/> |
314 |
<param name="RUN_PATH" value="run.path"/> |
237 |
<param name="DB_URL" value="${db.url}"/> |
315 |
<param name="DB_URL" value="${db.url}"/> |
|
|
316 |
<param name="SERVER" value="false"/> |
238 |
</antcall> |
317 |
</antcall> |
239 |
<antcall target="generate-report" inheritRefs="true"/> |
318 |
<antcall target="generate-report" inheritRefs="true"/> |
240 |
</target> |
319 |
</target> |
Lines 260-265
Link Here
|
260 |
<jvmarg value="-Ddb.user=${db.user}"/> |
339 |
<jvmarg value="-Ddb.user=${db.user}"/> |
261 |
<jvmarg value="-Ddb.pwd=${db.pwd}"/> |
340 |
<jvmarg value="-Ddb.pwd=${db.pwd}"/> |
262 |
<jvmarg value="${jvmarg.db.platform}"/> |
341 |
<jvmarg value="${jvmarg.db.platform}"/> |
|
|
342 |
<jvmarg value="-Dservertest=${SERVER}"/> |
343 |
<sysproperty key="server.url" value="${server.url}${APP_NAME}"/> |
344 |
<sysproperty key="server.testrunner.wdf" value="${server.testrunner.wdf}"/> |
345 |
<sysproperty key="datasource.name" value="${DS_LOOKUP_NAME}"/> |
263 |
<classpath> |
346 |
<classpath> |
264 |
<path refid="${RUN_PATH}"/> |
347 |
<path refid="${RUN_PATH}"/> |
265 |
</classpath> |
348 |
</classpath> |
Lines 281-284
Link Here
|
281 |
</junitreport> |
364 |
</junitreport> |
282 |
</target> |
365 |
</target> |
283 |
|
366 |
|
|
|
367 |
|
368 |
<!-- Build server test ear. --> |
369 |
<target name="server-build-ear" depends="build-against-jar" > |
370 |
<copy overwrite="true" file="./resource/ear/application.xml" todir="${build.dir}/META-INF"/> |
371 |
<ear destfile="${wdf_test.build.location}/${build.dir}/servertest.ear" appxml="${build.dir}/META-INF/application.xml"> |
372 |
<fileset file="${wdf_test.build.location}/${eclipselink.tests.jar}"/> |
373 |
<zipfileset dir="${wdf_test.build.location}" includes="${eclipselink.wdf.jpa1.model}.jar" prefix="${LIB_PREFIX}"/> |
374 |
</ear> |
375 |
<copy file="${wdf_test.build.location}/${build.dir}/servertest.ear" todir="${basedir}"/> |
376 |
</target> |
377 |
|
378 |
<target name="server-deploy"> |
379 |
<ant antfile="${eclipselink.jpa.test}/${server.name}.xml" target="${server.name}-deploy" inheritRefs="true"> |
380 |
<property name="ear.name" value="${ear.name}"/> |
381 |
<property name="application.name" value="${application.name}"/> |
382 |
</ant> |
383 |
</target> |
384 |
|
385 |
<target name="server-undeploy"> |
386 |
<ant antfile="${eclipselink.jpa.test}/${server.name}.xml" target="${server.name}-undeploy" inheritRefs="true"> |
387 |
<property name="application.name" value="${application.name}"/> |
388 |
</ant> |
389 |
</target> |
390 |
|
391 |
<!-- Allows we run websphere tests from Windows & Linux both. --> |
392 |
<target name="detect-os"> |
393 |
<condition property="is.windows" value="true"> |
394 |
<os family="windows"/> |
395 |
</condition> |
396 |
<condition property="is.unix" value="true"> |
397 |
<os family="unix"/> |
398 |
</condition> |
399 |
<condition property="suffix" value="bat"> |
400 |
<isset property="is.windows"/> |
401 |
</condition> |
402 |
<condition property="suffix" value="sh"> |
403 |
<isset property="is.unix"/> |
404 |
</condition> |
405 |
<echo message="suffix=${suffix}"/> |
406 |
</target> |
407 |
|
408 |
|
409 |
<target name="set-app-name" depends="detect-os"> |
410 |
<condition property="APP_NAME" value=""> |
411 |
<contains string="${server.name}" substring="websphere"/> |
412 |
</condition> |
413 |
<condition property="APP_NAME" value="servertest"> |
414 |
<not> |
415 |
<isset property="is.websphere"/> |
416 |
</not> |
417 |
</condition> |
418 |
|
419 |
<condition property="DS_NAME" value="java:/EclipseLinkDS"> |
420 |
<contains string="${server.name}" substring="jboss"/> |
421 |
</condition> |
422 |
<condition property="DS_NAME" value="jdbc/EclipseLinkDS"> |
423 |
<not> |
424 |
<isset property="is.jboss"/> |
425 |
</not> |
426 |
</condition> |
427 |
|
428 |
<condition property="DS_LOOKUP_NAME" value="jdbc/${DS_NAME}"> |
429 |
<contains string="${server.name}" substring="netweaver"/> |
430 |
</condition> |
431 |
<condition property="DS_LOOKUP_NAME" value="${DS_NAME}"> |
432 |
<not> |
433 |
<isset property="is.netweaver"/> |
434 |
</not> |
435 |
</condition> |
436 |
|
437 |
|
438 |
<condition property="LIB_PREFIX" value=""> |
439 |
<contains string="${server.name}" substring="netweaver"/> |
440 |
</condition> |
441 |
<condition property="LIB_PREFIX" value="lib"> |
442 |
<not> |
443 |
<isset property="is.netweaver"/> |
444 |
</not> |
445 |
</condition> |
446 |
</target> |
447 |
|
448 |
<!-- Build, deploy and run a test suite on the server. --> |
449 |
<target name="server-test-internal" depends="get-server-properties, detect-os, set-app-name, server-build-ear, init_runtime"> |
450 |
<antcall target="server-deploy" inheritRefs="true"> |
451 |
<param name="ear.name" value="servertest.ear"/> |
452 |
<param name="application.name" value="servertest"/> |
453 |
</antcall> |
454 |
<path id="run.path.server"> |
455 |
<fileset dir="${server.lib}" includes="${server.depend}"/> |
456 |
<path refid="run.path"/> |
457 |
</path> |
458 |
<antcall target="run-test" inheritRefs="true"> |
459 |
<param name="TEST_CLASS" value="${test.class}"/> |
460 |
<param name="TEST_AGENT" value="${test.agent}"/> |
461 |
<param name="TEST_WEAVING" value="${test.weaving}"/> |
462 |
<param name="ORM_TESTING" value="-Dorm.testing=jpa"/> |
463 |
<param name="RUN_PATH" value="run.path.server"/> |
464 |
<param name="DB_URL" value="${db.url}"/> |
465 |
<param name="SERVER" value="true"/> |
466 |
</antcall> |
467 |
<antcall target="generate-report" inheritRefs="true"/> |
468 |
<antcall target="server-undeploy" inheritRefs="true"> |
469 |
<param name="application.name" value="servertest"/> |
470 |
</antcall> |
471 |
</target> |
472 |
|
473 |
|
284 |
</project> |
474 |
</project> |
|
|
475 |
|
476 |
|