blob: 70937679c24f49e166ccdf49231244a7f8d3ada5 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE project [
<!--
Copyright (c) 2017, 2020 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 testproperties SYSTEM "./build.properties">
<!ENTITY common SYSTEM "../../../config/common.xml">
<!ENTITY testcommon SYSTEM "../../../config/properties.xml">
<!ENTITY database SYSTEM "../config/database.xml">
]>
<project name="mix" default="usage" basedir=".">
&database;
&testproperties;
<!--
&eeSetup;
&eeProperties;
-->
&common;
&testcommon;
<target name="all" depends="build,deploy,run,undeploy"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
</antcall>
<antcall target="compile-common">
<param name="src" value="client"/>
</antcall>
<ant dir="ra" target="compile"/>
</target>
<target name="build" depends="compile">
<antcall target="build-ear-common">
<param name="ejbjar.classes"
value="**/*.class" />
<param name="appclientjar.classes"
value="**/*.class" />
</antcall>
<antcall target="build-ra"/>
<ant dir="ra" target="assemble"/>
</target>
<target name="deploy" depends="init-common">
<antcall target="create-ra-config"/>
<antcall target="deploy-rar-common">
<param name="rarfile" value="ra/publish/lib/jdbc-ra-xa.rar"/>
</antcall>
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="jdbc-ra-xa"/>
<param name="connection.defname" value="javax.sql.XADataSource"/>
<param name="extra-params" value="--matchconnections=false"/>
<param name="connector.conpool.name" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="set-oracle-props">
<param name="pool.type" value="connector"/>
<param name="conpool.name" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="jdbc-ra-xa"/>
<param name="connection.defname" value="javax.sql.XADataSource"/>
<param name="extra-params" value="--matchconnections=false"/>
<param name="connector.conpool.name" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="set-oracle-props">
<param name="pool.type" value="connector"/>
<param name="conpool.name" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-1"/>
<param name="connector.jndi.name" value="test-res-1"/>
</antcall>
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-2"/>
<param name="connector.jndi.name" value="test-res-2"/>
</antcall>
<antcall target="deploy-common"/>
</target>
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
<param name="operand.props" value="jdbc-ra-xa"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="delete-resource-adapter-config"/>
<param name="operand.props" value="jdbc-ra-xa"/>
</antcall>
<!--<antcall target="reconfig-common"/>-->
</target>
<target name="run" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/create_pointbase.sql"/>
</antcall>
<antcall target="run-test-1"/>
<antcall target="run-test-3"/>
<antcall target="run-test-2"/>
</target>
<target name="undeploy" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/drop_pointbase.sql"/>
</antcall>
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="test-res-1"/>
</antcall>
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="test-res-2"/>
</antcall>
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="undeploy-common"/>
<antcall target="undeploy-rar-common"/>
<antcall target="delete-ra-config"/>
</target>
<target name="build-ra">
<ant dir="ra" target="build"/>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
<target name="run-test-1" depends="init-common">
<antcall target="set-pool-tx-support">
<param name="tx-support" value="XATransaction"/>
<param name="poolName" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="set-pool-tx-support">
<param name="tx-support" value="XATransaction"/>
<param name="poolName" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="1"/>
</antcall>
</target>
<target name="run-test-2" depends="init-common">
<antcall target="set-pool-tx-support">
<param name="tx-support" value="LocalTransaction"/>
<param name="poolName" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="set-pool-tx-support">
<param name="tx-support" value="LocalTransaction"/>
<param name="poolName" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="set-pool-tx-support">
<param name="tx-support" value="LocalTransaction"/>
<param name="poolName" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="2"/>
</antcall>
</target>
<target name="run-test-3" depends="init-common">
<antcall target="set-pool-tx-support">
<param name="tx-support" value="LocalTransaction"/>
<param name="poolName" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="set-pool-tx-support">
<param name="tx-support" value="XATransaction"/>
<param name="poolName" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="1"/>
</antcall>
</target>
<target name="set-pool-tx-support">
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="set" />
<param name="operand.props"
value="${resources.dottedname.prefix}.connector-connection-pool.${poolName}.transaction-support=${tx-support}" />
</antcall>
</target>
<!-- With JMSRA and JDBCRA -->
<target name="deploy-for-jms" depends="init-common">
<antcall target="deploy-rar-common"/>
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="jdbc-ra-xa"/>
<param name="connection.defname" value="javax.sql.XADataSource"/>
<param name="extra-params" value="--matchconnections=false"/>
<param name="connector.conpool.name" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-3"/>
<param name="connector.jndi.name" value="test-res-3"/>
</antcall>
<!--
<antcall target="deploy-jms-common">
<param name="jms.factory.name" value="jms/jms-jdbc-res-1"/>
</antcall>
-->
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="jmsra"/>
<param name="connection.defname" value="jakarta.jms.QueueConnectionFactory"/>
<param name="extra-params" value="--matchconnections=false"/>
<param name="connector.conpool.name" value="jms-jdbc-res-1"/>
<param name="operand.props" value="--transactionsupport LocalTransaction"/>
</antcall>
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="jms-jdbc-res-1"/>
<param name="connector.jndi.name" value="jms/jms-jdbc-res-1"/>
</antcall>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="create-admin-object"/>
<arg line="--target ${appserver.instance.name}"/>
<arg line="--restype jakarta.jms.Queue"/>
<arg line="--raname jmsra"/>
<arg line="${as.props}"/>
<arg line="--property maxNumActiveConsumers=${activeconsumer.maxnum}"/>
<arg line="jms/SampleQueue"/>
</exec>
<antcall target="deploy-common"/>
</target>
<target name="run-for-jms" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/create_pointbase.sql"/>
</antcall>
<!-- JMS=xa, JDBC=non-xa -->
<antcall target="run-test-1-for-jms"/>
<!-- JMS=non-xa, JDBC=xa -->
<antcall target="run-test-2-for-jms"/>
<!-- negative test : JMS=JDBC=non-xa -->
<antcall target="run-test-3-for-jms"/>
</target>
<target name="undeploy-for-jms" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/drop_pointbase.sql"/>
</antcall>
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="test-res-3"/>
</antcall>
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jms/jms-jdbc-res-1"/>
</antcall>
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="jms-jdbc-res-1"/>
</antcall>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="delete-admin-object"/>
<arg line="--target ${appserver.instance.name}"/>
<arg line="${as.props}"/>
<arg line="jms/SampleQueue"/>
</exec>
<antcall target="undeploy-common"/>
<antcall target="undeploy-rar-common"/>
</target>
<target name="run-test-1-for-jms" depends="init-common">
<!--
<antcall target="set-pool-tx-support">
<param name="tx-support" value="LocalTransaction"/>
<param name="poolName" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="set-pool-tx-support">
<param name="tx-support" value="XATransaction"/>
<param name="poolName" value="jms-jdbc-res-1"/>
</antcall>
-->
<antcall target="runclient-common">
<param name="appclient.application.args" value="jms-jdbc-1"/>
</antcall>
</target>
<target name="run-test-2-for-jms" depends="init-common">
<antcall target="set-pool-tx-support">
<param name="tx-support" value="XATransaction"/>
<param name="poolName" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="set-pool-tx-support">
<param name="tx-support" value="LocalTransaction"/>
<param name="poolName" value="jms-jdbc-res-1"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="jms-jdbc-2"/>
</antcall>
</target>
<target name="run-test-3-for-jms" depends="init-common">
<antcall target="set-pool-tx-support">
<param name="tx-support" value="LocalTransaction"/>
<param name="poolName" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="set-pool-tx-support">
<param name="tx-support" value="LocalTransaction"/>
<param name="poolName" value="jms-jdbc-res-1"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="jms-jdbc-3"/>
</antcall>
</target>
<target name="create-sql">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/create_pointbase.sql"/>
</antcall>
</target>
<target name="drop-sql">
</target>
</project>