Line 0
Link Here
|
|
|
1 |
<!--/******************************************************************************* |
2 |
* This program and the accompanying materials are made available under the |
3 |
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 |
4 |
* which accompanies this distribution. |
5 |
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
6 |
* and the Eclipse Distribution License is available at |
7 |
* http://www.eclipse.org/org/documents/edl-v10.php. |
8 |
* |
9 |
* Ant naming conventions: |
10 |
* - regardless of the actual OS platform,'/' is the directory separator |
11 |
* (Ant will convert as appropriate). |
12 |
* - multi-word properties use periods '.' |
13 |
* - multi-word targets use hyphens '-' |
14 |
* - multi-word macros use underscores '_' |
15 |
* - multi-word macro attributes are concatinated |
16 |
* e.g. 'runpathref' |
17 |
* - multi-word tasks (taskdef) names are concatinated |
18 |
* e.g. 'validateconnection' |
19 |
* - OS environment variables are in ALLCAPS and have 'env' as a prefix |
20 |
* e.g. ${env.XXX}. |
21 |
* - Ant properties are lower case. |
22 |
* |
23 |
* Contributors: |
24 |
* pvijayaratnam - cache coordination test implementation |
25 |
#******************************************************************************/--> |
26 |
|
27 |
<project name="Eclipse Persistence Services JPA WLS CacheCoordination Testing" basedir="."> |
28 |
|
29 |
<property name="env" environment="env" value="env"/> |
30 |
<!-- Allows a user to overide certain user specific properties. --> |
31 |
<property name="eclipselink.jpa.test" value="."/> |
32 |
<property file="${eclipselink.jpa.test}/build.properties"/> |
33 |
<property file="${user.home}/${server.name}.properties"/> |
34 |
<property file="test.properties"/> |
35 |
<property file="./${server.name}.properties"/> |
36 |
|
37 |
<!-- *********** CacheCoordination Test Targets --> |
38 |
<target name="weblogic-run-test-cachecoordination"> |
39 |
<property file="${eclipselink.jpa.test}/${server.name}.properties"/> |
40 |
<antcall target="build-deploy-cachecoordination-wls"/> |
41 |
<antcall target="runclient-cachecoordination-wls"/> |
42 |
<ant antfile="${eclipselink.jpa.test}/build.xml" target="generate-report" inheritRefs="true"/> |
43 |
<antcall target="server-undeploy-cachecoordination-server2" inheritRefs="true"> |
44 |
<param name="application.name" value="eclipselink-sessionbean-model-server2"/> |
45 |
</antcall> |
46 |
<antcall target="server-undeploy-cachecoordination-server1" inheritRefs="true"> |
47 |
<param name="application.name" value="eclipselink-sessionbean-model-server1"/> |
48 |
</antcall> |
49 |
<ant antfile="${eclipselink.jpa.test}/cachecoordination_${server.name}.xml" target="${server.name}-stop-cachecoordination" inheritRefs="true"/> |
50 |
<delete includeEmptyDirs="true" failonerror="false"> |
51 |
<fileset dir="${weblogic.domain}/servers/${rcm.wls.server3.name}/tmp"/> |
52 |
<fileset dir="${weblogic.domain}/servers/${rcm.wls.server2.name}/tmp"/> |
53 |
<fileset dir="${weblogic.domain}/servers/${rcm.wls.server1.name}/tmp"/> |
54 |
</delete> |
55 |
</target> |
56 |
<target name="build-deploy-cachecoordination-wls"> |
57 |
<sequential> |
58 |
<antcall target="config-persistence-xml"/> |
59 |
<antcall target="cachecoordination-build-and-deploy-server1" inheritRefs="true"> |
60 |
<param name="PERSISTENCE_UNIT_NAME" value="sessionbean"/> |
61 |
<param name="MODEL_DIR" value="org/eclipse/persistence/testing/models/jpa/sessionbean"/> |
62 |
<param name="MODEL_DIR2" value="org/eclipse/persistence/testing/models/jpa/fieldaccess/advanced"/> |
63 |
<param name="MODEL_NAME" value="eclipselink-sessionbean-model"/> |
64 |
<param name="TEST_DIR" value="org/eclipse/persistence/testing/tests/jpa/sessionbean"/> |
65 |
<param name="TEST_NAME" value="eclipselink-sessionbean-model"/> |
66 |
<param name="EAR_NAME" value="eclipselink-sessionbean-model-server1"/> |
67 |
<param name="TEST_SUITE" value="org.eclipse.persistence.testing.tests.jpa.sessionbean.SessionBeanTestsRCM"/> |
68 |
<param name="eclipselink.jpa.test.dir" value="."/> |
69 |
</antcall> |
70 |
<antcall target="cachecoordination-build-and-deploy-server2" inheritRefs="true"> |
71 |
<param name="PERSISTENCE_UNIT_NAME" value="sessionbean"/> |
72 |
<param name="MODEL_DIR" value="org/eclipse/persistence/testing/models/jpa/sessionbean"/> |
73 |
<param name="MODEL_DIR2" value="org/eclipse/persistence/testing/models/jpa/fieldaccess/advanced"/> |
74 |
<param name="MODEL_NAME" value="eclipselink-sessionbean-model"/> |
75 |
<param name="TEST_DIR" value="org/eclipse/persistence/testing/tests/jpa/sessionbean"/> |
76 |
<param name="TEST_NAME" value="eclipselink-sessionbean-model"/> |
77 |
<param name="EAR_NAME" value="eclipselink-sessionbean-model-server2"/> |
78 |
<param name="TEST_SUITE" value="org.eclipse.persistence.testing.tests.jpa.sessionbean.SessionBeanTestsRCM"/> |
79 |
<param name="eclipselink.jpa.test.dir" value="."/> |
80 |
</antcall> |
81 |
<copy overwrite="true" file="${eclipselink.jpa.test}/${resource.dir}/server/persistence_original.xml" tofile="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml"/> |
82 |
<delete file="${eclipselink.jpa.test}/${resource.dir}/server/persistence_original.xml"/> |
83 |
</sequential> |
84 |
</target> |
85 |
<target name="runclient-cachecoordination-wls"> |
86 |
<antcall target="server-run-test-cachecoordination" inheritRefs="true"> |
87 |
<param name="PERSISTENCE_UNIT_NAME" value="sessionbean"/> |
88 |
<param name="MODEL_DIR" value="org/eclipse/persistence/testing/models/jpa/sessionbean"/> |
89 |
<param name="MODEL_DIR2" value="org/eclipse/persistence/testing/models/jpa/fieldaccess/advanced"/> |
90 |
<param name="MODEL_NAME" value="eclipselink-sessionbean-model"/> |
91 |
<param name="TEST_DIR" value="org/eclipse/persistence/testing/tests/jpa/sessionbean"/> |
92 |
<param name="TEST_NAME" value="eclipselink-sessionbean-model"/> |
93 |
<param name="EAR_NAME" value="eclipselink-sessionbean-model-server2"/> |
94 |
<param name="TEST_SUITE" value="org.eclipse.persistence.testing.tests.jpa.sessionbean.SessionBeanTestsRCM"/> |
95 |
<param name="eclipselink.jpa.test.dir" value="."/> |
96 |
</antcall> |
97 |
</target> |
98 |
|
99 |
<target name="set-app-name-cachecoordination"> |
100 |
<property name="APP_NAME" value="${MODEL_NAME}"/> |
101 |
<property name="DS_NAME" value="jdbc/EclipseLinkDS"/> |
102 |
</target> |
103 |
|
104 |
<condition property="is.jms"> |
105 |
<contains string="${cachecoordination.protocol}" substring="jms"/> |
106 |
</condition> |
107 |
|
108 |
<condition property="is.rmi"> |
109 |
<contains string="${cachecoordination.protocol}" substring="rmi"/> |
110 |
</condition> |
111 |
|
112 |
<!-- Build and deploy to Server1 --> |
113 |
<target name="config-persistence-xml"> |
114 |
<copy overwrite="true" file="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml" tofile="${eclipselink.jpa.test}/${resource.dir}/server/persistence_original.xml" /> |
115 |
<copy overwrite="true" file="${eclipselink.jpa.test}/${resource.dir}/server/persistence_cachecoordination.xml" tofile="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml"/> |
116 |
<replace file="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml" token='%%data-source-name%%' value="jdbc/EclipseLinkDS"/> |
117 |
<replace file="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml" token='%%topic-host-url%%' value="${rcm.wls.jms.topichost.url}"/> |
118 |
<replace file="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml" token='%%topic-name%%' value="${rcm.wls.jms.topicname}"/> |
119 |
<replace file="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml" token='%%topic-connection-factory%%' value="${rcm.wls.jms.topic.connectionfactory.name}"/> |
120 |
<replace file="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml" token='%%server-user%%' value="${server.user}"/> |
121 |
<replace file="${eclipselink.jpa.test}/${resource.dir}/server/persistence.xml" token='%%server-pwd%%' value="${server.pwd}"/> |
122 |
</target> |
123 |
|
124 |
<target name="session-customizer-jms" if="is.jms"> |
125 |
<copy overwrite="true" file="${eclipselink.jpa.test}/${src.dir}/org/eclipse/persistence/testing/models/jpa/sessionbean/JPASessionCustomizer_jms.java" tofile="${eclipselink.jpa.test}/${src.dir}/org/eclipse/persistence/testing/models/jpa/sessionbean/JPASessionCustomizer.java"/> |
126 |
</target> |
127 |
|
128 |
<target name="session-customizer-rmi" if="is.rmi"> |
129 |
<copy overwrite="true" file="${eclipselink.jpa.test}/${src.dir}/org/eclipse/persistence/testing/models/jpa/sessionbean/JPASessionCustomizer_rmi.java" tofile="${eclipselink.jpa.test}/${src.dir}/org/eclipse/persistence/testing/models/jpa/sessionbean/JPASessionCustomizer.java"/> |
130 |
<replace file="${eclipselink.jpa.test}/${src.dir}/org/eclipse/persistence/testing/models/jpa/sessionbean/JPASessionCustomizer.java" token='%%current-server-url%%' value="${current.server.url}"/> |
131 |
</target> |
132 |
|
133 |
<target name="cachecoordination-build-and-deploy-server1" depends="set-app-name-cachecoordination"> |
134 |
<antcall target="session-customizer-jms" inheritRefs="true"/> |
135 |
<antcall target="session-customizer-rmi" inheritRefs="true"> |
136 |
<param name="current.server.url" value="rcm.wls.server1.url"/> |
137 |
</antcall> |
138 |
<ant antfile="${eclipselink.jpa.test}/build.xml" target="server-build" inheritRefs="true"/> |
139 |
<delete file="${eclipselink.jpa.test}/${src.dir}/org/eclipse/persistence/testing/models/jpa/sessionbean/JPASessionCustomizer.java"/> |
140 |
<antcall target="server-deploy-cachecoordination-server1" inheritRefs="true"> |
141 |
<param name="ear.name" value="${EAR_NAME}.ear"/> |
142 |
<param name="application.name" value="${EAR_NAME}"/> |
143 |
</antcall> |
144 |
</target> |
145 |
<target name="cachecoordination-build-and-deploy-server2" depends="set-app-name-cachecoordination"> |
146 |
<antcall target="session-customizer-jms" inheritRefs="true"/> |
147 |
<antcall target="session-customizer-rmi" inheritRefs="true"> |
148 |
<param name="current.server.url" value="rcm.wls.server2.url"/> |
149 |
</antcall> |
150 |
<ant antfile="${eclipselink.jpa.test}/build.xml" target="server-build" inheritRefs="true"/> |
151 |
<delete file="${eclipselink.jpa.test}/${src.dir}/org/eclipse/persistence/testing/models/jpa/sessionbean/JPASessionCustomizer.java"/> |
152 |
<antcall target="server-deploy-cachecoordination-server2" inheritRefs="true"> |
153 |
<param name="ear.name" value="${EAR_NAME}.ear"/> |
154 |
<param name="application.name" value="${EAR_NAME}"/> |
155 |
</antcall> |
156 |
</target> |
157 |
|
158 |
<target name="server-deploy-cachecoordination-server1"> |
159 |
<ant antfile="${eclipselink.jpa.test}/cachecoordination_${server.name}.xml" target="${server.name}-deploy" inheritRefs="true"> |
160 |
<property name="ear.name" value="${ear.name}"/> |
161 |
<property name="application.name" value="${application.name}"/> |
162 |
<property name="target.server" value="${rcm.wls.server1.name}"/> |
163 |
</ant> |
164 |
</target> |
165 |
|
166 |
<target name="server-deploy-cachecoordination-server2"> |
167 |
<ant antfile="${eclipselink.jpa.test}/cachecoordination_${server.name}.xml" target="${server.name}-deploy" inheritRefs="true"> |
168 |
<property name="ear.name" value="${ear.name}"/> |
169 |
<property name="application.name" value="${application.name}"/> |
170 |
<property name="target.server" value="${rcm.wls.server2.name}"/> |
171 |
</ant> |
172 |
</target> |
173 |
<target name="server-undeploy-cachecoordination-server1"> |
174 |
<ant antfile="${eclipselink.jpa.test}/cachecoordination_${server.name}.xml" target="${server.name}-undeploy" inheritRefs="true"> |
175 |
<property name="application.name" value="${application.name}"/> |
176 |
<property name="target.server" value="${rcm.wls.server1.name}"/> |
177 |
</ant> |
178 |
</target> |
179 |
<target name="server-undeploy-cachecoordination-server2"> |
180 |
<ant antfile="${eclipselink.jpa.test}/cachecoordination_${server.name}.xml" target="${server.name}-undeploy" inheritRefs="true"> |
181 |
<property name="application.name" value="${application.name}"/> |
182 |
<property name="target.server" value="${rcm.wls.server2.name}"/> |
183 |
</ant> |
184 |
</target> |
185 |
|
186 |
<target name="server-run-test-cachecoordination" depends="config-compile-path"> |
187 |
<property file="${eclipselink.jpa.test}/${server.name}.properties"/> |
188 |
<path id="run.path"> |
189 |
<pathelement path="${eclipselink.jpa.test}/${build.dir}/${TEST_NAME}_client.jar"/> |
190 |
<pathelement path="${eclipselink.jpa.test}/${build.dir}/${MODEL_NAME}_ejb.jar"/> |
191 |
<fileset dir="${server.lib}" includes="${server.depend}"/> |
192 |
<path refid="compile.server.path"/> |
193 |
</path> |
194 |
<echo>Running "** ${cachecoordination.protocol} **" Cache Coordination tests: ${EAR_NAME} on ${server.name}</echo> |
195 |
<mkdir dir="${eclipselink.jpa.test}/${report.dir}"/> |
196 |
<junit printsummary="yes" haltonfailure="yes" failureproperty="junit.failed" fork="yes" showoutput="true" maxmemory="256m" dir="${run.dir}"> |
197 |
<sysproperty key="server.platform" value="${server.platform}"/> |
198 |
<sysproperty key="server.user" value="${server.user}"/> |
199 |
<sysproperty key="server.password" value="${server.pwd}"/> |
200 |
<sysproperty key="server.url" value="${rcm.wls.server2.url}${MODEL_NAME}"/> |
201 |
<sysproperty key="server.testrunner" value="${server.testrunner}"/> |
202 |
<sysproperty key="server.run" value="TRUE"/> |
203 |
<classpath refid="run.path"/> |
204 |
<formatter type="xml"/> |
205 |
<test name="${TEST_SUITE}" haltonfailure="no" outfile="${report.dir}/${TEST_SUITE}-test-results"/> |
206 |
</junit> |
207 |
</target> |
208 |
|
209 |
<target name="config-compile-path"> |
210 |
<path id="compile.path"> |
211 |
<pathelement path="${eclipselink.jpa}/${classes.dir}"/> |
212 |
<fileset |
213 |
dir="${eclipselink.core.lib.dir}" |
214 |
includes="${eclipselink.core.depend}"/> |
215 |
<pathelement path="${eclipselink.jar.name}"/> |
216 |
<pathelement path="${junit.lib}"/> |
217 |
</path> |
218 |
<path id="compile.server.path"> |
219 |
<path refid="compile.path"/> |
220 |
<pathelement path="${jdbc.driver.jar}"/> |
221 |
</path> |
222 |
</target> |
223 |
|
224 |
</project> |