blob: 431257c3bc792fd485e659419315096d5bf99745 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
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
-->
<!DOCTYPE project [
<!ENTITY commonSetup SYSTEM "file:./../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "file:./../../../../config/common.xml">
<!ENTITY testproperties SYSTEM "file:./build.properties">
<!ENTITY run SYSTEM "file:./../../../../config/run.xml">
]>
<project name="loadbalancing" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&testproperties;
&run;
<target name="all" depends="cluster-setup,build,setup,deploy,run-appclient1,run-appclient2,run-appclient3,run-appclient4,undeploy,unsetup,cluster-unsetup"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
<target name="sql" depends="init-common">
<!--
Clean the database after the run since it prohibits re-running
-->
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/drop_derby.sql"/>
</antcall>
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/create_derby.sql"/>
</antcall>
</target>
<target name="run-appclient1" depends="init-common">
<echo message="running in ACC with S1ASCtxFactory..."/>
<antcall target="runclient-common">
<param name="appclient.application.args" value="-xml ./descriptor/sun-acc-lb.xml 129.145.133.64 33700"/>
</antcall>
<antcall target="sql"/>
</target>
<target name="run-appclient2" depends="init-common">
<echo message="running in ACC with S1ASCtxFactory..."/>
<antcall target="runclient-common">
<param name="appclient.application.args" value="-xml ./descriptor/sun-acc-lb1.xml 129.145.133.64 33700"/>
</antcall>
<antcall target="sql"/>
</target>
<target name="run-appclient3" depends="init-common">
<echo message="running in ACC with S1ASCtxFactory..."/>
<antcall target="runclient-common">
<param name="appclient.application.args" value="-xml ./descriptor/sun-acc-lb2.xml 129.145.133.64 33700"/>
</antcall>
<antcall target="sql"/>
</target>
<target name="run-appclient4" depends="init-common">
<echo message="running in ACC with S1ASCtxFactory..."/>
<antcall target="runclient-common">
<param name="appclient.application.args" value="-xml ./descriptor/sun-acc-lb3.xml 129.145.133.64 33700"/>
</antcall>
<antcall target="sql"/>
</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>
</target>
<target name="build" depends="compile">
<antcall target="build-ear-common">
<param name="ejbjar.classes"
value="**/*Student*.class,**/*Enroller*.class,**/*Course*.class" />
<param name="appclientjar.classes"
value="**/Course.class,**/Enroller.class,**/Student.class,**/*Home*.class,**/*Client*.class" />
</antcall>
</target>
<target name="setup" depends="init-common">
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/create_derby.sql"/>
</antcall>
<antcall target="deploy-jdbc-common">
<param name="jdbc.conpool.name" value="bmpEnrollerPool"/>
<param name="jdbc.resource.name" value="jdbc/bmp-enrollerDB"/>
<param name="appserver.instance.name" value="C1"/>
</antcall>
<!--antcall target="deploy-jms-common"/>
<antcall target="reconfig-common"/-->
</target>
<target name="deploy" depends="init-common">
<echo message="Deploying via asadmin..."/>
<antcall target="deploy-common-ee">
<param name="ee" value="enterprise edition"/>
<param name="appserver.instance.name" value="C1"/>
</antcall>
</target>
<!-- =============================================== -->
<!-- Target to run the standalone client without ACC -->
<!---->
<!-- =============================================== -->
<target name="run-standalone-client" depends="init-common">
<property name="client.type"
value="standalone"/>
<java classname="com.sun.s1peqe.loadbalancing.client.EnrollerClient"
classpath="${env.S1AS_HOME}/imq/lib/imq.jar:${env.S1AS_HOME}/imq/lib/imqjmsra.jar:${env.S1AS_HOME}/imq/lib/jms.jar:${s1astest.classpath}:${assemble.dir}/${appname}AppClient.jar" failonerror="true" fork="true">
<!--jvmarg value="-Dorg.omg.CORBA.ORBInitialHost=${admin.host}"/>
<jvmarg value="-Dorg.omg.CORBA.ORBInitialPort=${orb.port}"/-->
<jvmarg value="-Djava.naming.provider.url=iiop://129.145.133.64:33700"/>
<!--jvmarg value="-Dcom.sun.appserv.iiop.endpoints=pathfinder.sfbay.sun.com:3690,pathfinder.sfbay.sun.com:3880"/-->
<jvmarg value="-Dcom.sun.appserv.iiop.loadbalancingpolicy=ic-based"/>
<arg value="129.145.133.64"/>
<arg value="33700"/>
<arg value="${client.type}"/>
</java>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common">
<param name="appserver.instance.name" value="C1"/>
</antcall>
</target>
<target name="unsetup" depends="init-common">
<!--antcall target="undeploy-jms-common"/-->
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/drop_derby.sql"/>
</antcall>
<antcall target="undeploy-jdbc-common">
<param name="jdbc.conpool.name" value="bmpEnrollerPool"/>
<param name="jdbc.resource.name" value="jdbc/bmp-enrollerDB"/>
<param name="appserver.instance.name" value="C1"/>
</antcall>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
<!-- ================================================================ -->
<!-- Running eeconfig/eeunsetup -->
<!-- ================================================================ -->
<target name="cluster-unsetup">
<echo message="Cleaning up cluster setup" level="verbose"/>
<exec executable="sh" failonerror="false">
<arg line="${env.APS_HOME}/devtests/naming/loadbalancing/cluster-unsetup"/>
</exec>
</target>
<!-- ================================================================ -->
<!-- Running eeconfig/eesetup -->
<!-- ================================================================ -->
<target name="cluster-setup" depends="init-common">
<echo message="Setting up cluster, waiting ..." level="verbose"/>
<exec executable="sh" failonerror="true" >
<arg line="${env.APS_HOME}/devtests/naming/loadbalancing/cluster-setup"/>
</exec>
<waitfor>
<http url="http://${http.host}:${http.port}"/>
</waitfor>
<sleep seconds="80"/>
</target>
</project>