geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r725719 - in /geronimo/server/branches/2.0/testsupport/testsupport-selenium: pom.xml src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java
Date Thu, 11 Dec 2008 15:51:04 GMT
Author: dwoods
Date: Thu Dec 11 07:51:04 2008
New Revision: 725719

URL: http://svn.apache.org/viewvc?rev=725719&view=rev
Log:
fix openqa repo refs and upgrade to 1.0-beta-1 artifacts and required updates from branches/2.1

Modified:
    geronimo/server/branches/2.0/testsupport/testsupport-selenium/pom.xml
    geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
    geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java

Modified: geronimo/server/branches/2.0/testsupport/testsupport-selenium/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/testsupport/testsupport-selenium/pom.xml?rev=725719&r1=725718&r2=725719&view=diff
==============================================================================
--- geronimo/server/branches/2.0/testsupport/testsupport-selenium/pom.xml (original)
+++ geronimo/server/branches/2.0/testsupport/testsupport-selenium/pom.xml Thu Dec 11 07:51:04
2008
@@ -50,12 +50,12 @@
         <dependency>
             <groupId>org.openqa.selenium.client-drivers</groupId>
             <artifactId>selenium-java-client-driver</artifactId>
-            <version>0.8.1</version>
+            <version>1.0-beta-1</version>
         </dependency>
         <dependency>
             <groupId>org.openqa.selenium.server</groupId>
             <artifactId>selenium-server</artifactId>
-            <version>0.8.1</version>
+            <version>1.0-beta-1</version>
         </dependency>
         <dependency>
             <groupId>org.testng</groupId>
@@ -71,9 +71,21 @@
     -->
     <repositories>
         <repository>
-            <id>openqa</id>
-            <name>OpenQA Repository</name>
-            <url>http://maven.openqa.org</url>
+            <id>releases.openqa.org</id>
+            <name>OpenQA Release Repository</name>
+            <url>http://archiva.openqa.org/repository/releases</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+        <repository>
+            <id>snapshots.openqa.org</id>
+            <name>Openqa Snapshot Repository</name>
+            <url>http://archiva.openqa.org/repository/snapshots</url>
             <layout>default</layout>
             <snapshots>
                 <enabled>true</enabled>
@@ -81,9 +93,9 @@
                 <checksumPolicy>ignore</checksumPolicy>
             </snapshots>
             <releases>
-                <enabled>true</enabled>
+                <enabled>false</enabled>
             </releases>
         </repository>
     </repositories>
     
-</project>
\ No newline at end of file
+</project>

Modified: geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java?rev=725719&r1=725718&r2=725719&view=diff
==============================================================================
--- geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
(original)
+++ geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
Thu Dec 11 07:51:04 2008
@@ -29,7 +29,7 @@
 import org.testng.annotations.AfterSuite;
 
 /**
- * ???
+ * Provides support for Selenium test cases.
  *
  * @version $Rev$ $Date$
  */
@@ -42,19 +42,29 @@
         super.setUp();
         
         if (url == null) {
-            url = "http://localhost:" + SeleniumServer.DEFAULT_PORT;
+            // url = "http://localhost:" + SeleniumServer.DEFAULT_PORT;
+            // post 1.0-beta-1 builds don't define DEFAULT_PORT
+            url = "http://localhost:4444";
         }
         
-        log.info("Creating Selenium client for URL: " + url);
+        String browser = System.getProperty("browser", "*firefox");
         
-        ExtendedSelenium selenium = new ExtendedSelenium(
-            "localhost", SeleniumServer.DEFAULT_PORT, "*firefox", url);
+        log.info("Creating Selenium client for URL: " + url + ", Browser: " + browser);
+        
+        //ExtendedSelenium selenium = new ExtendedSelenium("localhost", SeleniumServer.DEFAULT_PORT,
"*firefox", url);
+        ExtendedSelenium selenium = new ExtendedSelenium("localhost", 4444, browser, url);
         
         return selenium;
     }
     
+    protected void ensureSeleniumClientInitialized() {
+        if (selenium == null) {
+            throw new IllegalStateException("Selenium client was not initalized");
+        }
+    }
+    
     @BeforeSuite
-    protected void startSeleniumClient() throws Exception {
+    protected synchronized void startSeleniumClient() throws Exception {
         log.info("Starting Selenium client");
         
         selenium = createSeleniumClient("http://localhost:8080/");
@@ -62,31 +72,18 @@
     }
     
     @AfterSuite
-    protected void stopSeleniumClient() throws Exception {
+    protected synchronized void stopSeleniumClient() throws Exception {
+        ensureSeleniumClientInitialized();
+        
         log.info("Stopping Selenium client");
         
         selenium.stop();
     }
-
-    /**
-     * junit's per class setup.
-     * 
-    protected void setUp() throws Exception {
-        log.info("Starting Selenium client");
-        
-        selenium = createSeleniumClient("http://localhost:8080/");
-        selenium.start();
-    }
-     */
     
-    /**
-     * junit's per class teardown.
-     * 
-    protected void tearDown() throws Exception {
-        log.info("Stopping Selenium client");
+    protected void waitForPageLoad() throws Exception {
+        ensureSeleniumClientInitialized();
         
-        selenium.stop();
+        selenium.waitForPageToLoad("30000");
     }
-     */
 }
 

Modified: geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java?rev=725719&r1=725718&r2=725719&view=diff
==============================================================================
--- geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java
(original)
+++ geronimo/server/branches/2.0/testsupport/testsupport-selenium/src/main/java/org/apache/geronimo/testsupport/console/ConsoleTestSupport.java
Thu Dec 11 07:51:04 2008
@@ -22,7 +22,7 @@
 import org.apache.geronimo.testsupport.SeleniumTestSupport;
 
 /**
- * ???
+ * Provides support for console-related tests.
  *
  * @version $Rev$ $Date$
  */
@@ -31,23 +31,26 @@
 {
     protected void login() throws Exception {
         selenium.open("/");
-        selenium.waitForPageToLoad("30000");
+        waitForPageLoad();
+        
         assertEquals("Apache Geronimo", selenium.getTitle());
         
         selenium.click("link=Console");
-        selenium.waitForPageToLoad("30000");
+        waitForPageLoad();
+        
         assertEquals("Geronimo Console Login", selenium.getTitle());
         
         selenium.type("j_username", "system");
         selenium.type("j_password", "manager");
         selenium.click("submit");
-        selenium.waitForPageToLoad("30000");
+        waitForPageLoad();
         assertEquals("Geronimo Console", selenium.getTitle());
     }
     
     protected void logout() throws Exception {
         selenium.click("//a[contains(@href, '/console/logout.jsp')]");
-        selenium.waitForPageToLoad("30000");
+        waitForPageLoad();
+        
         assertEquals("Geronimo Console Login", selenium.getTitle());
         
         //selenium.removeCookie("JSESSIONID", "/");



Mime
View raw message