blob: f1f48e9f655be2d9f6ce545909581e15d1978986 [file] [log] [blame]
<?xml version="1.0"?>
<!--
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
-->
<!DOCTYPE project [
<!ENTITY commonSetup SYSTEM "./../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "./../../../../config/common.xml">
<!ENTITY jaxwsTools SYSTEM "./../jaxwstools.xml">
<!ENTITY testproperties SYSTEM "./build.properties">
]>
<project name="webserviceref-cobundle" default="all" basedir=".">
&commonSetup;
&commonBuild;
&testproperties;
&jaxwsTools;
<path id="classpath">
<fileset dir="${env.S1AS_HOME}/modules">
<include name="*.jar"/>
</fileset>
<fileset dir="${env.S1AS_HOME}/modules/endorsed">
<include name="*.jar"/>
</fileset>
<fileset dir="${env.APS_HOME}/lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="all" depends="clean, setup, runtest,undeploy"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
<delete dir="${env.S1AS_HOME}/build/localwsdl"/>
</target>
<target name="setup" depends="assemble-web, deploy-app" />
<target name="compile" depends="init-common">
<mkdir dir="${build.classes.dir}"/>
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="${basedir}" includes="webclient/**, endpoint/**"
destdir="${build.classes.dir}"
classpath="${s1astest.classpath}"
debug="on"
failonerror="true">
</javac>
</target>
<target name="assemble-web" depends="init-common">
<mkdir dir="${build.classes.dir}"/>
<antcall target="wsimport">
<param name="wsimport.args"
value=" -Xendorsed -p service -keep -d ${build.classes.dir} ${basedir}/SubtractNumbers.wsdl"/>
</antcall>
<antcall target="compile"/>
<antcall target="pkg-bundle"/>
</target>
<target name="pkg-bundle">
<property name="wsdlfile.location" value="${basedir}"/>
<property name="wsdlfile.name" value="SubtractNumbers.wsdl"/>
<property name="war.classes" value="${build.classes.dir}"/>
<property name="war.file" value="${assemble.dir}/${appname}-web.war"/>
<mkdir dir="${assemble.dir}"/>
<echo message="my build classes dir is:${build.classes.dir}" level="verbose"/> <mkdir dir="${build.classes.dir}/tmp"/>
<mkdir dir="${build.classes.dir}/tmp/WEB-INF"/>
<mkdir dir="${build.classes.dir}/tmp/WEB-INF/classes"/>
<mkdir dir="${build.classes.dir}/tmp/WEB-INF/wsdl"/>
<copy file="${wsdlfile.location}/${wsdlfile.name}"
tofile="${build.classes.dir}/tmp/WEB-INF/wsdl/${wsdlfile.name}"
failonerror="false"/>
<copy file="${web.xml}"
tofile="${build.classes.dir}/tmp/WEB-INF/web.xml" failonerror="false"/>
<copy todir="${build.classes.dir}/tmp/WEB-INF/classes">
<fileset dir="${war.classes}">
<include name="**/*.class"/>
</fileset>
</copy>
<echo message="Creating war file ${war.file}" level="verbose"/>
<jar jarfile="${war.file}" basedir="${build.classes.dir}/tmp" update="true">
<!--<fileset dir="${build.classes.dir}/tmp" casesensitive="yes">-->
<!--<include name="**/*class*"/>-->
<!--</fileset>-->
<!--<fileset dir="${build.classes.dir}/tmp/WEB-INF" casesensitive="true">-->
<!--</fileset>-->
</jar>
<echo message="created war file ${war.file}" level="verbose"/>
<delete dir="${build.classes.dir}/tmp/WEB-INF" failonerror="false"/>
<echo message="my webclient war classes are:${webclient.war.classes}"
level="verbose"/>
</target>
<target name="deploy-app">
<antcall target="deploy-war-common">
<param name="contextroot" value="${appname}"/>
</antcall>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-war-common"/>
</target>
<target name="runtest" depends="init-common">
<mkdir dir="${build.classes.dir}/client"/>
<javac srcdir="." destdir="${build.classes.dir}/client"
classpath="${env.APS_HOME}/lib/reporter.jar"
includes="client/**"/>
<unjar src="${env.APS_HOME}/lib/reporter.jar" dest="${build.classes.dir}/client"/>
<java classname="client.TestClient">
<classpath>
<pathelement path="${build.classes.dir}/client"/>
</classpath>
<arg value="http://${http.host}:${http.port}/webserviceref-cobundle/RequestProcessor"/>
</java>
</target>
</project>