blob: be39aad0860443d193378f4a3d2420393a2554b0 [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-httpservletchallenge" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&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="shingwai"/>
<param name="password" value="shingwai"/>
<param name="groups" value="mygroup"/>
<param name="authrealmname" value="file123"/>
</antcall>
<antcall target="create-user-common">
<param name="user" value="shingwai_2"/>
<param name="password" value="adminadmin"/>
<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.httpservletchallenge.HttpServletChallengeTestAuthModule --layer HttpServlet --providertype server --requestauthsource sender"/>
<param name="operand.props" value="httpServletChallengeTestAuthModule"/>
</antcall>
</target>
<target name="unsetup" depends="init-common">
<antcall target="delete-user-common">
<param name="user" value="shingwai"/>
<param name="authrealmname" value="file123"/>
</antcall>
<antcall target="delete-user-common">
<param name="user" value="shingwai_2"/>
<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="httpServletChallengeTestAuthModule"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="delete-auth-realm" />
<param name="operand.props" value="file123"/>
</antcall>
<!-- <antcall target="reconfig-common"/>-->
<!-- 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-httpservletchallenge/index.jsp HTTP/1.0"
debug="9"
host="${http.host}"
port="${http.port}"
authMethod="BASIC"
userName="shingwai"
password="shingwai"
firstTask="true"
lastTest="true"
lastCase="true"
lastTask="true"
resultFileName="${webtest.report.dir}/security-gtest-results.xml"
testSession="security-jmac-httpservletchallenge"
requestHeaders="Host:${http.host}:${http.port}"
returnCode="HTTP/1.1 401"
testSuiteId="security-jmac-httpservletchallenge"
testSuiteName="security-jmac-httpservletchallenge"
testSuiteDescription="Security Test"
testId="security-jmac-httpservletchallenge"
testName="security-jmac-httpservletchallenge"
testDescription="JSR 196 HttpServlet test: ${testcaseid}"
testCaseId="${testcaseid}"
testCaseName="${testcaseid}"
testCaseDescription="JSR 196 HttpServlet test"
testStrategy="JSR 196 HttpServlet test"
/>
<webtest request="GET /security-jmac-httpservletchallenge/index.jsp HTTP/1.0"
debug="9"
host="${http.host}"
port="${http.port}"
authMethod="BASIC"
userName="shingwai"
password="adminadmin"
firstTask="true"
lastTest="true"
lastCase="true"
lastTask="true"
resultFileName="${webtest.report.dir}/security-gtest-results.xml"
testSession="security-jmac-httpservletchallenge"
requestHeaders="Host:${http.host}:${http.port}"
goldenFile="${env.APS_HOME}/devtests/security/jmac/httpServletChallenge/goldenfiles/output.html"
testSuiteId="security-jmac-httpservletchallenge"
testSuiteName="security-jmac-httpservletchallenge"
testSuiteDescription="Security Test"
testId="security-jmac-httpservletchallenge"
testName="security-jmac-httpservletchallenge"
testDescription="JSR 196 HttpServlet test: ${testcaseid}"
testCaseId="${testcaseid}"
testCaseName="${testcaseid}"
testCaseDescription="JSR 196 HttpServlet test"
testStrategy="JSR 196 HttpServlet test"
/>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
</project>