blob: d9be3265ef727c379cfc804ccb312bb87f181798 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 1997, 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
-->
<!DOCTYPE project [
<!ENTITY commonSetup SYSTEM "./../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "./../../../config/common.xml">
<!ENTITY reporting SYSTEM "./../../../config/report.xml">
<!ENTITY run SYSTEM "./../../../config/run.xml">
]>
<project name="admin" default="all" basedir=".">
&commonSetup;
&commonBuild;
&reporting;
&run;
<property name="trunkurl" value="http://gf-hudson.us.oracle.com/hudson/job/gf-trunk-build-continuous/lastSuccessfulBuild/artifact/bundles/glassfish.zip"/>
<property name="dasbranchurl" value="http://gf-hudson.us.oracle.com/hudson/view/GFv3%20Trunk/job/gf-ha-das-continuous/lastSuccessfulBuild/artifact/bundles/glassfish.zip"/>
<!--
<property name="gfurl" value="${trunkurl}"/>
-->
<property name="stylesheet" value="${env.APS_HOME}/config/j2eeReporter.xsl" />
<property name="xmlfile" value="${env.APS_HOME}/test_resultsValid.xml" />
<property name="htmlfile" value="${env.APS_HOME}/test_results.html" />
<property name="teststorun" value="cli"/>
<property name="verbose" value="false"/>
<property name="javaprops" value="-Dverbose=${verbose}"/>
<property name="derbyhome" value="${env.S1AS_HOME}/../javadb"/>
<property name="databases_dir" value="${env.S1AS_HOME}/databases"/>
<property name="asinstall_dir" value="${env.S1AS_HOME}/../.."/>
<!-- SSH defaults -->
<property name="ssh.host" value="chandu.us.oracle.com"/>
<property name="ssh.user" value="hudson"/>
<property name="ssh.password" value="hudson"/>
<!-- Used by setup-ssh test -->
<property name="ssh.configure" value="true"/>
<!-- Used by sshnode test -->
<property name="ssh.installprefix" value="/export/home/hudson/devtest-${user.name}"/>
<property name="ssh.doinstall" value="true"/>
<!-- convert these paths to canonical form -->
<pathconvert property="aps_home">
<path location="${env.APS_HOME}"/>
</pathconvert>
<pathconvert property="s1as_home">
<path location="${env.S1AS_HOME}"/>
</pathconvert>
<pathconvert property="as_logfile">
<path location="${env.AS_LOGFILE}"/>
</pathconvert>
<macrodef name="runtest">
<attribute name="classname"/>
<element name="args" implicit="yes" optional="true"/>
<sequential>
<java classname="@{classname}" fork="true" classpath="${THE_CLASSPATH}">
<jvmarg value="${javaprops}"/>
<jvmarg value="-DHADAS=${env.HADAS}"/>
<jvmarg value="-DNUM_TESTS=${num_tests}"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9010"/>
<env key="APS_HOME" value="${aps_home}"/>
<env key="S1AS_HOME" value="${s1as_home}"/>
<env key="AS_LOGFILE" value="${as_logfile}"/>
<args/>
</java>
</sequential>
</macrodef>
<macrodef name="runtestsuspend">
<attribute name="classname"/>
<element name="args" implicit="yes" optional="true"/>
<sequential>
<java classname="@{classname}" fork="true" classpath="${THE_CLASSPATH}">
<jvmarg value="${javaprops}"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9010"/>
<env key="APS_HOME" value="${aps_home}"/>
<env key="S1AS_HOME" value="${s1as_home}"/>
<env key="AS_LOGFILE" value="${as_logfile}"/>
<args/>
</java>
</sequential>
</macrodef>
<target name="init-path">
<path id="class.path">
<pathelement location="${env.APS_HOME}/lib/reportbuilder.jar"/>
<pathelement location="build"/>
<pathelement location="${env.S1AS_HOME}/lib/gf-client.jar"/>
<pathelement location="${env.S1AS_HOME}/modules/common-util.jar"/>
</path>
<pathconvert refid="class.path" property="THE_CLASSPATH"/>
</target>
<target name="debug-windows" depends="instance, cluster"/>
<target name="cli" depends="setup, monitoring, zombie, ports, instance, cluster,
configs, sync, domain, backup, tokens, validation, node, clientstubs,
logging-command,load-balancer, getset, misc-commands, all-jms, manual-sync, upgrade,
restart-domain, config-modularity, all-resources, teardown"/>
<target name="cli-group-1" depends="setup, monitoring, zombie, ports, instance,teardown"/>
<target name="cli-group-2" depends="setup,cluster,configs, sync, domain,teardown"/>
<target name="cli-group-3" depends="setup,backup, tokens, validation, node,teardown"/>
<target name="cli-group-4" depends="setup, clientstubs, logging-command,load-balancer, getset, misc-commands, teardown"/>
<target name="cli-group-5" depends="setup,all-jms, manual-sync, upgrade,
restart-domain, config-modularity, all-resources, teardown"/>
<target name="admin-cli-group-1" depends="clean,init">
<record name="admin.output" action="start" />
<antcall target="prerun"/>
<antcall target="cli-group-1"/>
<record name="admin.output" action="stop" />
<antcall target="stacker"/>
<antcall target="dev-report"/>
<echo message="Detailed results available under ${env.APS_HOME}/test_results.html"/>
</target>
<target name="admin-cli-group-2" depends="clean,init">
<record name="admin.output" action="start" />
<antcall target="prerun"/>
<antcall target="cli-group-2"/>
<record name="admin.output" action="stop" />
<antcall target="stacker"/>
<antcall target="dev-report"/>
<echo message="Detailed results available under ${env.APS_HOME}/test_results.html"/>
</target>
<target name="admin-cli-group-3" depends="clean,init">
<record name="admin.output" action="start" />
<antcall target="prerun"/>
<antcall target="cli-group-3"/>
<record name="admin.output" action="stop" />
<antcall target="stacker"/>
<antcall target="dev-report"/>
<echo message="Detailed results available under ${env.APS_HOME}/test_results.html"/>
</target>
<target name="admin-cli-group-4" depends="clean,init">
<record name="admin.output" action="start" />
<antcall target="prerun"/>
<antcall target="cli-group-4"/>
<record name="admin.output" action="stop" />
<antcall target="stacker"/>
<antcall target="dev-report"/>
<echo message="Detailed results available under ${env.APS_HOME}/test_results.html"/>
</target>
<target name="admin-cli-group-5" depends="clean,init">
<record name="admin.output" action="start" />
<antcall target="prerun"/>
<antcall target="cli-group-5"/>
<record name="admin.output" action="stop" />
<antcall target="stacker"/>
<antcall target="dev-report"/>
<echo message="Detailed results available under ${env.APS_HOME}/test_results.html"/>
</target>
<target name="clientstubs" depends="init">
<runtest classname="admin.ClientStubsTests"/>
</target>
<target name="cluster" depends="init">
<runtest classname="admin.ClusterTest"/>
</target>
<target name="instance" depends="init">
<runtest classname="admin.InstanceTest">
<jvmarg value="-DNUM_TESTS=${num_tests}"/>
</runtest>
</target>
<target name="ports" depends="init">
<runtest classname="admin.PortTests"/>
</target>
<target name="stacker" depends="init">
<runtest classname="admin.Jstacker"/>
</target>
<target name="prerun" depends="init">
<runtest classname="admin.PreRun"/>
</target>
<target name="validation" depends="init">
<runtest classname="admin.ValidationTests"/>
</target>
<target name="configs" depends="init">
<runtest classname="admin.ConfigTests"/>
</target>
<target name="sync" depends="init">
<runtest classname="admin.SyncTest"/>
</target>
<target name="domain" depends="init">
<runtest classname="admin.DomainTest"/>
</target>
<target name="backup" depends="init, cleanAS">
<runtest classname="admin.BackupCommandsTest">
</runtest>
</target>
<target name="tokens" depends="init">
<runtest classname="admin.TokenTest"/>
</target>
<target name="node" depends="init">
<runtest classname="admin.NodeTest"/>
</target>
<target name="load-balancer" depends="init">
<runtest classname="admin.LBCommandsTest"/>
</target>
<target name="getset" depends="init">
<runtest classname="admin.GetSetTest"/>
</target>
<target name="misc-commands" depends="init">
<runtest classname="admin.MiscCommandsTest"/>
</target>
<target name="manual-sync" depends="init">
<runtest classname="admin.ManualSyncTest"/>
</target>
<target name="sshnode" depends="init">
<runtest classname="admin.SSHNodeTest">
<jvmarg value="-Dssh.host=${ssh.host}"/>
<jvmarg value="-Dssh.installdir=${ssh.installdir}"/>
<jvmarg value="-Dssh.installprefix=${ssh.installprefix}"/>
<jvmarg value="-Dssh.nodedir=${ssh.nodedir}"/>
<jvmarg value="-Dssh.user=${ssh.user}"/>
<jvmarg value="-Dssh.password=${ssh.password}"/>
<jvmarg value="-Dssh.doinstall=${ssh.doinstall}"/>
</runtest>
</target>
<target name="setup-ssh" depends="init">
<runtest classname="admin.SetupSshTest">
<jvmarg value="-Dssh.host=${ssh.host}"/>
<jvmarg value="-Dssh.user=${ssh.user}"/>
<jvmarg value="-Dssh.password=${ssh.password}"/>
<jvmarg value="-Dssh.configure=${ssh.configure}"/>
</runtest>
</target>
<target name="setup-ssh-remote" depends="init">
<runtest classname="admin.SetupSshRemoteTest">
<jvmarg value="-Dssh.host=${ssh.host}"/>
<jvmarg value="-Dssh.user=${ssh.user}"/>
<jvmarg value="-Dssh.password=${ssh.password}"/>
</runtest>
</target>
<target name="install-node" depends="init, setup-ssh">
<java classname="admin.InstallNodeTest" fork="true" classpath="${THE_CLASSPATH}">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n"/>
<jvmarg value="-Dssh.host=${ssh.host}"/>
<jvmarg value="-Dssh.user=${ssh.user}"/>
<jvmarg value="-Dssh.password=${ssh.password}"/>
<jvmarg value="-Dssh.configure=${ssh.configure}"/>
<jvmarg value="${javaprops}"/>
</java>
</target>
<target name="portsonly" depends="init">
<record name="admin.output" action="start" />
<runtest classname="admin.PortTests"/>
<antcall target="ports"/>
<record name="admin.output" action="stop" />
<antcall target="dev-report"/>
<echo message="Detailed results available under ${env.APS_HOME}/test_results.html"/>
</target>
<target name="connector-resource" depends="init">
<runtest classname="admin.ConnectorResourceTest"/>
</target>
<target name="jdbc-resource" depends="init">
<runtest classname="admin.JdbcResourceTest"/>
</target>
<target name="logging-command" depends="init">
<runtest classname="admin.LoggingCommandTest"/>
</target>
<target name="admin-object-resource" depends="init">
<runtest classname="admin.AdminObjectTest"/>
</target>
<target name="custom-resource" depends="init">
<runtest classname="admin.CustomResourceTest"/>
</target>
<target name="jndi-resource" depends="init">
<runtest classname="admin.ExternalJndiResourceTest"/>
</target>
<target name="mail-resource" depends="init">
<runtest classname="admin.JavaMailResourceTest"/>
</target>
<target name="change-master-broker" depends="init">
<runtest classname="admin.ChangeMasterBrokerTest"/>
</target>
<target name="configure-jms-cluster" depends="init">
<runtest classname="admin.ConfigureJmsClusterTest"/>
</target>
<target name="dynamic-sync-broker-list" depends="init">
<runtest classname="admin.DynamicSyncBrokerListTest"/>
</target>
<target name="configure-arbitary-broker-props" depends="init">
<runtest classname="admin.ConfigureArbitaryBrokerPropertiesTest"/>
</target>
<target name="upgrade" depends="init">
<runtest classname="admin.UpgradeTest"/>
</target>
<target name="testtests" depends="init">
<runtest classname="admin.TestTests"/>
</target>
<target name="zombie" depends="init">
<runtest classname="admin.ZombieTests"/>
</target>
<target name="restart-domain" depends="init">
<runtest classname="admin.RestartDomainTest"/>
</target>
<target name="whacker" depends="init">
<runtest classname="admin.Whacker"/>
</target>
<target name="create-jms-resource" depends="init">
<runtest classname="admin.CreateJmsResourceTest"/>
</target>
<target name="create-jms-host" depends="init">
<runtest classname="admin.CreateJmsHostTest"/>
</target>
<target name="create-jms-dest" depends="init">
<runtest classname="admin.CreateJmsDestTest"/>
</target>
<target name="all-jms">
<antcall target="create-jms-resource"/>
<antcall target="create-jms-host"/>
<antcall target="create-jms-dest"/>
</target>
<target name="all-resources">
<antcall target="jdbc-resource"/>
<antcall target="connector-resource"/>
<antcall target="admin-object-resource"/>
<antcall target="custom-resource"/>
<antcall target="jndi-resource"/>
<antcall target="mail-resource"/>
</target>
<target name="monitoring" depends="init,setup">
<runtest classname="admin.monitoring.TestDriver"/>
</target>
<target name="config-modularity" depends="init">
<runtest classname="admin.ConfigurationModularityTest"/>
</target>
<!-- there must be a better way to do this...
-->
<target name="monitoringverbose" depends="init,whacker,setup">
<runtest classname="admin.monitoring.TestDriver">
<jvmarg value="-Dverbose=true"/>
</runtest>
</target>
<target name="mon" depends="monitoringverbose,teardown">
</target>
<target name="all" depends="clean,init">
<record name="admin.output" action="start" />
<antcall target="prerun"/>
<antcall target="${teststorun}"/>
<record name="admin.output" action="stop" />
<antcall target="stacker"/>
<antcall target="dev-report"/>
<echo message="Detailed results available under ${env.APS_HOME}/test_results.html"/>
</target>
<target name="build" depends="init-path">
<mkdir dir="build"/>
<javac srcdir="src" destdir="build" debug="true" fork="true"
classpath="${THE_CLASSPATH}"
includes="**/*.java"/>
</target>
<target name="reminder" depends="init">
<runtest classname="admin.Reminders"/>
</target>
<target name="setup" depends="startdb">
<runtest classname="admin.Reminders"/>
</target>
<target name="teardown" depends="stopdb">
</target>
<target name="init" depends="build, init-path">
</target>
<target name="clean">
<delete failonerror="false" includeemptydirs="true" dir="build">
<fileset dir="${env.APS_HOME}" includes="test_results*"/>
<fileset dir="${env.APS_HOME}" includes="count.txt"/>
<fileset dir="." includes="*.output"/>
<fileset dir="." includes="*.txt"/>
</delete>
</target>
<target name="startdb">
<mkdir dir="${databases_dir}"/>
<java jar="${derbyhome}/lib/derbyrun.jar" spawn="true" fork="true" dir="${databases_dir}">
<arg value="server"/>
<arg value="start"/>
</java>
<echo message="************ JavaDB Started **********"/>
</target>
<target name="stopdb">
<java jar="${derbyhome}/lib/derbyrun.jar" spawn="true" fork="true">
<arg value="server"/>
<arg value="shutdown"/>
</java>
<echo message="************ JavaDB Stopped **********"/>
</target>
<target name="download" depends="fetchurl">
<echo message="gfurl == ${gfurl}"/>
<setproxy proxyhost=""/>
<get verbose="${verbose}" src="${gfurl}" dest="${asinstall_dir}/glassfish.zip"/>
<delete dir="${asinstall_dir}/glassfish6" includeemptydirs="true"/>
<unzip src="${asinstall_dir}/glassfish.zip" dest="${asinstall_dir}"/>
<chmod perm="a+x" file="${asinstall_dir}/glassfish6/bin/asadmin"/>
<chmod perm="a+x" file="${asinstall_dir}/glassfish6/glassfish/bin/asadmin"/>
<chmod perm="a+x" file="${asinstall_dir}/glassfish6/glassfish/lib/nadmin"/>
</target>
<!--
Complicated in order to keep the old default for existing hudson jobs
-->
<target name="fetchurl">
<condition property="gfurl" value = "${env.BRANCH_URL}" else = "${trunkurl}">
<contains string="${env.BRANCH_URL}" substring="http"/>
</condition>
</target>
<target name="usage">
<echo>Usage: ant [-Dteststorun=instance|cluster|...] [-Dnum_tests=n] [-Dverbose=true/false] all (Executes the admin tests)</echo>
</target>
</project>