[xwiki-notifications] r8159 - in xwiki-products/xwiki-watch/trunk: . distribution-test distribution-test/selenium-tests distribution-test/selenium-tests/src distribution-test/selenium-tests/src/test distribution-test/selenium-tests/src/test/it distribution-test/selenium-tests/src/test/it/com distribution-test/selenium-tests/src/test/it/com/xpn distribution-test/selenium-tests/src/test/it/com/xpn/xwiki distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium
jvelociter (SVN)
notifications at xwiki.org
Sat Mar 1 12:04:32 CET 2008
Author: jvelociter
Date: 2008-03-01 12:04:32 +0100 (Sat, 01 Mar 2008)
New Revision: 8159
Added:
xwiki-products/xwiki-watch/trunk/distribution-test/
xwiki-products/xwiki-watch/trunk/distribution-test/pom.xml
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/pom.xml
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/AllTests.java
xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/WatchGWTLoadingTest.java
Modified:
xwiki-products/xwiki-watch/trunk/pom.xml
Log:
XWATCH-118 Add an integration test that ensure Watch loads in the distribution
* Created a simple test that opens the reader and ensure it loads.
* Now distriution-test/ need to be added to the continuous integration profile
Added: xwiki-products/xwiki-watch/trunk/distribution-test/pom.xml
===================================================================
--- xwiki-products/xwiki-watch/trunk/distribution-test/pom.xml (rev 0)
+++ xwiki-products/xwiki-watch/trunk/distribution-test/pom.xml 2008-03-01 11:04:32 UTC (rev 8159)
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ *
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.xpn.xwiki.products</groupId>
+ <artifactId>xwiki-watch-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>xwiki-watch-test</artifactId>
+ <name>XWiki Products - Watch - Functional Tests</name>
+ <packaging>pom</packaging>
+ <description>XWiki Products - Watch - Functional Tests</description>
+ <dependencies>
+ <dependency>
+ <groupId>com.xpn.xwiki.platform.tools</groupId>
+ <artifactId>xwiki-shared-tests</artifactId>
+ <version>${platform.tool.test.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.xpn.xwiki.products</groupId>
+ <artifactId>xwiki-enterprise-test-selenium</artifactId>
+ <version>${product.enterprise.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <testSourceDirectory>src/test/it</testSourceDirectory>
+ <pluginManagement>
+ <plugins>
+ <!-- Force compilation of tests as the packaging being pom tests won't be compiled
+ with the default pom lifecycle -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Force copy of test resources file as the packaging being pom resource files won't
+ be copied with the default pom lifecycle -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <!--phase>process-test-resources</phase-->
+ <goals>
+ <goal>testResources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Create jar containing integration tests which will be installed -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Unpack the XWiki application -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unzip-application</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.xpn.xwiki.products</groupId>
+ <artifactId>xwiki-watch-distribution-${xwiki.db}</artifactId>
+ <version>${pom.version}</version>
+ <type>zip</type>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Start XWiki, Execute the tests and Stop XWiki.
+ Note: To execute a single test case run mvn install -Dpattern=<test name>
+ For example: mvn install -Dpattern=DeletePageTest
+ For example: mvn install -Dpattern=.*Wysiwyg.*
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <includes>
+ <include>**/AllTests.java</include>
+ </includes>
+ <systemProperties>
+ <property>
+ <name>pattern</name>
+ <value>${pattern}</value>
+ </property>
+ <property>
+ <name>xwikiPort</name>
+ <value>${port}</value>
+ </property>
+ <property>
+ <name>xwikiExecutionDirectory</name>
+ <value>${basedir}/target/xwiki-watch-distribution-${xwiki.db}-${pom.version}</value>
+ </property>
+ <property>
+ <name>xwikiExecutionStartCommand</name>
+ <value>${xwikiExecutionStartCommand}</value>
+ </property>
+ <property>
+ <name>xwikiExecutionStopCommand</name>
+ <value>${xwikiExecutionStopCommand}</value>
+ </property>
+ <property>
+ <name>debug</name>
+ <value>${debug}</value>
+ </property>
+ <!-- TODO: Find way to have maven merge properties and move this to the selenium-tests module -->
+ <property>
+ <name>browser</name>
+ <value>${browser}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <properties>
+ <!-- This is to allow users to override this property on the command line to choose what
+ test to run. For example to run only the DeletePageTest you would type:
+ mvn install -DPattern=DeletePageTest
+ -->
+ <pattern>.*</pattern>
+ <port>8080</port>
+ </properties>
+ <profiles>
+ <profile>
+ <id>unix</id>
+ <activation>
+ <os>
+ <family>unix</family>
+ </os>
+ </activation>
+ <properties>
+ <xwikiExecutionStartCommand>sh -f start_xwiki.sh ${port}</xwikiExecutionStartCommand>
+ <xwikiExecutionStopCommand>sh -f stop_xwiki.sh</xwikiExecutionStopCommand>
+ </properties>
+ </profile>
+ <profile>
+ <id>mac</id>
+ <activation>
+ <os>
+ <family>mac</family>
+ </os>
+ </activation>
+ <properties>
+ <xwikiExecutionStartCommand>sh -f start_xwiki.sh ${port}</xwikiExecutionStartCommand>
+ <xwikiExecutionStopCommand>sh -f stop_xwiki.sh</xwikiExecutionStopCommand>
+ </properties>
+ </profile>
+ <profile>
+ <id>windows</id>
+ <activation>
+ <os>
+ <family>windows</family>
+ </os>
+ </activation>
+ <properties>
+ <xwikiExecutionStartCommand>cmd /c start_xwiki.bat ${port}</xwikiExecutionStartCommand>
+ <xwikiExecutionStopCommand>cmd /c stop_xwiki.bat</xwikiExecutionStopCommand>
+ </properties>
+ </profile>
+ </profiles>
+ <modules>
+ <module>selenium-tests</module>
+ </modules>
+</project>
Added: xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/pom.xml
===================================================================
--- xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/pom.xml (rev 0)
+++ xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/pom.xml 2008-03-01 11:04:32 UTC (rev 8159)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ *
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.xpn.xwiki.products</groupId>
+ <artifactId>xwiki-watch-test</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>xwiki-watch-test-selenium</artifactId>
+ <name>XWiki Products - Watch - Functional Selenium Tests</name>
+ <packaging>pom</packaging>
+ <description>XWiki Products - Watch - Functional Selenium Tests</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.openqa.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ <version>0.9.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <!-- Step 1: Compile the JUnit Selenium Tests -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <!-- Step 2: Create jar containing integration tests which will be installed -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <!-- Step 3: Unpack the application -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <!-- Step 4: Start Selenium -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <version>1.0-beta-2</version>
+ <executions>
+ <execution>
+ <id>start-selenium</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start-server</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <background>true</background>
+ <multiWindow>true</multiWindow>
+ <port>4444</port>
+ </configuration>
+ </plugin>
+ <!-- Step 5: Start XWiki, Execute the tests and Stop XWiki -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>firefox</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <browser>*firefox</browser>
+ </properties>
+ </profile>
+ <profile>
+ <id>iexplore</id>
+ <properties>
+ <browser>*iexplore</browser>
+ </properties>
+ </profile>
+ <profile>
+ <id>konqueror</id>
+ <properties>
+ <browser>*konqueror</browser>
+ </properties>
+ </profile>
+ <profile>
+ <id>otherbrowser</id>
+ <properties>
+ <browser>*custom ${browserPath}</browser>
+ </properties>
+ </profile>
+ </profiles>
+ <repositories>
+ <repository>
+ <id>openqa.org</id>
+ <name>Openqa Repository</name>
+ <url>http://maven.openqa.org</url>
+ <layout>default</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ <checksumPolicy>ignore</checksumPolicy>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+</project>
Added: xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/AllTests.java
===================================================================
--- xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/AllTests.java (rev 0)
+++ xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/AllTests.java 2008-03-01 11:04:32 UTC (rev 8159)
@@ -0,0 +1,63 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package com.xpn.xwiki.watch.it.selenium;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.framework.TestCase;
+
+import java.lang.reflect.Method;
+
+import com.xpn.xwiki.test.XWikiTestSetup;
+
+/**
+ * A class listing all the Selenium Functional tests to execute. We need such a class (rather than
+ * letting the JUnit Runner discover the different TestCases classes by itself) because we want
+ * to start/stop XWiki before and after the tests start (but only once).
+ *
+ * @version $Id: $
+ */
+public class AllTests extends TestCase
+{
+ private static final String PATTERN = ".*" + System.getProperty("pattern", "");
+
+ public static Test suite() throws Exception
+ {
+ TestSuite suite = new TestSuite();
+
+ // TODO: I don't like listing tests here as it means we can add a new TestCase class and
+ // forget to add it here and the tests won't be run but we'll not know about it and we'll
+ // think the tests are all running fine. I haven't found a simple solution to this yet
+ // (there are complex solutions like searching for all tests by parsing the source tree).
+ // I think there are TestSuite that do this out there but I haven't looked for them yet.
+ addTestCase(suite, WatchGWTLoadingTest.class);
+
+ return new XWikiTestSetup(suite);
+ }
+
+ private static void addTestCase(TestSuite suite, Class testClass) throws Exception
+ {
+ if (testClass.getName().matches(PATTERN)) {
+ Method method = testClass.getMethod("suite", null);
+ suite.addTest((Test) method.invoke(null, null));
+ }
+ }
+
+}
Added: xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/WatchGWTLoadingTest.java
===================================================================
--- xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/WatchGWTLoadingTest.java (rev 0)
+++ xwiki-products/xwiki-watch/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/watch/it/selenium/WatchGWTLoadingTest.java 2008-03-01 11:04:32 UTC (rev 8159)
@@ -0,0 +1,55 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package com.xpn.xwiki.watch.it.selenium;
+
+import com.xpn.xwiki.it.selenium.framework.AbstractXWikiTestCase;
+import com.xpn.xwiki.it.selenium.framework.AlbatrossSkinExecutor;
+import com.xpn.xwiki.it.selenium.framework.XWikiTestSuite;
+
+import junit.framework.Test;
+
+/**
+ * Verify the GWT Reader loads in Watch
+ *
+ * @version $Id: $
+ */
+public class WatchGWTLoadingTest extends AbstractXWikiTestCase
+{
+ public static Test suite()
+ {
+ XWikiTestSuite suite =
+ new XWikiTestSuite("Verify the GWT Reader loads in Watch");
+ suite.addTestSuite(WatchGWTLoadingTest.class, AlbatrossSkinExecutor.class);
+ return suite;
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ loginAsAdmin();
+ }
+
+ public void testGWTLoading()
+ {
+ open("/xwiki/bin/view/Watch/Reader");
+ getSelenium().waitForPageToLoad("20000");
+ assertTextPresent("Welcome to XWiki Watch");
+ }
+}
Modified: xwiki-products/xwiki-watch/trunk/pom.xml
===================================================================
--- xwiki-products/xwiki-watch/trunk/pom.xml 2008-02-29 22:19:39 UTC (rev 8158)
+++ xwiki-products/xwiki-watch/trunk/pom.xml 2008-03-01 11:04:32 UTC (rev 8159)
@@ -49,6 +49,7 @@
<platform.tool.jetty.version>1.10-SNAPSHOT</platform.tool.jetty.version>
<platform.tool.packager.version>1.10-SNAPSHOT</platform.tool.packager.version>
<platform.tool.xmldoc.version>1.1-SNAPSHOT</platform.tool.xmldoc.version>
+ <platform.tool.test.version>1.9-SNAPSHOT</platform.tool.test.version>
<platform.core.version>1.4-SNAPSHOT</platform.core.version>
<platform.web.version>1.4-SNAPSHOT</platform.web.version>
<product.enterprise.version>1.4-SNAPSHOT</product.enterprise.version>
More information about the notifications
mailing list