summaryrefslogtreecommitdiffstats
path: root/tests/vaadin-server.xml
diff options
context:
space:
mode:
authorMikael Vappula <mikael@vaadin.com>2011-12-01 16:48:19 +0200
committerMikael Vappula <mikael@vaadin.com>2011-12-01 16:48:44 +0200
commit46309c47b6700127c7aebb68d7fd893b1f0f8429 (patch)
tree35ec3c8d68d1d2fd060089ef78feb4d61107a831 /tests/vaadin-server.xml
parentb41b0a91f6b05dfe25444a9abad8c75537f4c4d2 (diff)
downloadvaadin-framework-46309c47b6700127c7aebb68d7fd893b1f0f8429.tar.gz
vaadin-framework-46309c47b6700127c7aebb68d7fd893b1f0f8429.zip
Ivy configuration and TestBench test build script updates.
Included first version of Ant based replacement of old vaadin-server.py demo server launch script.
Diffstat (limited to 'tests/vaadin-server.xml')
-rw-r--r--tests/vaadin-server.xml57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/vaadin-server.xml b/tests/vaadin-server.xml
new file mode 100644
index 0000000000..6445106d35
--- /dev/null
+++ b/tests/vaadin-server.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<project xmlns:antcontrib="antlib:net.sf.antcontrib"
+ xmlns:ivy="antlib:org.apache.ivy.ant"
+ name="vaadin-server"
+ default="deploy-and-start">
+
+ <target name="check-params">
+ <fail unless="output-dir" message="The 'output-dir' (usually build/result/vaadin-xxx) should be given to test script." />
+ <fail unless="package.name" message="The 'package.name' property must be defined." />
+ <fail unless="package.filename" message="The 'package.filename' property must be defined." />
+ <fail unless="testing.testarea" message="The 'testing.testarea' property must be defined." />
+ <property name="webroot" value="${testing.testarea}/${package.name}/WebContent" />
+ </target>
+
+ <target name="ivy-resolve">
+ <ivy:resolve file="ivy.xml" resolveid="tests"/>
+ <ivy:cachepath pathid="jetty.lib" conf="jetty" resolveid="tests" />
+ <!-- Emma libs from "common" resolve -->
+ <ivy:cachepath pathid="emma.lib" conf="emma" resolveid="common"/>
+ </target>
+
+ <target name="prepare-testing-area" depends="check-params">
+ <echo> Package name: ${package.name}</echo>
+ <echo> Package filename: ${package.filename}</echo>
+ <echo> Testing area: ${testing.testarea}</echo>
+ <echo> test-output-dir: ${test-output-dir}</echo>
+
+ <delete dir="${testing.testarea}/${package.name}" />
+ <mkdir dir="${testing.testarea}/${package.name}/WebContent" />
+ <echo>Extracting Vaadin package ${package.filename} to testing area ${testing.testarea}</echo>
+ <unzip src="${package.filename}" dest="${testing.testarea}/${package.name}/WebContent" />
+ </target>
+
+ <target name="deploy-and-start" depends="ivy-resolve, prepare-testing-area">
+ <property name="webroot" value="${testing.testarea}/${package.name}/WebContent"></property>
+ <java classname="com.vaadin.launcher.DemoLauncher" fork="yes" dir="${testing.testarea}/${package.name}" resultproperty="server.start.result">
+ <arg value="--nogui=1" />
+ <classpath>
+ <path location="${webroot}/WEB-INF/classes" />
+ <fileset dir="${webroot}/WEB-INF/lib/" includes="*.jar" />
+ <path refid="jetty.lib" />
+ <path refid="emma.lib" />
+ </classpath>
+ <jvmarg value="-Demma.coverage.out.file=${testing.testarea}/${package.name}/war.ec"/>
+ <jvmarg value="-Djava.awt.headless=true"/>
+ </java>
+ </target>
+
+ <target name="wait-for-startup">
+ <echo>Waiting for Servlet Container to start up.</echo>
+ <waitfor maxwait="30" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="server.start.failed">
+ <http url="http://localhost:8888"/>
+ </waitfor>
+ <fail if="server.start.failed" message="Server startup failed" />
+ </target>
+
+</project>