<!--
|
! CDDL HEADER START
|
!
|
! The contents of this file are subject to the terms of the
|
! Common Development and Distribution License, Version 1.0 only
|
! (the "License"). You may not use this file except in compliance
|
! with the License.
|
!
|
! You can obtain a copy of the license at
|
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
|
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
|
! See the License for the specific language governing permissions
|
! and limitations under the License.
|
!
|
! When distributing Covered Code, include this CDDL HEADER in each
|
! file and include the License file at
|
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
|
! add the following below this CDDL HEADER, with the fields enclosed
|
! by brackets "[]" replaced with your own identifying information:
|
! Portions Copyright [yyyy] [name of copyright owner]
|
!
|
! CDDL HEADER END
|
!
|
!
|
! Copyright 2008 Sun Microsystems, Inc.
|
! -->
|
|
<project name="opends-gui-test" basedir="." default="usage">
|
<description>
|
Gui Testing ANT script
|
</description>
|
<dirname file="${basedir}/.." property="project.home"/>
|
<!-- Product properties -->
|
<property file="${project.home}/PRODUCT"/>
|
<property name="product.name"
|
value="${SHORT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}"/>
|
<property name="pkg.path"
|
value="${project.home}${file.separator}build${file.separator}package${file.separator}${product.name}.zip"/>
|
<property name="instance.path" value="${basedir}${file.separator}${product.name}"/>
|
|
<!-- Abbot properties -->
|
<property name="abbot.version" value="1.0.0.rc5"/>
|
<property name="abbot.url"
|
value="http://prdownloads.sf.net/abbot/abbot-${abbot.version}.zip?download"/>
|
<property name="abbot.path" value="${basedir}/abbot-${abbot.version}"/>
|
<property name="abbot.jar" value="${abbot.path}/lib/abbot.jar"/>
|
|
<!-- Proxy properties -->
|
<property name="proxy.host" value="webgate.central.sun.com"/>
|
<property name="proxy.port" value="8080"/>
|
<property name="proxy.user" value=""/>
|
<property name="proxy.pwd" value=""/>
|
|
<!-- targets -->
|
<target name="costello"
|
description="start the costello GUI">
|
<java jar="${abbot.jar}" fork="true" />
|
</target>
|
|
<target name="install"
|
description="Install gui test">
|
<!-- Preliminary cleanup -->
|
<delete dir="${product.name}"/>
|
<delete file="quickInstall.xml"/>
|
|
<!-- Unzip the bits -->
|
<unzip src="${pkg.path}" dest="."/>
|
|
<!-- Fix permissions on scripts -->
|
<chmod perm="755">
|
<fileset dir="${product.name}/bin"/>
|
<fileset dir="${product.name}/bat"/>
|
<fileset dir="${product.name}/lib">
|
<include name="*.sh"/>
|
<include name="*.bat"/>
|
<include name="*.exe"/>
|
</fileset>
|
</chmod>
|
<!-- Customize the test template -->
|
<copy file="quickInstall.xml.stubs" tofile="quickInstall.xml">
|
<filterchain>
|
<expandproperties/>
|
</filterchain>
|
</copy>
|
|
<!-- Run the tests -->
|
<java classpath="${abbot.jar}" classname="junit.extensions.abbot.ScriptFixture" fork="true">
|
<arg value="quickInstall.xml"/>
|
</java>
|
</target>
|
|
<target name="uninstall"
|
description="Uninstall gui test">
|
<!-- Preliminary cleanup -->
|
<delete file="quickUninstall"/>
|
|
<!-- Customize the test template -->
|
<copy file="quickUninstall.xml.stubs" tofile="quickUninstall.xml">
|
<filterchain>
|
<expandproperties/>
|
</filterchain>
|
</copy>
|
|
<!-- Run the tests -->
|
<java classpath="${abbot.jar}" classname="junit.extensions.abbot.ScriptFixture" fork="true">
|
<arg value="quickUninstall.xml"/>
|
</java>
|
</target>
|
|
<target name="usage">
|
<echo>Usage:
|
costello: start the costello GUI
|
download: get the abbot framework bits
|
install: run the installer GUI tests
|
uninstall: run the uninstaller GUI tests
|
upgrade: run the upgrader tests [not yet implemented]
|
</echo>
|
</target>
|
|
<target name="check-proxy">
|
<echo>Checking for proxy [${proxy.host}:${proxy.port}] as user [${proxy.user}].</echo>
|
<echo>Note: If these values do not match your environment, </echo>
|
<echo> please use the 'configure' target</echo>
|
<condition property="proxy.enabled">
|
<and>
|
<not>
|
<http url="${abbot.url}"/>
|
</not>
|
<isreachable host="${proxy.host}" timeout="5"/>
|
</and>
|
</condition>
|
</target>
|
|
<target name="set-proxy" depends="check-proxy" if="proxy.enabled">
|
<echo>Proxy detected. Configuring.</echo>
|
<setproxy
|
proxyhost="${proxy.host}"
|
proxyport="${proxy.port}"
|
proxyuser="${proxy.user}"
|
proxypassword="${proxy.pass}"/>
|
</target>
|
|
<target
|
name="download-prepare"
|
depends="set-proxy">
|
<available file="abbot.zip" property="downloaded"/>
|
</target>
|
|
<target name="download" depends="download-prepare" unless="downloaded">
|
<get src="${abbot.url}" dest="abbot.zip" />
|
<unzip src="abbot.zip" dest="." />
|
</target>
|
|
<target name="clean">
|
<delete dir="${instance.path}" />
|
<delete>
|
<fileset dir=".">
|
<include name="quick*.xml"/>
|
</fileset>
|
</delete>
|
</target>
|
|
<target name="clobber">
|
<delete dir="${abbot.path}"/>
|
<delete file="abbot.zip" />
|
</target>
|
</project>
|