blob: ed1f38e4df8d94d2ac420dc016fe2f4535b56548 [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 commonRun SYSTEM "file:./../../../../config/run.xml">
<!ENTITY commonSecurity SYSTEM "file:../../common.xml">
<!ENTITY testproperties SYSTEM "file:./build.properties">
]>
<project name="security-jmac-httpservlet" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&commonRun;
&testproperties;
&commonSecurity;
<target name="all" depends="clean, build, setup, deploy, run, undeploy, unsetup"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
<target name="setup" depends="init-common">
<!-- create auth realms -->
<antcall target="create-auth-filerealm">
<param name="file.realm.name" value="file123"/>
<param name="keyfile.path" value="${admin.domain.dir}/${admin.domain}/config/keyfile123"/>
</antcall>
<antcall target="create-user-common">
<param name="user" value="shingwai123"/>
<param name="password" value="me123"/>
<param name="groups" value="mygroup"/>
<param name="authrealmname" value="file123"/>
</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.httpservlet.HttpServletTestAuthModule --layer HttpServlet --providertype server --requestauthsource sender"/>
<param name="operand.props" value="httpServletTestAuthModule"/>
</antcall>
<!--antcall target="restart"/-->
</target>
<target name="unsetup" depends="init-common">
<antcall target="delete-user-common">
<param name="user" value="shingwai123"/>
<param name="authrealmname" value="file123"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="delete-message-security-provider"/>
<param name="as.props" value="${as.props} --layer HttpServlet"/>
<param name="operand.props" value="httpServletTestAuthModule"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="delete-auth-realm" />
<param name="operand.props" value="file123"/>
</antcall>
<!-- <antcall target="reconfig-common"/>-->
<!--antcall target="restart"/-->
<!-- 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="build" depends="init-common">
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
</antcall>
<antcall target="compile-common">
<param name="src" value="src"/>
</antcall>
<mkdir dir="${assemble.dir}"/>
<jar jarfile="${assemble.dir}/test-${appname}-provider.jar">
<fileset dir="${build.classes.dir}"/>
</jar>
</target>
<target name="deploy" depends="init-common">
<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="contextroot" value="${appname}"/>
</antcall>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-war-common"/>
</target>
<target name="run" depends="init-common">
<taskdef name="webtest" classname="${webtest.classname}" classpath="${webtest.classpath}" />
<webtest request="GET /security-jmac-httpservlet/index.jsp HTTP/1.0"
debug="9"
host="${http.host}"
port="${http.port}"
authMethod="BASIC"
userName="shingwai123"
password="me123"
firstTask="true"
lastTest="true"
lastCase="true"
lastTask="true"
resultFileName="${webtest.report.dir}/security-gtest-results.xml"
testSession="security-jmac-httpservlet"
requestHeaders="Host:${http.host}:${http.port}"
goldenFile="${env.APS_HOME}/devtests/security/jmac/httpServlet/goldenfiles/output.html"
testSuiteId="security-jmac-httpservlet"
testSuiteName="security-jmac-httpservlet"
testSuiteDescription="Security Test"
testId="security-jmac-httpservlet"
testName="security-jmac-httpservlet"
testDescription="JSR 196 HttpServlet test: ${testcaseid}"
testCaseId="${testcaseid}"
testCaseName="${testcaseid}"
testCaseDescription="JSR 196 HttpServlet test"
testStrategy="JSR 196 HttpServlet test"
/>
</target>
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
</project>