blob: e99995cab543e4d16b55f3a43ba6e2ff3f4c464e [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE project [
<!--
Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!ENTITY commonBuild SYSTEM "./../../config/common.xml">
]>
<project name="HelloServiceWS" default="all" basedir=".">
&commonBuild;
<property name="testName" value="SayHelloWS"/>
<property name="archivedir" value="${build}/archives"/>
<target name="prepare" depends="init">
<property name="binary" value="${build}/WEB-INF/classes"/>
<property name="wsdl" value="${build}/WEB-INF/wsdl"/>
<mkdir dir="${binary}" />
<mkdir dir="${wsdl}"/>
<mkdir dir="${build}/ejb"/>
<property name="portable.war" value="${archivedir}/sayhello-portable.war"/>
<property name="portable.jar" value="${archivedir}/statelesshello-portable.jar"/>
<property name="portable.ear" value="${archivedir}/sayhello-portable.ear"/>
<property name="all.war" value="${archivedir}/sayhello.war"/>
<property name="all.jar" value="${archivedir}/statelesshello.jar"/>
<property name="all.ear" value="${archivedir}/sayhello.ear"/>
<property name="deployplan.jar" value="${archivedir}/sayhello-deployplan.jar"/>
</target>
<target name="compile" depends="prepare">
<javac srcdir="statelesshello" destdir="${build}/ejb">
<classpath refid="gfv3.classpath"/>
</javac>
<javac srcdir="helloservice" destdir="${binary}">
<classpath refid="gfv3.classpath"/>
</javac>
<echo message="invoking wscompile to generate wsdl file"/>
<exec executable="${WSCOMPILE}">
<arg line="-define config-interface.xml -d ${binary} -nd ${wsdl} -classpath ${binary} -mapping ${build}/mapping.xml"/>
</exec>
</target>
<target name="assemble" depends="compile">
<copy file="web.xml" todir="${build}/WEB-INF"/>
<copy file="webservices.xml" todir="${build}/WEB-INF"/>
<jar destfile="${portable.war}" basedir="${build}"/>
<copy file="sun-web.xml" todir="${build}/WEB-INF" failonerror="false"/>
<jar destfile="${all.war}" basedir="${build}"/>
<mkdir dir="${build}/ejb/META-INF"/>
<copy file="ejb-jar.xml" todir="${build}/ejb/META-INF"/>
<jar destfile="${portable.jar}" basedir="${build}/ejb"/>
<copy file="sun-ejb-jar.xml" todir="${build}/ejb/META-INF" failonerror="false"/>
<jar destfile="${all.jar}" basedir="${build}/ejb"/>
<mkdir dir="${build}/plan"/>
<copy file="sun-ejb-jar.xml" tofile="${build}/plan/statelesshello-portable.jar.sun-ejb-jar.xml"/>
<copy file="sun-web.xml" tofile="${build}/plan/sayhello-portable.war.sun-web.xml"/>
<jar destfile="${deployplan.jar}" basedir="${build}/plan"/>
<mkdir dir="${build}/ear"/>
<mkdir dir="${build}/ear/META-INF"/>
<copy file="application.xml" todir="${build}/ear/META-INF"/>
<copy file="${all.war}" todir="${build}/ear"/>
<copy file="${all.jar}" todir="${build}/ear"/>
<jar destfile="${all.ear}" basedir="${build}/ear"/>
<delete file="${build}/ear/sayhello.war"/>
<delete file="${build}/ear/statelesshello.jar"/>
<delete file="${build}/ear/META-INF/application.xml"/>
<copy file="portable-app.xml" tofile="${build}/ear/META-INF/application.xml"/>
<copy file="${portable.war}" todir="${build}/ear"/>
<copy file="${portable.jar}" todir="${build}/ear"/>
<jar destfile="${portable.ear}" basedir="${build}/ear"/>
</target>
<target name="deploy.asadmin" depends="prepare">
<antcall target="common.deploy.asadmin">
<param name="arg.list" value="--name ${testName} ${all.ear}"/>
<param name="testName" value="${testName}"/>
</antcall>
<echo message="Create client webservices artifacts"/>
<exec executable="${WSCOMPILE}">
<arg line="-gen:client -keep -d ${binary} -classpath ${binary} config-interface.xml"/>
</exec>
</target>
<target name="redeploy.asadmin" depends="prepare">
<antcall target="common.redeploy.asadmin">
<param name="arg.list" value="--name ${testName} ${all.ear}"/>
<param name="testName" value="${testName}"/>
</antcall>
<echo message="Create client webservices artifacts"/>
<exec executable="${WSCOMPILE}">
<arg line="-gen:client -keep -d ${binary} -classpath ${binary} config-interface.xml"/>
</exec>
</target>
<target name="undeploy.asadmin">
<antcall target="common.undeploy.asadmin">
<param name="arg.list" value="${testName}"/>
<param name="testName" value="${testName}"/>
</antcall>
</target>
<target name="deploy.jsr88" depends="prepare">
<antcall target="common.deploy.jsr88">
<param name="arg.list" value="${portable.ear} ${deployplan.jar}"/>
</antcall>
</target>
<target name="redeploy.jsr88" depends="prepare">
<antcall target="common.run.jsr88">
<param name="command" value="redeploy"/>
<param name="arg.list" value="sayhello-portable ${portable.ear} ${deployplan.jar}"/>
</antcall>
</target>
<target name="undeploy.jsr88">
<antcall target="common.undeploy.jsr88">
<param name="arg.list" value="sayhello-portable"/>
</antcall>
</target>
<target name="start.jsr88">
<antcall target="common.run.jsr88">
<param name="command" value="start"/>
<param name="arg.list" value="sayhello-portable"/>
</antcall>
</target>
<target name="stop.jsr88">
<antcall target="common.run.jsr88">
<param name="command" value="stop"/>
<param name="arg.list" value="sayhello-portable"/>
</antcall>
</target>
<target name="deploy.autodeploy">
</target>
<target name="run" depends="run.positive"/>
<target name="run.positive" depends="setHttpPort">
<antcall target="common.run.positive">
<param name="link" value="HelloService/HelloService"/>
<param name="log.id" value="${log.id}"/>
</antcall>
</target>
<target name="run.negative" depends="setHttpPort">
<antcall target="common.run.negative">
<param name="link" value="HelloService/HelloService"/>
<param name="log.id" value="${log.id}"/>
</antcall>
</target>
<target name="runclient" depends="prepare">
<javac srcdir="staticstubclient" destdir="${binary}"
classpath="${inst}/lib/j2ee.jar:${inst}/lib/webservices-rt.jar:${inst}/lib/webservices-tools.jar"/>
<javaWithResult
fork="true"
failonerror="false"
jvm="${JAVA}"
classname="staticstubclient.SayHelloClient"
output="${build}/${log.id}.output.log"
resultproperty="result">
<classpath>
<path location="${inst}/lib/j2ee.jar"/>
<path location="${inst}/lib/webservices-rt.jar"/>
<path location="${inst}/lib/webservices-tools.jar"/>
<path location="${binary}"/>
</classpath>
<arg line="${arg.list}"/>
</javaWithResult>
<antcall target="processResult">
<param name="result" value="${result}"/>
<param name="log" value="${build}/${log.id}.output.log"/>
</antcall>
</target>
<target name="private-all">
<antcall target="assemble"/>
<antcall target="deploy.asadmin"/>
<antcall target="run.positive">
<param name="log.id" value="1"/>
<param name="desc" value="ear/earwithall Test asadmin deploy"/>
</antcall>
<antcall target="redeploy.asadmin"/>
<antcall target="run.positive">
<param name="log.id" value="2"/>
<param name="desc" value="ear/earwithall Test asadmin redeploy"/>
</antcall>
<antcall target="undeploy.asadmin"/>
<!--
<antcall target="deploy.jsr88"/>
<antcall target="run.positive">
<param name="log.id" value="3"/>
<param name="desc" value="ear/earwithall Test jsr88 deploy"/>
</antcall>
-->
<!--antcall target="stop.jsr88"/>
<antcall target="run.negative">
<param name="log.id" value="4"/>
<param name="desc" value="ear/earwithall Test jsr88 stopped state"/>
</antcall>
<antcall target="start.jsr88"/>
<antcall target="run.positive">
<param name="log.id" value="5"/>
<param name="desc" value="ear/earwithall Test jsr88 started state"/>
</antcall>
<antcall target="stop.jsr88"/>
<antcall target="redeploy.jsr88"/>
<antcall target="run.negative">
<param name="log.id" value="6"/>
<param name="desc" value="ear/earwithall Test jsr88 redeploy stop"/>
</antcall>
<antcall target="start.jsr88"/>
<antcall target="redeploy.jsr88"/>
<antcall target="run.positive">
<param name="log.id" value="7"/>
<param name="desc" value="ear/earwithall Test jsr88 redeploy start"/>
</antcall-->
<!--
<antcall target="undeploy.jsr88"/>
-->
</target>
</project>