blob: 0cfb0a0dac35e01a3290a6c46a447aaf258170d0 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2010, 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 commonRun SYSTEM "./../../config/run.xml">
<!ENTITY reporting SYSTEM "./report.xml">
]>
<project name="cdi" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&commonRun;
&reporting;
<property name="cdi-target" value="all" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${env.APS_HOME}/devtests/cdi/lib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<target name="usage">
<echo> Usage:
ant cdi (Executes the cdi tests)
ant all (Executes all the cdi tests)
ant clean (cleans all the cdi tests)
ant build (builds all the cdi tests)
ant setup (sets up all resources for cdi tests)
ant deploy (deploys all the cdi apps)
ant run (Executes all the cdi tests)
ant undeploy (undeploys all the cdi apps)
ant unsetup (unsets all resources for cdi tests)
</echo>
</target>
<target name="cdi" xmlns:if="ant:if" xmlns:unless="ant:unless">
<record name="cdi.output" action="start" />
<property environment="env" />
<echo message="@@## Running all CDI developer tests ##@@" />
<echo unless:set="env.cdi_all" message="@@## Set environment variable 'cdi_all' to name of single test dir to run only that one. ##@@${line.separator}" />
<echo if:set="env.cdi_all" message="@@## environment variable 'cdi_all' set. Running only ${env.cdi_all} ##@@${line.separator}" />
<run-cdi-test path="smoke-tests" />
<run-cdi-test path="qualifiers" />
<run-cdi-test path="events" />
<run-cdi-test path="injection-point" />
<run-cdi-test path="interceptors" />
<run-cdi-test path="javaee-component-resources" />
<run-cdi-test path="javaee-integration" />
<run-cdi-test path="managed-beans" />
<run-cdi-test path="portable-extensions" />
<run-cdi-test path="producer-methods" />
<run-cdi-test path="scopes" />
<run-cdi-test path="specialization" />
<run-cdi-test path="stereotypes" />
<run-cdi-test path="transactions" />
<run-cdi-test path="unproxyable-deps" />
<run-cdi-test path="unsatisfied-deps" />
<run-cdi-test path="implicit" />
<run-cdi-test path="decorators" />
<!--
Not running until https://issues.jboss.org/browse/CDI-331 is sorted out.
In 1.1.10.Final the test passes.
In 2.0 Beta it fails.
In 3.0 We never bothered to check anymore.
See email from Jozef 3/4/13
<ant dir="alternatives" target="${cdi-target}"/>
<ant dir="ambiguous-deps" target="${cdi-target}"/>
-->
<!--
Not running until https://issues.jboss.org/browse/CDI-331 is sorted out.
In 1.1.10.Final the test passes.
In 2.0 Beta it fails.
See email from Jozef 3/4/13
<ant dir="programmatic-lookup" target="${cdi-target}"/>
-->
<!--
Not running until figherfish is back (narrator: "it never came back")
<if>
<equals arg1="${test.embedded.mode}" arg2="true" />
<then>
<echo> Excluding testcase directory osgi-cdi for embedded mode</echo>
</then>
<else>
<ant dir="osgi-cdi" target="${cdi-target}"/>
</else>
</if>
-->
<echo message="***** DONE TESTING - GENERATING REPORT ******" />
<!-- now generate report -->
<antcall target="report" />
<record name="cdi.output" action="stop" />
</target>
<target name="pe-all">
<antcall target="backup-config-pe" />
<echo message="NOTE: The file ${env.APS_HOME}/config.properties is being replaced with ${basedir}/config/pe-config.properties. The file will be reverted to its original state after the completion of these tests." />
<copy file="${basedir}/config/pe-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true" />
<antcall target="create-pe-passwordfile" />
<antcall target="all" />
<antcall target="restore-config-pe" />
</target>
<target name="das-all">
<antcall target="backup-config-pe" />
<echo message="NOTE: The file ${env.APS_HOME}/config.properties is being replaced with ${basedir}/config/das-config.properties. The file will be reverted to its original state after the completion of these tests." />
<copy file="${basedir}/config/das-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true" />
<antcall target="create-ee-passwordfile" />
<antcall target="all" />
<antcall target="restore-config-pe" />
</target>
<target name="ee-all">
<antcall target="backup-config-pe" />
<antcall target="backup-config-ee" />
<echo message="NOTE: The file ${env.APS_HOME}/config.properties is being replaced with ${basedir}/config/das-config.properties. The file will be reverted to its original state after the completion of these tests." />
<copy file="${basedir}/config/ee-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true" />
<copy file="${basedir}/config/ee-config.properties" tofile="${env.APS_HOME}/eeconfig/ee-config.properties" overwrite="true" />
<antcall target="create-ee-passwordfile" />
<antcall target="ee" />
<antcall target="all" />
<antcall target="restore-config-pe" />
<antcall target="restore-config-ee" />
</target>
<target name="backup-config-pe" depends="replace-password-with-passwordfile">
<copy file="${env.APS_HOME}/config.properties" tofile="${env.APS_HOME}/config.properties.bak" overwrite="true" />
</target>
<target name="restore-config-pe" depends="undo-replace-password-with-passwordfile">
<copy file="${env.APS_HOME}/config.properties.bak" tofile="${env.APS_HOME}/config.properties" overwrite="true" />
</target>
<target name="backup-config-ee">
<copy file="${env.APS_HOME}/eeconfig/ee-config.properties" tofile="${env.APS_HOME}/eeconfig/ee-config.properties.bak" overwrite="true" />
</target>
<target name="restore-config-ee">
<copy file="${env.APS_HOME}/eeconfig/ee-config.properties.bak" tofile="${env.APS_HOME}/eeconfig/ee-config.properties" overwrite="true" />
</target>
<target name="create-pe-passwordfile">
<property file="${env.APS_HOME}/config.properties" />
<echo message="AS_ADMIN_PASSWORD=${admin.password}${line.separator}" file="${env.APS_HOME}/devtests/cdi/config/password.txt" />
</target>
<target name="create-ee-passwordfile">
<property file="${env.APS_HOME}/config.properties" />
<echo message="AS_ADMIN_PASSWORD=${admin.password}${line.separator}" file="${env.APS_HOME}/devtests/cdi/config/password.txt" />
<echo message="AS_ADMIN_MASTERPASSWORD=${master.password}${line.separator}" file="${env.APS_HOME}/devtests/cdi/config/password.txt" append="true" />
</target>
<target name="replace-password-with-passwordfile">
<replace dir="${env.APS_HOME}/config/">
<include name="**/*.xml" />
<replacetoken>--password ${admin.password}</replacetoken>
<replacevalue>--passwordfile ${env.APS_HOME}/devtests/cdi/config/password.txt</replacevalue>
</replace>
</target>
<target name="undo-replace-password-with-passwordfile">
<replace dir="${env.APS_HOME}/config/">
<include name="**/*.xml" />
<replacetoken>--passwordfile ${env.APS_HOME}/devtests/cdi/config/password.txt</replacetoken>
<replacevalue>--password ${admin.password}</replacevalue>
</replace>
</target>
<target name="run-test">
<antcall target="cdi">
<param name="cdi-target" value="run-test" />
</antcall>
</target>
<target name="all">
<antcall target="cdi">
<param name="cdi-target" value="all" />
</antcall>
</target>
<target name="clean">
<antcall target="cdi">
<param name="cdi-target" value="clean" />
</antcall>
</target>
<target name="build">
<antcall target="cdi">
<param name="cdi-target" value="build" />
</antcall>
</target>
<target name="setup">
<antcall target="cdi">
<param name="cdi-target" value="setup" />
</antcall>
</target>
<target name="deploy">
<antcall target="cdi">
<param name="cdi-target" value="deploy" />
</antcall>
</target>
<target name="undeploy">
<antcall target="cdi">
<param name="cdi-target" value="undeploy" />
</antcall>
</target>
<target name="unsetup">
<antcall target="cdi">
<param name="cdi-target" value="unsetup" />
</antcall>
</target>
<target name="run">
<antcall target="cdi">
<param name="cdi-target" value="run" />
</antcall>
</target>
<target name="report-local">
<exec executable="sh">
<arg value="./resultCount.sh" />
</exec>
</target>
<macrodef name="run-cdi-test" xmlns:if="ant:if" xmlns:unless="ant:unless">
<attribute name="path" />
<sequential>
<local name="do-run-test" />
<condition property="do-run-test" else="false">
<or>
<equals arg1="${env.cdi_all}" arg2="@{path}" />
<not>
<isset property="env.cdi_all" />
</not>
</or>
</condition>
<sequential if:true="${do-run-test}">
<local name="absolute.path" />
<property name="absolute.path" location="@{path}" />
<echo message="${line.separator}" />
<echo message=" *************************" />
<echo message=" * Running @{path} " />
<echo message=" * Path: ${absolute.path} " />
<echo message=" *************************" />
<echo message="${line.separator}" />
<ant dir="@{path}" target="${cdi-target}" />
</sequential>
</sequential>
</macrodef>
</project>