[seam-commits] Seam SVN: r11550 - in branches/enterprise/JBPAPP_5_0: src/test/ftest and 5 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Oct 6 08:06:37 EDT 2009
Author: jharting
Date: 2009-10-06 08:06:37 -0400 (Tue, 06 Oct 2009)
New Revision: 11550
Removed:
branches/enterprise/JBPAPP_5_0/src/test/ftest/lib/
Modified:
branches/enterprise/JBPAPP_5_0/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.java
branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
Log:
JBPAPP-2887 backported changes to Seam functional testsuite
Modified: branches/enterprise/JBPAPP_5_0/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build.xml 2009-10-06 11:37:26 UTC (rev 11549)
+++ branches/enterprise/JBPAPP_5_0/build.xml 2009-10-06 12:06:37 UTC (rev 11550)
@@ -1060,6 +1060,14 @@
<target name="eclipseclasspath" depends="init, jargen,antlr" description="Update eclipse classpath">
<path id="seam-gen.path" path="${seam.dir}/lib/gen/jboss-seam-gen.jar" />
+
+ <ant antfile="${seam.dir}/src/test/ftest/examples/build.xml" target="copy.selenium" />
+ <ant antfile="${seam.dir}/src/test/ftest/examples/build.xml" target="copy.htmlunit">
+ <property name="depends.htmlunit" value="true" />
+ </ant>
+ <path id="ftest.path">
+ <fileset dir="${seam.dir}/lib/ftest" includes="*.jar" />
+ </path>
<taskdef name="eclipseClasspath"
classname="org.jboss.seam.tool.EclipseClasspathTask"
@@ -1083,6 +1091,7 @@
<path refid="compile.excel.path" />
<path refid="compile.remoting.path" />
<path refid="compile.ui.path" />
+ <path refid="ftest.path" />
</eclipseClasspath>
</target>
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml 2009-10-06 11:37:26 UTC (rev 11549)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml 2009-10-06 12:06:37 UTC (rev 11550)
@@ -33,7 +33,7 @@
<property name="ftest.dir" value="${seam.dir}/src/test/ftest" />
<!-- TODO : should the libs be in seam/lib and managed with mvn? -->
- <property name="lib.dir" value="${ftest.dir}/lib" />
+ <property name="lib.dir" value="${seam.dir}/lib/ftest" />
<property name="log.dir" value="${ftest.dir}/log" />
<!-- Build resources -->
@@ -150,6 +150,7 @@
<cleanexample name="spring" />
<cleanexample name="todo" />
<cleanexample name="ui" />
+ <ant antfile="${ftest.dir}/seamgen/build.xml" target="clean" />
</target>
<target name="undeployall">
@@ -184,22 +185,11 @@
<undeployexample name="ui" />
</target>
- <!-- Target for declaring needed libraries for tests to run -->
- <target name="import.libraries">
- <copyInlineDependencies id="selenium.server" scope="compile" todir="${lib.dir}">
- <dependency groupId="org.seleniumhq.selenium.server" artifactId="selenium-server" version="1.0-beta-2" classifier="standalone"/>
- <dependency groupId="org.seleniumhq.selenium.client-drivers" artifactId="selenium-java-client-driver" version="1.0-beta-2">
- <exclusion groupId="org.codehaus.groovy.maven.runtime" artifactId="gmaven-runtime-default"/>
- </dependency>
- <dependency groupId="org.jboss.test" artifactId="jboss-test" version="1.1.0.GA"/>
- <dependency groupId="org.testng" artifactId="testng" version="5.9"/>
- </copyInlineDependencies>
+ <target name="copy.selenium">
+ <ant antfile="${ftest.dir}/examples/build.xml" target="copy.selenium" />
</target>
-
- <target name="start.selenium.server">
- <!-- Added for downloading libraries -->
- <antcall target="import.libraries"> </antcall>
-
+
+ <target name="start.selenium.server" depends="copy.selenium">
<java classpathref="selenium.server.classpath" classname="org.openqa.selenium.server.SeleniumServer" fork="true" spawn="true">
<arg line="-port ${selenium.server.port}" />
<arg line="${selenium.server.cmd.args}" />
@@ -208,14 +198,14 @@
<waitfor maxwait="30" maxwaitunit="second">
<and>
<socket server="${selenium.host}" port="${selenium.server.port}" />
- <!-- this url will 403, so we say that it should start counting errors at 404 to skip -->
- <http url="http://${selenium.host}:${selenium.server.port}/selenium-server/core/index.html" errorsBeginAt="404" />
+ <!-- this url will start returning 404 once the server is up, we set errorsBeginAt to 405 for the 404 response to be considered correct -->
+ <http url="http://${selenium.host}:${selenium.server.port}/selenium-server/core/index.html" errorsBeginAt="405" />
</and>
</waitfor>
</target>
<target name="stop.selenium.server">
- <get taskname="selenium-shutdown" src="http://${selenium.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDown" dest="${log.dir}/server.shutdown.dest.log" ignoreerrors="true" />
+ <get taskname="selenium-shutdown" src="http://${selenium.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDownSeleniumServer" dest="${log.dir}/server.shutdown.dest.log" ignoreerrors="true" />
<echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
</target>
@@ -250,36 +240,10 @@
</sequential>
</macrodef>
- <!-- Target for declaring needed libraries for ftest tests -->
- <target name="importlibraries">
- <copyInlineDependencies id="allexamples" scope="compile" todir="${lib.dir}">
- <dependency groupId="net.sourceforge.htmlunit" artifactId="htmlunit" version="2.3"/>
- <dependency groupId="commons-httpclient" artifactId="commons-httpclient" version="3.1"/>
- <dependency groupId="org.w3c" artifactId="sac" version="1.3"/>
- <dependency groupId="commons-io" artifactId="commons-io" version="1.3.1"/>
- <dependency groupId="commons-lang" artifactId="commons-lang" version="2.3"/>
- <dependency groupId="apache-xerces" artifactId="xercesImpl" version="2.9.0"/>
- <dependency groupId="commons-collections" artifactId="commons-collections" version="3.1"/>
- <dependency groupId="commons-lang" artifactId="commons-lang" version="2.3"/>
- <dependency groupId="apache-xalan" artifactId="xalan" version="j_2.7.0"/>
- <dependency groupId="commons-codec" artifactId="commons-codec" version="1.3"/>
- <dependency groupId="commons-logging" artifactId="commons-logging" version="1.1.1"/>
- <dependency groupId="net.sourceforge.cssparser" artifactId="cssparser" version="0.9.5"/>
- <dependency groupId="net.sourceforge.htmlunit" artifactId="htmlunit-core-js" version="2.4"/>
- <dependency groupId="net.sourceforge.nekohtml" artifactId="nekohtml" version="1.9.9"/>
- <dependency groupId="apache-xalan" artifactId="serializer" version="j_2.7.0"/>
- <dependency groupId="xml-apis" artifactId="xml-apis" version="1.3.03"/>
- </copyInlineDependencies>
- </target>
-
<macrodef name="callExample">
<attribute name="path" />
<attribute name="target" />
<sequential>
-
- <!-- Added for downloading libraries -->
- <antcall target="importlibraries"> </antcall>
-
<ant dir="@{path}" target="@{target}" inheritall="false">
<property name="container" value="${container}">
</property>
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml 2009-10-06 11:37:26 UTC (rev 11549)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml 2009-10-06 12:06:37 UTC (rev 11550)
@@ -31,10 +31,10 @@
<property name="ftest.dir" value="${seam.dir}/src/test/ftest" />
<property name="src.dir" value="src" />
<property name="common.src.dir" value="${ftest.dir}/src/main" />
- <property name="build.dir" value="build" />
- <property name="classes.dir" value="${build.dir}/classes" />
+ <property name="local.build.dir" value="build" />
+ <property name="classes.dir" value="${local.build.dir}/classes" />
<property name="test.output.dir" value="${seam.dir}/test-output" />
- <property name="ftest.lib.dir" value="${ftest.dir}/lib" />
+ <property name="ftest.lib.dir" value="${seam.dir}/lib/ftest" />
<property name="log.dir" value="log" />
<property name="test.report.dir" value="test-report" />
@@ -45,9 +45,16 @@
<property name="jboss5.context.path" value="/seam-${example.name}" />
<property name="functional.listener" value="org.jboss.seam.example.common.test.selenium.SeleniumFunctionalTestListener"/>
+ <property name="root.lib.dir" value="${seam.dir}/lib" />
+ <!-- Build resources -->
+ <import file="${seam.dir}/build/common.build.xml" />
+
<!-- common path setup -->
<path id="classpath.build">
+ <fileset dir="${root.lib.dir}">
+ <include name="testng-jdk15.jar"/>
+ </fileset>
<fileset dir="${ftest.lib.dir}" includes="**/*.jar" />
</path>
@@ -56,14 +63,10 @@
<path location="${classes.dir}" />
</path>
- <taskdef name="config" classname="org.jboss.ant.taskdefs.server.ConfigManagerTask" uri="http://jboss.org/ns/test/ant/server" loaderref="server.loader" classpathref="classpath.build" />
- <taskdef name="start" classname="org.jboss.ant.taskdefs.server.StartServerTask" uri="http://jboss.org/ns/test/ant/server" loaderref="server.loader" classpathref="classpath.build" />
- <taskdef name="stop" classname="org.jboss.ant.taskdefs.server.StopServerTask" uri="http://jboss.org/ns/test/ant/server" loaderref="server.loader" classpathref="classpath.build" />
-
<!-- common target definitions -->
<target name="clean" description="Delete all generated files">
- <delete dir="${build.dir}" />
+ <delete dir="${local.build.dir}" />
<delete dir="${test.output.dir}" />
<delete dir="${report.dir}" />
<delete dir="${log.dir}" />
@@ -81,7 +84,7 @@
<!-- TODO we should compile this once to a common place not build for each example -->
<!-- TODO if needed we should allow examples to exclude/include src under
common dvd does not care about booking for example-->
- <target name="build.common" description="Compiles the common selenium test code">
+ <target name="build.common" depends="copy.htmlunit, copy.selenium" description="Compiles the common selenium test code">
<mkdir dir="${classes.dir}" />
<javac srcdir="${common.src.dir}" destdir="${classes.dir}" classpathref="classpath.build" debug="true" />
<copy todir="${classes.dir}">
@@ -198,14 +201,42 @@
<propertyset id="jboss5.deploy.properties" />
</target>
- <target name="start.container.jboss" depends="container.properties">
- <server:config javaHome="${java.home}" jbossHome="${container.home}">
- <server name="${container.profile}">
- <jvmarg value="${container.jvm.arguments}" />
- <sysproperty key="java.endorsed.dirs" value="${container.home}/lib/endorsed" />
- </server>
- </server:config>
- <server:start name="${container.profile}" />
+ <!-- Target for obtaining htmlunit -->
+ <target name="copy.htmlunit" if="depends.htmlunit" unless="copy.htmlunit.done">
+ <copyInlineDependencies id="allexamples" scope="compile" todir="${ftest.lib.dir}">
+ <dependency groupId="net.sourceforge.htmlunit" artifactId="htmlunit" version="2.3"/>
+ <dependency groupId="commons-httpclient" artifactId="commons-httpclient" version="3.1"/>
+ <dependency groupId="org.w3c" artifactId="sac" version="1.3"/>
+ <dependency groupId="commons-io" artifactId="commons-io" version="1.3.1"/>
+ <dependency groupId="commons-lang" artifactId="commons-lang" version="2.3"/>
+ <dependency groupId="apache-xerces" artifactId="xercesImpl" version="2.9.0"/>
+ <dependency groupId="commons-collections" artifactId="commons-collections" version="3.1"/>
+ <dependency groupId="commons-lang" artifactId="commons-lang" version="2.3"/>
+ <dependency groupId="apache-xalan" artifactId="xalan" version="j_2.7.0"/>
+ <dependency groupId="commons-codec" artifactId="commons-codec" version="1.3"/>
+ <dependency groupId="commons-logging" artifactId="commons-logging" version="1.1.1"/>
+ <dependency groupId="net.sourceforge.cssparser" artifactId="cssparser" version="0.9.5"/>
+ <dependency groupId="net.sourceforge.htmlunit" artifactId="htmlunit-core-js" version="2.4"/>
+ <dependency groupId="net.sourceforge.nekohtml" artifactId="nekohtml" version="1.9.9"/>
+ <dependency groupId="apache-xalan" artifactId="serializer" version="j_2.7.0"/>
+ <dependency groupId="xml-apis" artifactId="xml-apis" version="1.3.03"/>
+ </copyInlineDependencies>
+ <property name="copy.htmlunit.done" value="true" />
</target>
+ <target name="copy.selenium" unless="copy.selenium.done">
+ <copyInlineDependencies id="selenium.server" scope="compile" todir="${ftest.lib.dir}">
+ <dependency groupId="org.seleniumhq.selenium.server" artifactId="selenium-server" version="1.0.1" classifier="standalone">
+ <exclusion groupId="org.seleniumhq.selenium.core" artifactId="selenium-core" />
+ <exclusion groupId="org.seleniumhq.selenium.server" artifactId="selenium-server-coreless" />
+ <exclusion groupId="org.apache.ant" artifactId="ant-trax" />
+ <exclusion groupId="org.apache.ant" artifactId="ant-nodeps" />
+ </dependency>
+ <dependency groupId="org.seleniumhq.selenium.client-drivers" artifactId="selenium-java-client-driver" version="1.0.1">
+ <exclusion groupId="org.codehaus.groovy.maven.runtime" artifactId="gmaven-runtime-default" />
+ </dependency>
+ </copyInlineDependencies>
+ <property name="copy.selenium.done" value="true" />
+ </target>
+
</project>
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/build.xml 2009-10-06 11:37:26 UTC (rev 11549)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/build.xml 2009-10-06 12:06:37 UTC (rev 11550)
@@ -23,5 +23,7 @@
<project name="ui.ftest.build" basedir="." default="build">
<property name="example.name" value="ui" />
+ <property name="depends.htmlunit" value="true"/>
+
<import file="../build.xml" />
</project>
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml 2009-10-06 11:37:26 UTC (rev 11549)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml 2009-10-06 12:06:37 UTC (rev 11550)
@@ -32,10 +32,11 @@
<property name="ftest.dir" value="${seam.dir}/src/test/ftest" />
<property name="common.src.dir" value="${ftest.dir}/src/main" />
<property name="src.dir" value="src/main" />
- <property name="seamgen.build.dir" value="build" />
+ <property name="seamgen.build.dir" value="${ftest.dir}/seamgen/build" />
<property name="classes.dir" value="${seamgen.build.dir}/classes" />
<property name="test.output.dir" value="${seam.dir}/test-output" />
- <property name="ftest.lib.dir" value="${ftest.dir}/lib" />
+ <property name="ftest.lib.dir" value="${seam.dir}/lib/ftest" />
+ <property name="root.lib.dir" value="${seam.dir}/lib" />
<property name="ftest.config.location" value="src/test/ftest/ftest.properties" />
<property file="${seam.dir}/${ftest.config.location}" />
@@ -43,6 +44,10 @@
<!-- common path setup -->
<path id="classpath.build">
+ <fileset dir="${root.lib.dir}">
+ <include name="testng-jdk15.jar"/>
+ <include name="gen/ant.jar"/>
+ </fileset>
<fileset dir="${ftest.lib.dir}" includes="**/*.jar" />
</path>
@@ -63,19 +68,10 @@
<delete dir="${log.dir}" />
</target>
- <!-- Target for declaring needed libraries for tests runs -->
- <target name="import.libraries">
- <copyInlineDependencies id="selenium.server" scope="compile" todir="${ftest.lib.dir}">
- <dependency groupId="org.seleniumhq.selenium.server" artifactId="selenium-server" version="1.0-beta-2" classifier="standalone"/>
- <dependency groupId="org.seleniumhq.selenium.client-drivers" artifactId="selenium-java-client-driver" version="1.0-beta-2">
- <exclusion groupId="org.codehaus.groovy.maven.runtime" artifactId="gmaven-runtime-default"/>
- </dependency>
- <dependency groupId="org.apache.ant" artifactId="ant" version="1.7.0"/>
- <dependency groupId="org.apache.ant" artifactId="ant-launcher" version="1.7.0"/>
- <dependency groupId="org.testng" artifactId="testng" version="5.9"/>
- </copyInlineDependencies>
+ <target name="copy.selenium">
+ <ant antfile="${ftest.dir}/examples/build.xml" target="copy.selenium" />
</target>
-
+
<target name="build" depends="build.common" description="Compiles the Test">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath.build" debug="true" />
@@ -86,10 +82,7 @@
</copy>
</target>
- <target name="build.common" description="Compiles the common selenium test code">
- <!-- Added for downloading libraries -->
- <antcall target="import.libraries"> </antcall>
-
+ <target name="build.common" depends="copy.selenium" description="Compiles the common selenium test code">
<mkdir dir="${classes.dir}" />
<javac srcdir="${common.src.dir}" destdir="${classes.dir}" classpathref="classpath.build" debug="true" />
<copy todir="${classes.dir}">
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.java 2009-10-06 11:37:26 UTC (rev 11549)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.java 2009-10-06 12:06:37 UTC (rev 11550)
@@ -66,7 +66,7 @@
Project ant = new Project();
ant.init();
ProjectHelper.configureProject(ant, new File(buildfile));
- // ant.addBuildListener(log);
+ ant.addBuildListener(log);
return ant;
}
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java 2009-10-06 11:37:26 UTC (rev 11549)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java 2009-10-06 12:06:37 UTC (rev 11550)
@@ -96,9 +96,14 @@
return newBrowser;
}
- public void stopBrowser() {
- browser.stop();
- }
+
+ public void stopBrowser()
+ {
+ if (browser != null)
+ {
+ browser.stop();
+ }
+ }
public String getProperty(String key) {
if (!propertiesLoaded) {
More information about the seam-commits
mailing list