| <?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-multimapping" default="usage" basedir="."> | |
| &commonSetup; | |
| &commonBuild; | |
| &testproperties; | |
| &commonSecurity; | |
| <target name="all" depends="clean, setup, build, deploy, run, undeploy, unsetup"/> | |
| <target name="clean" depends="init-common"> | |
| <antcall target="clean-common"/> | |
| </target> | |
| <target name="setup" depends="init-common"> | |
| <antcall target="create-user-common"> | |
| <param name="user" value="webuser"/> | |
| <param name="password" value="ww"/> | |
| <param name="groups" value="webusers"/> | |
| </antcall> | |
| <antcall target="create-user-common"> | |
| <param name="user" value="bobby"/> | |
| <param name="password" value="bb"/> | |
| <param name="groups" value="dummygroup"/> | |
| </antcall> | |
| <!-- <antcall target="reconfig-common"/>--> | |
| </target> | |
| <target name="unsetup" depends="init-common"> | |
| <antcall target="delete-user-common"> | |
| <param name="user" value="webuser"/> | |
| </antcall> | |
| <antcall target="delete-user-common"> | |
| <param name="user" value="bobby"/> | |
| </antcall> | |
| </target> | |
| <target name="compile" depends="clean"> | |
| <antcall target="compile-common"> | |
| <param name="src" value="ejb"/> | |
| <param name="build.classes.dir" value="${build.classes.dir}/nonweb"/> | |
| </antcall> | |
| <antcall target="compile-common"> | |
| <param name="src" value="web"/> | |
| <param name="build.classes.dir" value="${build.classes.dir}/web"/> | |
| <!-- overriding classpath to include classes from ejb module--> | |
| <param name="s1astest.classpath" | |
| value="${s1astest.classpath}:${build.classes.dir}/nonweb"/> | |
| </antcall> | |
| <!-- Am leaving in the commented appclient fragments to add | |
| an appclient test later. --> | |
| <!-- | |
| <antcall target="compile-common"> | |
| <param name="src" value="client"/> | |
| <param name="build.classes.dir" value="${build.classes.dir}/nonweb"/> | |
| </antcall> | |
| --> | |
| </target> | |
| <target name="build" depends="compile"> | |
| <mkdir dir="${assemble.dir}"/> | |
| <mkdir dir="${build.classes.dir}/META-INF"/> | |
| <antcall target="package-ejbjar-common"> | |
| <param name="ejbjar.files" value="${build.classes.dir}/nonweb"/> | |
| <param name="ejb.jar" value="${assemble.dir}/${appname}-ejb.jar"/> | |
| <param name="ejbjar.classes" value="com/sun/**/ejb/*.class"/> | |
| <param name="sun-ejb-jar.xml" value="${sun-ejb-jar.xml}"/> | |
| </antcall> | |
| <antcall target="package-war-common"> | |
| <param name="war.classes" value="${build.classes.dir}/web"/> | |
| <param name="war.file" value="${assemble.dir}/${appname}-web.war"/> | |
| <param name="sun-web.xml" value="descriptor/sun-web.xml"/> | |
| </antcall> | |
| <!-- | |
| <antcall target="package-appclientjar-common"> | |
| <param name="appclientjar.files" value="${build.classes.dir}/nonweb"/> | |
| <param name="appclient.jar" | |
| value="${assemble.dir}/${appname}-client.jar"/> | |
| <param name="appclientjar.classes" | |
| value="com/sun/**/client/*.class,com/sun/**/ejb/Hello.class"/> | |
| </antcall> | |
| --> | |
| <copy file="${application.xml}" tofile="${build.classes.dir}/META-INF/application.xml" failonerror="false"/> | |
| <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/application.xml"/> | |
| <include name="META-INF/sun-application.xml"/> | |
| </fileset> | |
| <fileset dir="${env.APS_HOME}/lib" includes="reporter.jar"/> | |
| </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="deploy" depends="init-common"> | |
| <antcall target="deploy-common"/> | |
| </target> | |
| <target name="run" depends="init-common"> | |
| <!-- | |
| <exec executable="${APPCLIENT}"> | |
| <arg line="-client" /> | |
| <arg line="${assemble.dir}/${appname}AppClient.jar"/> | |
| <arg line="-textauth"/> | |
| <arg line="-user"/> | |
| <arg line="javaee"/> | |
| <arg line="-password"/> | |
| <arg line="javaee"/> | |
| <arg line="${http.host} ${http.port}"/> | |
| </exec> | |
| --> | |
| <antcall target="runweb"> | |
| <param name="servlet" value="web"/> | |
| <param name="webuser" value="webuser"/> | |
| <param name="webpassword" value="ww"/> | |
| <param name="httpMethod" value="GET"/> | |
| <param name="goldenfile" value="goldenfiles/web.html"/> | |
| <param name="testcaseid" value="user-auth-webrole"/> | |
| </antcall> | |
| <antcall target="runweb"> | |
| <param name="servlet" value="ejb"/> | |
| <param name="webuser" value="bobby"/> | |
| <param name="webpassword" value="bb"/> | |
| <param name="httpMethod" value="GET"/> | |
| <param name="goldenfile" value="goldenfiles/ejb.html"/> | |
| <param name="testcaseid" value="user-auth-ejbrole"/> | |
| </antcall> | |
| </target> | |
| <target name="runweb" depends="init-common"> | |
| <taskdef name="webtest" classname="${webtest.classname}" | |
| classpath="${webtest.classpath}" /> | |
| <webtest request="${httpMethod} /security-multimapping/${servlet} HTTP/1.0" | |
| debug="9" | |
| host="${http.host}" | |
| port="${http.port}" | |
| authMethod="BASIC" | |
| userName="${webuser}" | |
| password="${webpassword}" | |
| firstTask="true" | |
| lastTest="true" | |
| lastCase="true" | |
| lastTask="true" | |
| resultFileName="${webtest.report.dir}/security-gtest-results.xml" | |
| testSession="security-multimapping" | |
| requestHeaders="Host:${http.host}:${http.port}" | |
| goldenFile="${env.APS_HOME}/devtests/security/simpleMultiRoleMapping/${goldenfile}" | |
| testSuiteId="security-multimapping" | |
| testSuiteName="security-multimapping" | |
| testSuiteDescription="Security Test" | |
| testId="security-multimapping" | |
| testName="security-multimapping" | |
| testDescription="Testing role mapping: ${testcaseid}" | |
| testCaseId="${testcaseid}" | |
| testCaseName="${testcaseid}" | |
| testCaseDescription="Testing role mapping" | |
| testStrategy="Testing role mapping"/> | |
| </target> | |
| <target name="undeploy" depends="init-common"> | |
| <antcall target="undeploy-common"/> | |
| </target> | |
| <target name="usage"> | |
| <antcall target="usage-common"/> | |
| </target> | |
| </project> |