Author: konstantin.mishin
Date: 2008-12-08 13:18:38 -0500 (Mon, 08 Dec 2008)
New Revision: 11653
Added:
trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/
trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/testng.xml
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.xml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
Modified: trunk/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-08 17:36:50 UTC (rev
11652)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-08 18:18:38 UTC (rev
11653)
@@ -15,76 +15,121 @@
<version>3.3.0-SNAPSHOT</version>
<build>
<finalName>richfaces</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <!-- Skip the normal tests, we'll run them in the integration-test phase
-->
- <skip>true</skip>
- <suiteXmlFiles>
- <!--suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_all_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_all_tidy.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_all_neko.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
- </suiteXmlFile-->
- <suiteXmlFile>
- src/test/testng/win/local_testng.xml
- </suiteXmlFile>
- </suiteXmlFiles>
- <properties>
- <property>
- <name>listener</name>
- <value>org.richfaces.TestAnnotationTransformer</value>
- </property>
- </properties>
- </configuration>
- <executions>
- <execution>
- <phase>integration-test</phase>
- <goals>
- <!--goal>test</goal-->
- </goals>
+ </build>
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
<configuration>
- <skip>false</skip>
+ <!-- Skip the normal tests, we'll run them in the integration-test phase
-->
+ <skip>true</skip>
+ <suiteXmlFiles>
+ <!--suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_tidy.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_neko.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
+ </suiteXmlFile-->
+ <suiteXmlFile>
+ src/test/testng/win/local_testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.richfaces.TestAnnotationTransformer</value>
+ </property>
+ </properties>
</configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <!--goal>test</goal-->
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>hudson</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <!-- Skip the normal tests, we'll run them in the integration-test phase
-->
+ <skip>true</skip>
+ <suiteXmlFiles>
+ <suiteXmlFile>
+ src/test/testng/hudson/testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.richfaces.TestAnnotationTransformer</value>
+ </property>
+ </properties>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
<repositories>
<repository>
<releases>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08
17:36:50 UTC (rev 11652)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08
18:18:38 UTC (rev 11653)
@@ -141,38 +141,12 @@
@BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
- if ("*firefox".equals(browser)) {
- File[] libs = {new File("/usr/lib"), new File("/usr/lib64")};
- for (int i = 0; i < libs.length && "*firefox".equals(browser);
i++) {
- File lib = libs[i];
- if (lib.isDirectory()) {
- System.out.println("---->lib#" + i + ": " + lib.getPath());
- File[] firefoxDirs = lib.listFiles(new FileFilter() {
- public boolean accept(File pathname) {
- return pathname != null&&
pathname.getName().startsWith("firefox")
- && pathname.isDirectory();
- }
- });
- for (int j = firefoxDirs.length - 1; j >= 0 &&
"*firefox".equals(browser); j--) {
- System.out.println("------>firefoxDir#" + j + ": " +
firefoxDirs[j].getPath());
- File[] firefoxes = firefoxDirs[j].listFiles(new FileFilter() {
- public boolean accept(File pathname) {
- boolean result = false;
- if (pathname != null && pathname.isFile()) {
- String name = pathname.getName();
- result = "firefox".equals(name) ||
"firefox-bin".equals(name);
- }
- return result;
- }
- });
- for (int k = firefoxes.length - 1; k >= 0 &&
"*firefox".equals(browser); k--) {
- System.out.println("-------->firefoxes#" + k + ": " +
firefoxes[k].getPath());
- browser += " " + firefoxes[k].getPath();
- }
- }
- }
- }
- }
+ if ("*firefox".equals(browser)) {
+ String firefox = findFirefox();
+ if (firefox != null) {
+ browser = findFirefox();
+ }
+ }
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
selenium = createSeleniumClient(protocol + "://" + host +
":" + port + "/", browser);
@@ -181,6 +155,41 @@
selenium.allowNativeXpath("false");
}
}
+
+ private String findFirefox() {
+ String browser = null;
+ File[] libs = {new File("/usr/lib"), new File("/usr/lib64")};
+ for (int i = 0; browser == null && i < libs.length; i++) {
+ File lib = libs[i];
+ if (lib.isDirectory()) {
+ System.out.println("---->lib#" + i + ": " + lib.getPath());
+ File[] firefoxDirs = lib.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname != null&&
pathname.getName().startsWith("firefox")
+ && pathname.isDirectory();
+ }
+ });
+ for (int j = firefoxDirs.length - 1; browser == null && j >= 0; j--) {
+ System.out.println("------>firefoxDir#" + j + ": " +
firefoxDirs[j].getPath());
+ File[] firefoxes = firefoxDirs[j].listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ boolean result = false;
+ if (pathname != null && pathname.isFile()) {
+ String name = pathname.getName();
+ result = "firefox".equals(name) ||
"firefox-bin".equals(name);
+ }
+ return result;
+ }
+ });
+ for (int k = firefoxes.length - 1; browser == null && k >= 0; k--) {
+ System.out.println("-------->firefox#" + k + ": " +
firefoxes[k].getPath());
+ browser = "*firefox " + firefoxes[k].getPath();
+ }
+ }
+ }
+ }
+ return browser;
+ }
private void setFileExtensionContent() {
try {
Added: trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/testng.xml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/testng.xml 2008-12-08
18:18:38 UTC (rev 11653)
@@ -0,0 +1,111 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestAANe">
+ <test name="all_all_neko">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_all_none">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_all_tidy">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_default_neko">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_default_none">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_default_tidy">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_all_neko">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_all_none">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_all_tidy">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_default_neko">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_default_none">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_default_tidy">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>