blob: bc912c7275f1fe6a07bba10b09dbaef332dbeffa [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 commonSetup SYSTEM "file:./../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "file:./../../../../config/common.xml">
<!ENTITY commonSecurity SYSTEM "file:../../common.xml">
<!ENTITY testproperties SYSTEM "file:./build.properties">
]>
<project name="security-jmac-soapembedded" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&testproperties;
&commonSecurity;
<target name="all" depends="clean, build-providers, setup, build-deploy, run, undeploy, unsetup"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
<target name="build-providers" depends="init-common">
<antcall target="compile-common">
<param name="src" value="authmodule"/>
<param name="build.classes.dir" value="${build.classes.dir}/authmodule"/>
</antcall>
<mkdir dir="${assemble.dir}"/>
<jar jarfile="${assemble.dir}/test-${appname}-provider.jar">
<fileset dir="${build.classes.dir}/authmodule"/>
</jar>
</target>
<target name="setup" depends="init-common">
<!-- exports certdb stuff and imports into keystore -->
<antcall target="prepare-store-nickname-common">
<param name="cert.nickname" value="s1as"/>
</antcall>
<copy file="${assemble.dir}/test-${appname}-provider.jar"
todir="${env.S1AS_HOME}/lib"/>
<antcall target="asadmin-common">
<param name="admin.command" value="create-message-security-provider"/>
<param name="as.props" value="${as.props} --classname com.sun.s1asdev.security.jmac.soapembedded.SOAPEmbeddedTestServerAuthModule --layer SOAP --providertype server --requestauthsource sender"/>
<param name="operand.props" value="SOAPEmbeddedTestServerAuthModule"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="create-message-security-provider"/>
<param name="as.props" value="${as.props} --classname com.sun.s1asdev.security.jmac.soapembedded.SOAPEmbeddedTestClientAuthModule --layer SOAP --providertype client --requestauthsource sender"/>
<param name="operand.props" value="SOAPEmbeddedTestClientAuthModule"/>
</antcall>
</target>
<target name="unsetup" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="delete-message-security-provider"/>
<param name="as.props" value="${as.props} --layer SOAP"/>
<param name="operand.props" value="SOAPEmbeddedTestServerAuthModule"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="delete-message-security-provider"/>
<param name="as.props" value="${as.props} --layer SOAP"/>
<param name="operand.props" value="SOAPEmbeddedTestClientAuthModule"/>
</antcall>
<!-- may not be able to delete this file in PC environment -->
<delete file="${env.S1AS_HOME}/lib/test-${appname}-provider.jar" failonerror="false"/>
</target>
<target name="compile-server" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejbws"/>
<param name="build.classes.dir" value="${build.classes.dir}/ejbws"/>
</antcall>
<antcall target="compile-common">
<param name="src" value="servletws"/>
<param name="build.classes.dir" value="${build.classes.dir}/servletws/WEB-INF/classes"/>
</antcall>
</target>
<target name="compile-webclient">
<mkdir dir="${build.classes.dir}/webclient"/>
<antcall target="wsimport">
<param name="wsimport.args"
value="-keep -d ${build.classes.dir}/webclient http://${http.host}:${http.port}/JmacSoapEmbeddedEjbService/HelloEjb?WSDL"/>
</antcall>
<antcall target="wsimport">
<param name="wsimport.args"
value="-keep -d ${build.classes.dir}/webclient http://${http.host}:${http.port}/security-jmac-soapembedded-web/webservice/JmacSoapEmbeddedServletService/HelloServlet?WSDL"/>
</antcall>
<delete file="webclient/Servlet.java" failonerror="false"/>
<copy file="webclient/Servlet.java.template" tofile="webclient/Servlet.java"/>
<replace file="webclient/Servlet.java">
<replacefilter token="@HOST@" value="${http.host}"/>
<replacefilter token="@PORT@" value="${http.port}"/>
</replace>
<javac srcdir="webclient" destdir="${build.classes.dir}/webclient"
classpath="${env.APS_HOME}/lib/reporter.jar:${env.S1AS_HOME}/lib/javaee.jar:${env.S1AS_HOME}/lib/webservices-rt.jar:${env.S1AS_HOME}/lib/webservices-tools.jar:${build.classes.dir}/webclient:${env.S1AS_HOME}/modules/jakarta.servlet.jar" debug="on" failonerror="true"/>
</target>
<target name="build-server" depends="compile-server">
<mkdir dir="${assemble.dir}"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<antcall target="package-ejbjar-common">
<param name="ejbjar.files" value="${build.classes.dir}/ejbws"/>
<param name="ejb.jar" value="${assemble.dir}/${appname}-ejb.jar"/>
<param name="ejbjar.classes" value="com/sun/**/*.class"/>
</antcall>
<copy file="${web.xml}" tofile="${build.classes.dir}/servletws/WEB-INF/web.xml" failonerror="true"/>
<copy file="${sun-web.xml}" tofile="${build.classes.dir}/servletws/WEB-INF/sun-web.xml" failonerror="true"/>
<jar destfile="${assemble.dir}/${appname}-web.war">
<fileset dir="${build.classes.dir}/servletws"/>
</jar>
<copy file="${sun-application.xml}" tofile="${build.classes.dir}/META-INF/sun-application.xml" failonerror="false"/>
<jar jarfile="${assemble.dir}/${appname}App.ear">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
</fileset>
<fileset dir="${build.classes.dir}">
<include name="META-INF/sun-application.xml"/>
</fileset>
</jar>
</target>
<target name="build-webclient" depends="compile-webclient">
<mkdir dir="${assemble.dir}"/>
<antcall target="package-war-common">
<param name="web.xml" value="${web2.xml}"/>
<param name="sun-web.xml" value="${sun-web2.xml}"/>
<param name="war.classes"
value="${build.classes.dir}/webclient"/>
<param name="war.file"
value="${assemble.dir}/${appname}-client-web.war"/>
</antcall>
</target>
<target name="build-deploy" depends="init-common">
<antcall target="build-server"/>
<antcall target="deploy-common-libraries">
<param name="as.props" value="${as.props}"/>
<param name="libraries" value="${env.S1AS_HOME}/lib/test-${appname}-provider.jar"/>
</antcall>
<antcall target="build-webclient"/>
<antcall target="deploy-war-libraries">
<param name="as.props" value="${as.props}"/>
<param name="libraries" value="${env.S1AS_HOME}/lib/test-${appname}-provider.jar"/>
<param name="appname" value="${appname}-client"/>
<param name="contextroot" value="${appname}-client-web"/>
</antcall>
</target>
<target name="run" depends="init-common">
<taskdef name="webtest" classname="${webtest.classname}" classpath="${webtest.classpath}" />
<webtest request="GET /security-jmac-soapembedded-client-web/webclient/Servlet HTTP/1.0"
debug="9"
host="${http.host}"
port="${http.port}"
firstTask="true"
lastTest="true"
lastCase="true"
lastTask="true"
resultFileName="${webtest.report.dir}/security-gtest-results.xml"
testSession="security-jmac-soapembedded"
requestHeaders="Host:${http.host}:${http.port}"
goldenFile="${env.APS_HOME}/devtests/security/jmac/soapEmbedded/goldenfiles/output.html"
testSuiteId="security-jmac-soapembedded"
testSuiteName="security-jmac-soapembedded"
testSuiteDescription="Security Test"
testId="security-jmac-soapembedded"
testName="security-jmac-soapembedded"
testDescription="JSR 196 SoapEmbedded test: ${testcaseid}"
testCaseId="${testcaseid}"
testCaseName="${testcaseid}"
testCaseDescription="JSR 196 SoapEmbedded test"
testStrategy="JSR 196 SoapEmbedded test"
/>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
<antcall target="undeploy-war-common">
<param name="appname"
value="${appname}-client"/>
</antcall>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
</project>