continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r793141 - in /continuum/trunk/continuum-webapp-test: ./ src/test/resources/ src/test/testng/org/apache/continuum/web/test/ src/test/testng/org/apache/continuum/web/test/parent/
Date Fri, 10 Jul 2009 23:05:49 GMT
Author: carlos
Date: Fri Jul 10 23:05:48 2009
New Revision: 793141

URL: http://svn.apache.org/viewvc?rev=793141&view=rev
Log:
Enable overriding the baseUrl

Modified:
    continuum/trunk/continuum-webapp-test/Readme.txt
    continuum/trunk/continuum-webapp-test/pom.xml
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SetupSelenium.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java

Modified: continuum/trunk/continuum-webapp-test/Readme.txt
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/Readme.txt?rev=793141&r1=793140&r2=793141&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/Readme.txt (original)
+++ continuum/trunk/continuum-webapp-test/Readme.txt Fri Jul 10 23:05:48 2009
@@ -12,17 +12,14 @@
  * mvn clean install
 
 Run Selenium tests against an existing Continuum instance
-  * modify src/test/resources/testng.properties as needed
-  * mvn clean install -Dexisting-container
+  * mvn clean install -DbaseUrl=http://localhost:9595/continuum
 
   (This skips the Cargo plugin configuration that starts a container with the Continuum webapp
deployed)
 
 Run Selenium tests in an alternate browser
-  * modify src/test/resources/testng.properties as needed
   * mvn clean install -Dbrowser=iexplore  (or -Dbrowser=safari or -Dbrowser=other -DbrowserPath=/path/to/browser)
 
 Run Selenium tests in an running Selenium server or hub
-  * modify src/test/resources/testng.properties as needed
   * mvn clean install -DseleniumHost=localhost -DseleniumPort=4444
 
 Run Selenium tests in src/test/it with Maven, JUnit and Cargo

Modified: continuum/trunk/continuum-webapp-test/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/pom.xml?rev=793141&r1=793140&r2=793141&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/pom.xml (original)
+++ continuum/trunk/continuum-webapp-test/pom.xml Fri Jul 10 23:05:48 2009
@@ -84,6 +84,10 @@
             <configuration>
               <systemProperties>
                 <property>
+                  <name>baseUrl</name>
+                  <value>${baseUrl}</value>
+                </property>
+                <property>
                   <name>browser</name>
                   <value>${browser}</value>
                 </property>
@@ -324,11 +328,12 @@
       <id>existing-container</id>
       <activation>
         <property>
-          <name>container</name>
-          <value>existing</value>
+          <name>!baseUrl</name>
         </property>
       </activation>
-      <!-- edit src/test/resources/it.properties as needed -->
+      <properties>
+        <baseUrl>http://localhost:9595/continuum</baseUrl>
+      </properties>
     </profile>
     <profile>
       <id>firefox</id>

Modified: continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties?rev=793141&r1=793140&r2=793141&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Fri Jul 10
23:05:48 2009
@@ -4,7 +4,6 @@
 # General properties
 #######################
 
-BASE_URL=http://localhost:9595/continuum/
 MAX_WAIT_TIME_IN_MS=60000
 
 ADMIN_USERNAME=admin

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SetupSelenium.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SetupSelenium.java?rev=793141&r1=793140&r2=793141&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SetupSelenium.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SetupSelenium.java
Fri Jul 10 23:05:48 2009
@@ -55,14 +55,12 @@
     }
 
     @BeforeTest
-    @Parameters( { "browser", "seleniumHost", "seleniumPort" } )
-    public void initializeContinuum( String browser, @Optional( "localhost" ) String seleniumHost,
+    @Parameters( { "baseUrl", "browser", "seleniumHost", "seleniumPort" } )
+    public void initializeContinuum( String baseUrl, String browser, @Optional( "localhost"
) String seleniumHost,
                                      @Optional( "4444" ) int seleniumPort )
         throws Exception
     {
-        System.out.println( this.getClass().getName() + " initializeContinuum" );
-
-        super.open( browser, seleniumHost, seleniumPort );
+        super.open( baseUrl, browser, seleniumHost, seleniumPort );
         Assert.assertNotNull( getSelenium(), "Selenium is not initialized" );
         getSelenium().open( baseUrl );
         String title = getSelenium().getTitle();

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java?rev=793141&r1=793140&r2=793141&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
Fri Jul 10 23:05:48 2009
@@ -51,10 +51,6 @@
 
     private static Properties p;
 
-    private static String seleniumHost;
-
-    private static int seleniumPort;
-
     private final static String PROPERTIES_SEPARATOR = "=";
 
     /**
@@ -63,21 +59,20 @@
     public void open()
         throws Exception
     {
-        System.out.println( this.getClass().getName() + " open" );
         InputStream input = this.getClass().getClassLoader().getResourceAsStream( "testng.properties"
);
         p = new Properties();
         p.load( input );
 
-        baseUrl = getProperty( "BASE_URL" );
         maxWaitTimeInMs = getProperty( "MAX_WAIT_TIME_IN_MS" );
     }
 
     /**
      * Initialize selenium
      */
-    public void open( String browser, String seleniumHost, int seleniumPort )
+    public void open( String baseUrl, String browser, String seleniumHost, int seleniumPort
)
         throws Exception
     {
+        this.baseUrl = baseUrl;
         if ( getSelenium() == null )
         {
             final Selenium s = new DefaultSelenium( seleniumHost, seleniumPort, browser,
baseUrl );
@@ -134,8 +129,6 @@
     public void close()
         throws Exception
     {
-        System.out.println(this.getClass().getName() + " close");
-
         if ( getSelenium() != null )
         {
             getSelenium().stop();



Mime
View raw message