You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ws...@apache.org on 2009/05/02 03:59:44 UTC

svn commit: r770871 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test: src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java testng-pom.xml

Author: wsmoak
Date: Sat May  2 00:38:38 2009
New Revision: 770871

URL: http://svn.apache.org/viewvc?rev=770871&view=rev
Log:
[MRM-1164] Allow command line configuration of which browser to use, for example -Dbrowser=iexplore

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java?rev=770871&r1=770870&r2=770871&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java Sat May  2 00:38:38 2009
@@ -26,6 +26,8 @@
 import java.util.Properties;
 import java.util.Map.Entry;
 
+import org.codehaus.plexus.util.StringUtils;
+
 import org.testng.Assert;
 import com.thoughtworks.selenium.DefaultSelenium;
 import com.thoughtworks.selenium.Selenium;
@@ -56,7 +58,13 @@
 	
 	    String seleniumHost	= p.getProperty( "SELENIUM_HOST" );
 	    int seleniumPort = Integer.parseInt( ( p.getProperty( "SELENIUM_PORT" ) ) );
-	    String seleniumBrowser = p.getProperty( "SELENIUM_BROWSER" );
+
+        String seleniumBrowser = System.getProperty( "browser" );
+        if ( StringUtils.isEmpty( seleniumBrowser ) )
+        {
+            seleniumBrowser = p.getProperty( "SELENIUM_BROWSER" );
+        }
+
 	    final Selenium s = new DefaultSelenium( seleniumHost, seleniumPort, seleniumBrowser, baseUrl );
 	    selenium = new ThreadLocal<Selenium>()
 	    {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml?rev=770871&r1=770870&r2=770871&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml Sat May  2 00:38:38 2009
@@ -172,6 +172,14 @@
             <goals>
               <goal>test</goal>
             </goals>
+            <configuration>
+              <systemProperties>
+                <property>
+                  <name>browser</name>
+                  <value>${selenium.browser}</value>
+                </property>
+              </systemProperties>
+            </configuration>
           </execution>
         </executions>
       </plugin>
@@ -364,22 +372,48 @@
     <profile>
       <id>firefox</id>
       <activation>
-        <activeByDefault>true</activeByDefault>
+        <property>
+          <name>!browser</name>
+        </property>
       </activation>
       <properties>
-        <browser>*firefox</browser>
+        <selenium.browser>*firefox</selenium.browser>
       </properties>
     </profile>
     <profile>
       <id>iexplore</id>
+      <activation>
+        <property>
+          <name>browser</name>
+          <value>iexplore</value>
+        </property>
+      </activation>
+      <properties>
+        <selenium.browser>*iexplore</selenium.browser>
+      </properties>
+    </profile>
+    <profile>
+      <id>safari</id>
+      <activation>
+        <property>
+          <name>browser</name>
+          <value>safari</value>
+        </property>
+      </activation>
       <properties>
-        <browser>*iexplore</browser>
+        <selenium.browser>*safari</selenium.browser>
       </properties>
     </profile>
     <profile>
       <id>otherbrowser</id>
+      <activation>
+        <property>
+          <name>browser</name>
+          <value>other</value>
+        </property>
+      </activation>
       <properties>
-        <browser>*custom ${browserPath}</browser>
+        <selenium.browser>*custom ${browserPath}</selenium.browser>
       </properties>
     </profile>
   </profiles>