blob: 157e54057275837fd5fd8948d6f901c7ef72beb0 [file] [log] [blame]
Vinay Vishal57171472018-09-18 20:22:00 +05301<?xml version="1.0"?>
2<!--
3
4 Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
5
6 This program and the accompanying materials are made available under the
7 terms of the Eclipse Public License v. 2.0, which is available at
8 http://www.eclipse.org/legal/epl-2.0.
9
10 This Source Code may also be made available under the following Secondary
11 Licenses when the conditions for such availability set forth in the
12 Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
13 version 2 with the GNU Classpath Exception, which is available at
14 https://www.gnu.org/software/classpath/license.html.
15
16 SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17
18-->
19
20<!DOCTYPE project [
21<!ENTITY commonSetup SYSTEM "file:./../../../../config/properties.xml">
22<!ENTITY commonBuild SYSTEM "file:./../../../../config/common.xml">
23<!ENTITY jaxwsTools SYSTEM "file:./../../annotations/jaxwstools.xml">
24<!ENTITY jbicommon SYSTEM "file:./../jbi_commons.xml">
25<!ENTITY jbiproperties SYSTEM "file:./../jbi_commons.properties">
26<!ENTITY testproperties SYSTEM "file:./build.properties">
27]>
28
29<project name="web-client" default="all" basedir=".">
30
31 &commonSetup;
32 &commonBuild;
33 &testproperties;
34 &jaxwsTools;
35 &jbicommon;
36 &jbiproperties;
37
38 <target name="all" depends="clean, setup-server, setup-client, deploy-provider-su, deploy-consumer-su, runtest, cleanup-client, cleanup-server"/>
39
40 <target name="clean" depends="init-common">
41 <antcall target="clean-common"/>
42 </target>
43
44 <target name="setup-server" depends="assemble-web, deploy-app, start-consumer-jms-binding"/>
45
46 <target name="setup-client" depends="assemble-client,deploy-client, start-provider-jms-binding"/>
47
48 <target name="cleanup-server" depends="undeploy-app, undeploy-consumer-su,stop-consumer-jms-binding"/>
49 <target name="cleanup-client" depends="undeploy-client, undeploy-provider-su,stop-provider-jms-binding"/>
50
51
52 <target name="assemble-web" depends="init-common, compile">
53 <echo message="Assembling web service module"/>
54 <antcall target="pkg-war">
55 <param name="war.classes" value="${build.classes.dir}"/>
56 <param name="war.file" value="${assemble.dir}/${appname}-web.war"/>
57 </antcall>
58 </target>
David Matějčekf4dc06a2021-05-17 12:10:57 +020059
Vinay Vishal57171472018-09-18 20:22:00 +053060 <target name="compile" depends="init-common">
61 <antcall target="compile-common">
62 <param name="src" value="provider/endpoint"/>
63 </antcall>
64 </target>
65
66 <target name="deploy-app">
67 <echo message="Deploying the web service"/>
68 <antcall target="deploy-war-common">
69 <param name="contextroot" value="${appname}"/>
70 </antcall>
71 </target>
72
73 <target name="deploy-consumer-su" depends="init-common">
74 <echo message="Creating QueueConnectionFactory for JMS Binding acting as a web service consumer"/>
75 <antcall target="create-jms-connection-factory">
76 <param name="jms.cf.name" value="MyQueueConnectionFactory"/>
77 </antcall>
78 <antcall target="create-jms-resource">
79 <param name="domain.admin.port" value="${admin.port}"/>
80 <param name="jms.res.type" value="${QueueConnectionFactory}"/>
81 <param name="jms.res.name" value="MyQueueConnectionFactory"/>
82 </antcall>
83 <echo message="deploying JMS Binding's consumer deployment "/>
84 <antcall target="deploy-jbi-component-su">
85 <param name="jbi-component-su-assembly" value="${jms-consumer-assembly}"/>
86 <param name="jbi-component-su" value="${jms-consumer-su}"/>
87 <param name="jbi-component-su-dir" value="${jms-consumer-su-dir}"/>
88 </antcall>
89 </target>
90
91 <target name="assemble-client" depends="init-common">
92 <echo message="Assembling web client"/>
93 <mkdir dir="${build.classes.dir}/webclient/WEB-INF/classes"/>
94 <mkdir dir="${assemble.dir}"/>
95 <echo message="wsimport -keep -d ${build.classes.dir}/webclient/WEB-INF/classes http://localhost:8080/jsr208-integration-web-client/CalculatorServicei?WSDL" />
96 <antcall target="wsimport">
97 <param name="wsimport.args"
98 value="-keep -d ${build.classes.dir}/webclient/WEB-INF/classes http://localhost:8080/jsr208-integration-web-client/CalculatorService?WSDL"/>
99 </antcall>
100 <javac srcdir="consumer" destdir="${build.classes.dir}/webclient/WEB-INF/classes"
David Matějčekf4dc06a2021-05-17 12:10:57 +0200101 classpath="${env.APS_HOME}/lib/reporter.jar:${env.S1AS_HOME}/lib/j2ee.jar:${env.S1AS_HOME}/lib/webservices-rt.jar:${env.S1AS_HOME}/lib/webservices-tools.jar"
Vinay Vishal57171472018-09-18 20:22:00 +0530102 includes="webclient/**"/>
103 <copy file="./consumer/client-web.xml" tofile="${build.classes.dir}/webclient/WEB-INF/web.xml"/>
104 <copy file="./consumer/client-sun-web.xml" tofile="${build.classes.dir}/webclient/WEB-INF/sun-web.xml"/>
105 <jar destfile="${assemble.dir}/wsclient.war" basedir="${build.classes.dir}/webclient" includes="**"/>
106 </target>
107
108 <target name="deploy-client" depends="assemble-client">
109 <echo message="Deploying the client application"/>
110 <property name="client.war" value="${assemble.dir}/wsclient.war"/>
111 <echo message="Deploying ${wsdl.war} from ${basedir}." level="verbose"/>
112 <exec executable="${ASADMIN}">
113 <arg line="deploy"/>
114 <arg line="--user ${admin.user}"/>
115 <arg line="--passwordfile ${admin.password.file}"/>
116 <arg line="--port ${domain2.admin.port}"/>
117 <arg line="${client.war}"/>
118 </exec>
119 </target>
120
121 <target name="deploy-provider-su" depends="init-common">
122 <echo message="Creating physical destinations - queues : - provideroutgoingqueue and temporary_queue"/>
123 <antcall target="create-physical-queue">
124 <param name="queue.name" value="provideroutgoingqueue"/>
125 </antcall>
126 <antcall target="create-physical-queue">
127 <param name="queue.name" value="temporary_queue"/>
128 </antcall>
129 <echo message="Create QueueConnectionFactory for JMS Binding which is acting as a provider"/>
130 <antcall target="create-jms-connection-factory">
131 <param name="jms.cf.name" value="MyQueueConnectionFactory"/>
132 </antcall>
133 <antcall target="create-jms-resource">
134 <param name="domain.admin.port" value="${domain2.admin.port}"/>
135 <param name="jms.res.type" value="${QueueConnectionFactory}"/>
136 <param name="jms.res.name" value="MyQueueConnectionFactory"/>
137 </antcall>
138 <echo message="Create JMS resource for provideroutgoingqueue and temporary_queue"/>
139 <antcall target="create-jms-queue">
140 <param name="jms.queue.name" value="provideroutgoingqueue"/>
141 <param name="queue.name" value="provideroutgoingqueue"/>
142 </antcall>
143 <antcall target="create-jms-queue">
144 <param name="jms.queue.name" value="temporary_queue"/>
145 <param name="queue.name" value="temporary_queue"/>
146 </antcall>
147 <echo message="Deploy JMS Binding provider deployment"/>
148 <antcall target="deploy-jbi-component-su">
149 <param name="jbi-component-su-assembly" value="${jms-provider-assembly}"/>
150 <param name="jbi-component-su" value="${jms-provider-su}"/>
151 <param name="jbi-component-su-dir" value="${jms-provider-su-dir}"/>
152 <param name="jmx.port" value="${domain2.jmx.port}"/>
153 </antcall>
154 </target>
155
156 <target name="undeploy-client" depends="init-common">
157 <echo message="Undeploying client application"/>
158 <exec executable="${ASADMIN}">
159 <arg line="undeploy"/>
160 <arg line="--user ${admin.user}"/>
161 <arg line="--passwordfile ${admin.password.file}"/>
162 <arg line="--host ${admin.host}"/>
163 <arg line="--port ${domain2.admin.port}"/>
164 <arg line="wsclient"/>
165 </exec>
166 </target>
167
168 <target name="undeploy-app" depends="init-common">
169 <echo message="Undeploying web service"/>
170 <exec executable="${ASADMIN}">
171 <arg line="undeploy"/>
172 <arg line="--user ${admin.user}"/>
173 <arg line="--passwordfile ${admin.password.file}"/>
174 <arg line="--host ${admin.host}"/>
175 <arg line="--port ${admin.port}"/>
176 <arg line="${appname}-web"/>
177 </exec>
178 </target>
David Matějčekf4dc06a2021-05-17 12:10:57 +0200179
Vinay Vishal57171472018-09-18 20:22:00 +0530180 <target name="runtest" depends="init-common">
181 <echo message="Running the test client"/>
182 <mkdir dir="${build.classes.dir}/client"/>
David Matějčekf4dc06a2021-05-17 12:10:57 +0200183 <javac srcdir="." destdir="${build.classes.dir}/client"
184 classpath="${env.APS_HOME}/lib/reporter.jar"
Vinay Vishal57171472018-09-18 20:22:00 +0530185 includes="consumer/client/**"/>
186 <unjar src="${env.APS_HOME}/lib/reporter.jar" dest="${build.classes.dir}/client"/>
187 <java classname="client.TestClient">
188 <classpath>
189 <pathelement path="${build.classes.dir}/client"/>
190 </classpath>
191 <arg value="http://${http.host}:${domain2.instance.port}/wsclient/webclient/RequestProcessor"/>
192 </java>
193 </target>
194
195
196 <target name="undeploy-consumer-su" depends="init-common">
197 <echo message="Undeploying JMS resource : MyQueueConnectionFactory"/>
198 <antcall target="delete-appserver-jms-resource">
199 <param name="domain.admin.port" value="${admin.port}"/>
200 <param name="jms.res.name" value="MyQueueConnectionFactory"/>
201 </antcall>
202 <!--<antcall target="delete-jms-resource">
203 <param name="jms.resource.name" value="MyQueueConnectionFactory"/>
204 </antcall>-->
205 <echo message="Undeploying JMS Binding consumer deployment"/>
206 <antcall target="undeploy-jbi-component-su">
207 <param name="jbi-component-su-assembly" value="${jms-consumer-assembly}"/>
208 </antcall>
209 </target>
210
211 <target name="undeploy-provider-su" depends="init-common">
212 <echo message="Undeploying JMS Resource :- provideroutgoingqueue and temporary_queue"/>
213 <antcall target="delete-jms-resource">
214 <param name="jms.resource.name" value="provideroutgoingqueue"/>
215 </antcall>
216 <antcall target="delete-jms-resource">
217 <param name="jms.resource.name" value="temporary_queue"/>
218 </antcall>
219 <echo message="Undeploying JMS resource : MyQueueConnectionFactory"/>
220 <antcall target="delete-appserver-jms-resource">
221 <param name="domain.admin.port" value="${domain2.admin.port}"/>
222 <param name="jms.res.name" value="MyQueueConnectionFactory"/>
223 </antcall>
224 <antcall target="delete-jms-resource">
225 <param name="jms.resource.name" value="MyQueueConnectionFactory"/>
226 </antcall>
227 <echo message="Deleting physical queues : provideroutgoingqueue , temporary_queue"/>
228 <antcall target="delete-physical-queue">
229 <param name="queue.name" value="provideroutgoingqueue"/>
230 </antcall>
231 <antcall target="delete-physical-queue">
232 <param name="queue.name" value="temporary_queue"/>
233 </antcall>
234 <echo message="Undeploying JMS Binding's provider deployment"/>
235 <antcall target="undeploy-jbi-component-su">
236 <param name="jbi-component-su-assembly" value="${jms-provider-assembly}"/>
237 <param name="jmx.port" value="${domain2.jmx.port}"/>
238 </antcall>
239 </target>
240
241 <target name="create-domain2" depends="init-common">
242 <property name="admin.command" value="create-domain"/>
243 <property name="operand.props" value="--adminport ${domain2.admin.port} --adminuser admin --passwordfile ${admin.password.file} --instanceport ${domain2.instance.port} --savemasterpassword=true --domainproperties domain.jmxPort=${domain2.jmx.port}:jms.port=${domain2.jms.port}:orb.listner.port=${domain2.orb.listner.port}:http.ssl.port=${domain2.http.ssl.port}:orb.mutualauth.port=${domain2.orb.mutualauth.port} ${domain.name}"/>
244 <exec executable="${ASADMIN}" failonerror="true">
245 <arg line="${admin.command} ${operand.props}" />
246 </exec>
247 </target>
248
249 <target name="start-domain2" depends="init-common">
250 <exec executable="${ASADMIN}" failonerror="true">
251 <arg line="start-domain --user ${admin.user} ${domain.name}"/>
252 </exec>
253 </target>
254
255 <target name="create-physical-queue" depends="init-common">
256 <exec executable="${env.S1AS_HOME}/imq/bin/imqcmd" failonerror="false">
257 <arg line="create dst -n ${queue.name} -t q -u admin -passfile ${broker.password.file} -b localhost:${imq.broker.port}"/>
258 </exec>
259 </target>
260
261 <target name="create-jms-resource" depends="init-common">
262 <exec executable="${env.S1AS_HOME}/bin/asadmin" failonerror="false">
263 <arg line="create-jms-resource --user ${admin.user} --passwordfile ${admin.password.file} --port ${domain.admin.port} --restype ${jms.res.type} ${jms.res.name}"/>
264 </exec>
265 </target>
266 <target name="create-jms-queue" depends="init-common">
267 <exec executable="${env.S1AS_HOME}/imq/bin/imqobjmgr" failonerror="false">
268 <arg line="add -l &quot;${jms.queue.name}&quot; -t q -o &quot;imqDestinationName=${queue.name}&quot; -j &quot;java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory&quot; -j &quot;java.naming.provider.url=file:/tmp/imqobjects&quot;"/>
269 </exec>
270 </target>
271
272 <target name="create-jms-connection-factory" depends="init-common">
273 <exec executable="${env.S1AS_HOME}/imq/bin/imqobjmgr" failonerror="true">
274 <arg line="add -f -l &quot;${jms.cf.name}&quot; -t qf -o &quot;imqAddressList=mq://localhost:${imq.broker.port}/jms&quot; -j &quot;java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory&quot; -j &quot;java.naming.provider.url=file:/tmp/imqobjects&quot;"/>
275 </exec>
276 </target>
277
278 <target name="delete-physical-queue" depends="init-common" >
279 <exec executable="${env.S1AS_HOME}/imq/bin/imqcmd" failonerror="false">
280 <arg line="destroy dst -f -n ${queue.name} -t q -passfile ${broker.password.file} -u admin -b localhost:${imq.broker.port}" />
281 </exec>
282 </target>
283
284 <target name="delete-jms-resource" depends="init-common">
285 <exec executable="${env.S1AS_HOME}/imq/bin/imqobjmgr" failonerror="false">
286 <arg line="delete -f -l &quot;${jms.resource.name}&quot; -j &quot;java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory&quot; -j &quot;java.naming.provider.url=file:/tmp/imqobjects&quot;"/>
287 </exec>
288 </target>
289 <target name="delete-appserver-jms-resource" depends="init-common">
290 <exec executable="${env.S1AS_HOME}/bin/asadmin" failonerror="false">
291 <arg line="delete-jms-resource --user ${admin.user} --passwordfile ${admin.password.file} --port ${domain.admin.port} ${jms.res.name}"/>
292 </exec>
293 </target>
294
295 <target name="delete-domain2" depends="init-common">
296 <exec executable="${ASADMIN}" failonerror="true">
297 <arg line="delete-domain domain2 " />
298 </exec>
299 </target>
300 <target name="stop-provider-jms-binding" depends="init-common">
301 <antcall target="stop-binding">
302 <param name="jmx.port" value="${domain2.jmx.port}"/>
303 <param name="jbi.component.name" value="SunJMSBinding"/>
304 </antcall>
305 </target>
306 <target name="start-provider-jms-binding" depends="init-common">
307 <antcall target="start-binding">
308 <param name="jmx.port" value="${domain2.jmx.port}"/>
309 <param name="jbi.component.name" value="SunJMSBinding"/>
310 </antcall>
311 </target>
312 <target name="stop-consumer-jms-binding" depends="init-common">
313 <antcall target="stop-binding">
314 <param name="jbi.component.name" value="SunJMSBinding"/>
315 </antcall>
316 </target>
317 <target name="start-consumer-jms-binding" depends="init-common">
318 <antcall target="start-binding">
319 <param name="jbi.component.name" value="SunJMSBinding"/>
320 </antcall>
321 </target>
322</project>
323