Show systemtest.xml syntax highlighted
<?xml version="1.0" ?>
<project name="systemtest"
xmlns:core="http://smartfrog.org/build/core"
xmlns:ac="antlib:net.sf.antcontrib"
xmlns:sf="antlib:org.smartfrog.tools.ant"
>
<description>
All the targets for system tests
This overrides some stuff in unittest
</description>
<!-- import the core -->
<import file="unittest.xml"/>
<!-- ========================================================== -->
<!-- set up the codebase-->
<!-- ========================================================== -->
<target name="init-codebase"
depends="declare-classpaths,package-tests,extended-smartfrog-tasks"
description="set up the codebase">
<makeurl property="codebase" validate="false">
<path refid="tests.run.classpath" />
</makeurl>
<echo level="verbose">
codebase=${codebase}
</echo>
</target>
<!--
This target defines the task
<sf-system-test> which is a functional tests runner ready to
run smartfrog, just add tests and go.
The classpath of the daemon is set to tests.run.classpath;
-->
<target name="declare-system-test-tasks" depends="init-codebase">
<presetdef name="system-test" uri="${core.uri}">
<sf:functionaltest testTimeout="600" shutdownTime="10">
<application>
<sf:daemon-debug failonerror="false"
spawn="false"
classpathref="tests.run.classpath"/>
</application>
<probe>
<socket port="${smartfrog.daemon.port}" server="localhost"/>
</probe>
<teardown>
<parallel>
<sf:stopdaemon failonerror="false"/>
<core:test-report data="${test.data.dir}"
reports="${test.reports.dir}"
/>
</parallel>
</teardown>
</sf:functionaltest>
</presetdef>
<presetdef name="system-test-junit" uri="${core.uri}">
<core:junit
errorProperty="system.test.failed"
failureProperty="system.test.failed"
includeAntRuntime="true"
>
<classpath refid="tests.run.classpath"/>
<sysproperty key="test.classes.dir"
value="${test.classes.dir}"/>
<!--all properties beginning with test and runtime, and the codebase-->
<syspropertyset>
<propertyref prefix="test."/>
</syspropertyset>
<sysproperty key="org.smartfrog.codebase" value="${codebase}"/>
<syspropertyset>
<propertyref prefix="runtime"/>
</syspropertyset>
</core:junit>
</presetdef>
<!-- define the system test post processor-->
<presetdef name="system-test-validate" uri="${core.uri}">
<fail if="system.test.failed">System Tests failed - see
${test.reports.dir}
</fail>
</presetdef>
<presetdef name="system-test-batch-run" uri="${core.uri}">
<core:system-test>
<test>
<core:system-test-junit>
<batchtest todir="${test.data.dir}" unless="testcase">
<fileset dir="${test.classes.dir}">
<include name="org/smartfrog/**/test/**/*Test.class"/>
</fileset>
</batchtest>
</core:system-test-junit>
<core:system-test-validate />
</test>
</core:system-test>
</presetdef>
</target>
<!-- ========================================================== -->
<!-- this is an override point -->
<!-- system tests : anything that is tested on a live daemon
not to be run on public machines for
security reasons, unless security is active-->
<target name="ready-to-system-test"
depends="package-tests,ready-to-test,init-codebase,declare-system-test-tasks" />
<target name="system-tests" depends="ready-to-system-test"
if="system.tests.enabled"
description="run the system tests if system.tests.enabled is set">
<core:system-test-batch-run />
</target>
<target name="ready-to-parse" depends="init-codebase" />
<!-- ========================================================== -->
<!-- parse the file -->
<!-- ========================================================== -->
<target name="parse" depends="ready-to-parse"
description="parse the deployment descriptor">
<property name="parse.quiet" value="true"/>
<sf:parse quiet="${parse.quiet}" classpathref="tests.run.classpath">
<sysproperty key="org.smartfrog.codebase"
value="${codebase}"/>
<!-- test files -->
<source dir="${test.src.dir}">
<include name="files/*.sf"/>
<exclude name="files/components.sf"/>
</source>
</sf:parse>
</target>
<target name="init-deploy-properties" depends="init-codebase">
<property name="application.name" value="${ant.project.name}"/>
<property name="deploy.host" value="localhost"/>
<property name="deploy.timeout" value="localhost"/>
</target>
<target name="ready-to-deploy" depends="init-deploy-properties" />
<!-- ========================================================== -->
<!-- deploy; requires a host -->
<!-- ========================================================== -->
<target name="deploy" depends="ready-to-deploy"
description="deploy">
<sf:deploy classpathref="tests.run.classpath"
logStackTraces="true"
host="${deploy.host}"
timeout="${deploy.timeout}" >
<codebase url="${codebase}"/>
<application name="${application.name}">
#include "/${deploy.sf}"
sfCodeBase PROPERTY org.smartfrog.codebase;
</application>
</sf:deploy>
</target>
<target name="undeploy" depends="init-deploy-properties"
description="deploy">
<sf:undeploy classpathref="run.classpath"
logStackTraces="true"
host="${deploy.host}"
timeout="${deploy.timeout}"
application="${application.name}"/>
</target>
</project>
See more files for this project here