blob: e457efdc0ba435ec98e3d20d2b10d0ac1839872a [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 1997, 2022 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 "./../../../../../config/report.xml">
<!ENTITY eeCommon SYSTEM "file:./../../ee.xml">
<!ENTITY testproperties SYSTEM "file:./build.properties">
]>
<project name="tx-ee-dblogs-mdb" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&commonRun;
&eeCommon;
&testproperties;
&reporting;
<target name="all" depends="clean-results,all-embedded,all-local,dev-report"/>
<target name="test" depends="build,test-embedded,test-local"/>
<target name="all-embedded" depends="init-common">
<antcall target="build"/>
<antcall target="setup"/>
<antcall target="test-embedded"/>
<antcall target="unsetup"/>
</target>
<target name="all-local" depends="init-common">
<antcall target="build"/>
<antcall target="setup"/>
<antcall target="test-local"/>
<antcall target="unsetup"/>
</target>
<target name="test-embedded" depends="init-common">
<!-- setup try no mdbs first not to start ORB on the cluster -->
<antcall target="setup-test"/>
<antcall target="setup-embedded"/>
<antcall target="no-mdb"/>
<!-- now run the actual test -->
<antcall target="test-preset-embedded"/>
</target>
<target name="test-preset-embedded" depends="init-common">
<antcall target="build"/>
<antcall target="test-autorecovery"/>
<antcall target="save-logs"/>
<copy file="${module}-logs.zip" tofile="${module}-embedded1-logs.zip"/>
<antcall target="restart-cluster"/>
<antcall target="test-autorecovery"/>
<antcall target="unsetup-test"/>
<copy file="${module}-logs.zip" tofile="${module}-embedded2-logs.zip"/>
</target>
<target name="test-local" depends="init-common">
<antcall target="setup-test"/>
<antcall target="setup-local"/>
<!-- NEED TO CHANGE THE SETUP
<antcall target="test-autorecovery"/>
-->
<antcall target="test-delegated"/>
<antcall target="save-logs"/>
<copy file="${module}-logs.zip" tofile="${module}-local-local1-logs.zip"/>
<antcall target="restart-cluster"/>
<antcall target="test-recover-with-restart"/>
<antcall target="save-logs"/>
<copy file="${module}-logs.zip" tofile="${module}-local-local2-logs.zip"/>
<antcall target="restart-cluster"/>
<antcall target="test-delegated"/>
<antcall target="unsetup-test"/>
</target>
<target name="no-mdb" depends="init-common">
<antcall target="build-no-mdb"/>
<antcall target="deploy"/>
<antcall target="insert-db-only"/>
<antcall target="undeploy"/>
<antcall target="reset-tables"/>
</target>
<target name="test-autorecovery" depends="init-common">
<antcall target="deploy"/>
<antcall target="run-autorecovery"/>
<antcall target="undeploy"/>
<antcall target="reset-tables"/>
</target>
<target name="test-delegated" depends="init-common">
<antcall target="deploy"/>
<antcall target="run-delegated"/>
<antcall target="undeploy"/>
<antcall target="reset-tables"/>
</target>
<target name="test-recover-with-restart" depends="init-common">
<antcall target="deploy"/>
<antcall target="run-recover-with-restart"/>
<antcall target="undeploy"/>
<antcall target="reset-tables"/>
</target>
<target name="setup-local" depends="init-common">
<antcall target="setup-cluster">
<param name="type" value="LOCAL"/>
<param name="delegated" value="true"/>
</antcall>
</target>
<target name="setup-embedded" depends="init-common">
<antcall target="setup-cluster">
<param name="type" value="EMBEDDED"/>
<param name="delegated" value="false"/>
</antcall>
</target>
<target name="setup" depends="init-common">
<antcall target="start-derby"/>
<ant target="start-domain"/>
</target>
<target name="setup-test" depends="init-common">
<antcall target="setup-database"/>
</target>
<target name="setup-database" depends="init-common">
<antcall target="setup-xa-database-common">
<param name="pool.name" value="jdbc-xa-pool"/>
<param name="resource.name" value="jdbc/xa"/>
</antcall>
<antcall target="execute-ejb-sql-common">
<param name="sql.file" value="sql/create.sql"/>
</antcall>
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/create.sql"/>
<param name="db.url" value="jdbc:derby://localhost:${db.port}/${db.name};create=true;"/>
</antcall>
<antcall target="deploy-jdbc-common">
<param name="jdbc.conpool.name" value="nontx"/>
<param name="db.class" value="org.apache.derby.jdbc.ClientDataSource"/>
<param name="jdbc.resource.type" value="javax.sql.DataSource"/>
<param name="jdbc.resource.name" value="jdbc/nontx"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="set"/>
<param name="operand.props"
value="${resources.dottedname.prefix}.jdbc-connection-pool.nontx.property.connectionAttributes=;create=true"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="set"/>
<param name="operand.props"
value="${resources.dottedname.prefix}.jdbc-connection-pool.nontx.non-transactional-connections=true"/>
</antcall>
<antcall target="setup-pool-common">
<param name="pool.name" value="nontx"/>
</antcall>
</target>
<target name="setup-cluster" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="set"/>
<param name="operand.props" value="default-config.jms-service.type=${type}"/>
</antcall>
<echo message="Starting cluster"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}:${env.APS_HOME}/lib/reporter.jar"
classname="${se.client}">
<arg line="prepare"/>
<arg line="${delegated}"/>
<sysproperty key="enableShoalLogger" value="${enableShoalLogger}"/>
</java>
</target>
<target name="deploy" depends="init-common">
<echo message="deploying application"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}:${env.APS_HOME}/lib/reporter.jar"
classname="${se.client}">
<arg line="deploy"/>
<arg line="${assemble.dir}/${appname}-web.war"/>
</java>
</target>
<target name="unsetup-test" depends="init-common">
<antcall target="save-logs"/>
<antcall target="unsetup-cluster"/>
<antcall target="asadmin-common">
<param name="admin.command" value="set"/>
<param name="operand.props" value="default-config.jms-service.type=EMBEDDED"/>
</antcall>
<antcall target="unsetup-database"/>
</target>
<target name="unsetup" depends="init-common">
<antcall target="stop-derby"/>
<ant target="stop-domain"/>
</target>
<target name="unsetup-database" depends="init-common">
<antcall target="execute-ejb-sql-common">
<param name="sql.file" value="sql/drop.sql"/>
</antcall>
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/drop.sql"/>
<param name="db.url" value="jdbc:derby://localhost:${db.port}/${db.name};create=true;"/>
</antcall>
<antcall target="delete-jdbc-resource-common">
<param name="jdbc.resource.name" value="jdbc/xa"/>
</antcall>
<antcall target="delete-jdbc-connpool-common">
<param name="jdbc.conpool.name" value="jdbc-xa-pool"/>
</antcall>
<antcall target="delete-jdbc-resource-common">
<param name="jdbc.resource.name" value="jdbc/nontx"/>
</antcall>
<antcall target="delete-jdbc-connpool-common">
<param name="jdbc.conpool.name" value="nontx"/>
</antcall>
</target>
<target name="undeploy" depends="init-common">
<echo message="undeploying application"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}"
classname="${se.client}">
<arg line="undeploy"/>
<arg line="${appname}-web"/>
</java>
</target>
<target name="build-no-mdb" depends="compile-war">
<delete>
<fileset dir="${build.classes.dir}" includes="**/Md*.class"/>
</delete>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="false"/>
</antcall>
<antcall target="compile-client"/>
</target>
<target name="run-autorecovery" depends="init-common">
<parallel>
<antcall target="insert-data"/>
<antcall target="kill-instance"/>
</parallel>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="start-local-instance"/>
<arg line="in1"/>
</exec>
<!-- wait a little -->
<sleep seconds="35"/>
<antcall target="verify-results"/>
</target>
<target name="run-delegated" depends="init-common">
<parallel>
<antcall target="insert-data"/>
<antcall target="kill-instance"/>
</parallel>
<!-- wait a little -->
<sleep seconds="75"/>
<antcall target="verify-results"/>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="start-local-instance"/>
<arg line="in1"/>
</exec>
</target>
<target name="run-recover-with-restart" depends="init-common">
<parallel>
<antcall target="insert-data"/>
<antcall target="kill-instance"/>
</parallel>
<echo message="Restart in1 during recovery"/>
<!-- Let GMS start the work -->
<sleep seconds="50"/>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="start-local-instance"/>
<arg line="in1"/>
</exec>
<!-- Wait for messages to be delivered and stored -->
<sleep seconds="20"/>
<antcall target="verify-results"/>
</target>
<target name="verify-results">
<echo message="Verifying results"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}"
classname="${se.client}">
<arg line="verify_xa"/>
<arg line="${appname}-web"/>
<arg line="in2"/>
<arg line="recover"/>
</java>
</target>
<target name="insert-db-only" depends="init-common">
<echo message="Executing test on in1"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}"
classname="${se.client}">
<arg line="insert_xa_data"/>
<arg line="${appname}-web"/>
<arg line="in1"/>
<arg line="false"/>
</java>
</target>
<target name="kill-instance">
<sleep seconds="30"/>
<exec executable="./kill_instance.sh" failonerror="true">
<arg line="in1"/>
</exec>
</target>
<target name="insert-data">
<echo message="Executing test on in1"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/reportbuilder.jar:${build.classes.dir}"
classname="${se.client}">
<arg line="insert_xa_data"/>
<arg line="${appname}-web"/>
<arg line="in1"/>
<arg line="true"/>
</java>
</target>
<target name="restart-cluster" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="stop-cluster"/>
<param name="operand.props" value="c1"/>
</antcall>
<sleep seconds="10"/>
<antcall target="asadmin-common">
<param name="admin.command" value="start-cluster"/>
<param name="operand.props" value="c1"/>
</antcall>
</target>
</project>