| <!-- |
| |
| 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 |
| |
| --> |
| |
| <target name="clean-results" depends="init-common"> |
| <delete> |
| <fileset dir="${env.APS_HOME}" includes="test_results*"/> |
| </delete> |
| <delete> |
| <fileset dir="." includes="*.output"/> |
| </delete> |
| </target> |
| |
| <target name="start-derby" depends="init-common"> |
| <echo message="Starting database"/> |
| <echo message="${ASADMIN}"/> |
| <!-- spawn is added to prevent a hang on Windows --> |
| <exec spawn="true" executable="${ASADMIN}" failonerror="false"> |
| <arg line="start-database"/> |
| <arg line="--dbhome"/> |
| <arg line="${env.S1AS_HOME}/databases"/> |
| <arg line="--dbport"/> |
| <arg line="${db.port}"/> |
| <arg line="--jvmoptions"/> |
| <arg line="'-Djava.security.manager -Djava.security.policy=${env.APS_HOME}/devtests/transaction/ee/ee-test.policy'"/> |
| </exec> |
| </target> |
| |
| <target name="stop-derby" depends="init-common"> |
| <echo message="Stopping database"/> |
| <exec executable="${ASADMIN}" failonerror="false"> |
| <arg line="stop-database"/> |
| <arg line="--dbport"/> |
| <arg line="${db.port}"/> |
| </exec> |
| </target> |
| |
| <target name="start-domain" depends="init-common"> |
| <echo message="Starting DAS"/> |
| <antcall target="startDomain"/> |
| </target> |
| |
| <target name="stop-domain" depends="init-common"> |
| <echo message="Stopping DAS"/> |
| <antcall target="stopDomain"/> |
| </target> |
| |
| <target name="setup-xa-database-common" depends="init-common"> |
| <antcall target="deploy-jdbc-common"> |
| <param name="jdbc.conpool.name" value="${pool.name}"/> |
| <param name="db.class" value="org.apache.derby.jdbc.ClientXADataSource"/> |
| <param name="jdbc.resource.type" value="javax.sql.XADataSource"/> |
| <param name="jdbc.resource.name" value="${resource.name}"/> |
| </antcall> |
| <antcall target="asadmin-common"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${pool.name}.property.connectionAttributes=;create=true"/> |
| </antcall> |
| <antcall target="setup-pool-common"> |
| <param name="pool.name" value="${pool.name}"/> |
| </antcall> |
| <antcall target="setup-pool-common"> |
| <param name="pool.name" value="DerbyPool"/> |
| </antcall> |
| </target> |
| |
| <target name="setup-pool-common" depends="init-common"> |
| <antcall target="asadmin-common"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${pool.name}.connection-validation-method=table"/> |
| </antcall> |
| <antcall target="asadmin-common"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${pool.name}.validation-table-name=sys.systables"/> |
| </antcall> |
| <antcall target="asadmin-common"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${pool.name}.is-connection-validation-required=true"/> |
| </antcall> |
| </target> |
| |
| <target name="save-logs" depends="init-common" > |
| <condition property="zip-logs"> |
| <isset property="${save.logs}" /> |
| </condition> |
| |
| <echo message="saving logs to ${basedir}"/> |
| <zip destfile="${module}-logs.zip" |
| basedir="${env.S1AS_HOME}" |
| includes="**/server.log, **/server.log_*" |
| /> |
| |
| </target> |
| |
| <target name="unsetup-cluster" depends="init-common"> |
| <echo message="Stopping cluster"/> |
| <java fork="on" |
| failonerror="true" |
| classpath="${env.S1AS_HOME}/lib/javaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}" |
| classname="${se.client}"> |
| <arg line="clean"/> |
| <arg line="${appname}-web"/> |
| </java> |
| </target> |
| |
| <target name="build" depends="compile-war"> |
| <antcall target="webclient-war-common"> |
| <param name="hasWebclient" value="false"/> |
| </antcall> |
| <antcall target="compile-client"/> |
| </target> |
| |
| <target name="compile-war" depends="clean"> |
| <antcall target="compile-common"> |
| <param name="src" value="war"/> |
| </antcall> |
| </target> |
| |
| <target name="compile-client" > |
| <javac fork="true" includeAntRuntime="false" destdir="${build.classes.dir}" debug="true" |
| classpath="${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}" |
| srcdir="${env.APS_HOME}/devtests/admin/cli/src" includes="**/*BaseDevTest.java"> |
| </javac> |
| <javac fork="true" includeAntRuntime="false" destdir="${build.classes.dir}" debug="true" |
| classpath="${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}" |
| srcdir="${env.APS_HOME}/devtests/transaction/ee/common" includes="**/*.java"> |
| </javac> |
| <javac fork="true" includeAntRuntime="false" |
| classpath="${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}:${env.APS_HOME}/lib/reporter.jar" |
| destdir="${build.classes.dir}" debug="true" srcdir="client" includes="**/*.java"> |
| <classpath path="${classpath}"/> |
| </javac> |
| </target> |
| |
| <target name="clean" depends="init-common"> |
| <antcall target="clean-common"/> |
| </target> |
| |
| <target name="usage"> |
| <echo> |
| Usage: |
| ant all (Executes all transaction ee tests in this suite) |
| </echo> |
| </target> |
| |
| |
| <target name="reset-tables" depends="init-common"> |
| <antcall target="execute-ejb-sql-common"> |
| <param name="sql.file" value="sql/delete.sql"/> |
| </antcall> |
| <antcall target="execute-sql-common"> |
| <param name="sql.file" value="sql/delete.sql"/> |
| <param name="db.url" value="jdbc:derby://localhost:${db.port}/${db.name};create=true;"/> |
| </antcall> |
| </target> |