continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r743586 - in /continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test: AbstractContinuumTestCase.java AbstractSeleniumTestCase.java
Date Thu, 12 Feb 2009 01:28:38 GMT
Author: wsmoak
Date: Thu Feb 12 01:28:38 2009
New Revision: 743586

URL: http://svn.apache.org/viewvc?rev=743586&view=rev
Log:
[CONTINUUM-2073] Load userid, password, host, port and base url from the it.properties file.

Modified:
    continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
    continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractSeleniumTestCase.java

Modified: continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java?rev=743586&r1=743585&r2=743586&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
Thu Feb 12 01:28:38 2009
@@ -24,7 +24,6 @@
 public abstract class AbstractContinuumTestCase
     extends AbstractSeleniumTestCase
 {
-    private String baseUrl = "http://localhost:9595/continuum";
 
     public final static String DEFAULT_PROJ_GRP_NAME = "Default Project Group";
 

Modified: continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractSeleniumTestCase.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractSeleniumTestCase.java?rev=743586&r1=743585&r2=743586&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractSeleniumTestCase.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractSeleniumTestCase.java
Thu Feb 12 01:28:38 2009
@@ -29,6 +29,7 @@
 import java.util.Calendar;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Properties;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -43,25 +44,41 @@
 
     private Selenium sel;
 
-    protected String adminUsername = "admin";
+    protected String adminUsername;
 
-    protected String adminPassword = "admin1";
+    protected String adminPassword;
 
     protected String adminFullName = getApplicationName() + " Admin";
 
     protected String adminEmail = "admin@localhost.localdomain";
 
+    protected String maxWaitTimeInMs;
+
+    protected String baseUrl;
+
     public void setUp()
         throws Exception
     {
         super.setUp();
+
+        Properties p = new Properties();
+        p.load ( this.getClass().getClassLoader().getResourceAsStream( "it.properties" )
);
+
+        baseUrl = p.getProperty( "BASE_URL" );
+        maxWaitTimeInMs = p.getProperty( "MAX_WAIT_TIME_IN_MS" );
+        adminUsername = p.getProperty( "ADMIN_USERNAME" );
+        adminPassword = p.getProperty( "ADMIN_PASSWORD" );
+        
+        String seleniumHost = p.getProperty( "SELENIUM_HOST" );
+        int seleniumPort = Integer.parseInt( (p.getProperty( "SELENIUM_PORT" ) ) );
+
         String browser = System.getProperty( "browser" );
         if ( StringUtils.isEmpty( browser ) )
         {
-            browser = "*firefox";
+            browser = p.getProperty( "SELENIUM_BROWSER" );
         }
 
-        sel = new DefaultSelenium( "localhost", SeleniumServer.DEFAULT_PORT, browser, getBaseUrl()
);
+        sel = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl );
         sel.start();
         initialize();
     }



Mime
View raw message