geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pra...@apache.org
Subject svn commit: r484700 - in /geronimo/server/trunk: testsuite/ testsuite/console-testsuite/ testsuite/console-testsuite/basic/ testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/ testsuite/deployment-testsuite/ testsuite...
Date Fri, 08 Dec 2006 19:14:30 GMT
Author: prasad
Date: Fri Dec  8 11:14:25 2006
New Revision: 484700

URL: http://svn.apache.org/viewvc?view=rev&rev=484700
Log:
* moved ExtendedSelenium and SeleniumSupport to TestSupport
* it took along with it the TestNG dependency.
* TestNG dependency no longer needs to be specified in testsuite poms.

Added:
    geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/ExtendedSelenium.java
  (with props)
    geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
  (with props)
Removed:
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/ExtendedSelenium.java
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SeleniumTestSupport.java
    geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/ExtendedSelenium.java
    geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/SeleniumTestSupport.java
Modified:
    geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/ConsoleTestSupport.java
    geronimo/server/trunk/testsuite/console-testsuite/pom.xml
    geronimo/server/trunk/testsuite/deployment-testsuite/pom.xml
    geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/pom.xml
    geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear13Test.java
    geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear14Test.java
    geronimo/server/trunk/testsuite/pom.xml
    geronimo/server/trunk/testsupport/testsupport-common/pom.xml

Modified: geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml (original)
+++ geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml Fri Dec  8 11:14:25 2006
@@ -43,15 +43,6 @@
         executes the 'child' profile.i
     </description>
 
-    <dependencies>
-        <dependency>
-            <groupId>org.testng</groupId>
-            <artifactId>testng</artifactId>
-            <classifier>jdk15</classifier>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-    
     <profiles>
         <profile>
             <id>child</id>

Modified: geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/ConsoleTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/ConsoleTestSupport.java?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/ConsoleTestSupport.java
(original)
+++ geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/ConsoleTestSupport.java
Fri Dec  8 11:14:25 2006
@@ -19,6 +19,8 @@
 
 package org.apache.geronimo.testsuite.console;
 
+import org.apache.geronimo.testsupport.SeleniumTestSupport;
+
 /**
  * ???
  *

Modified: geronimo/server/trunk/testsuite/console-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/console-testsuite/pom.xml?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsuite/console-testsuite/pom.xml (original)
+++ geronimo/server/trunk/testsuite/console-testsuite/pom.xml Fri Dec  8 11:14:25 2006
@@ -39,18 +39,6 @@
         Geronimo console testsuite.
     </description>
     
-    <dependencies>
-        <dependency>
-            <groupId>org.openqa.selenium.client-drivers</groupId>
-            <artifactId>selenium-java-client-driver</artifactId>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.openqa.selenium.server</groupId>
-            <artifactId>selenium-server</artifactId>
-        </dependency>
-    </dependencies>
-
     <!-- FIXME : a better idea would be to get the container name from the installed assembly
or running server -->
     <properties>
       <container>jetty6</container>

Modified: geronimo/server/trunk/testsuite/deployment-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/deployment-testsuite/pom.xml?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsuite/deployment-testsuite/pom.xml (original)
+++ geronimo/server/trunk/testsuite/deployment-testsuite/pom.xml Fri Dec  8 11:14:25 2006
@@ -39,20 +39,6 @@
         Geronimo deployment testsuite.
     </description>
     
-    <dependencies>
-        <dependency>
-            <groupId>org.openqa.selenium.client-drivers</groupId>
-            <artifactId>selenium-java-client-driver</artifactId>
-            <scope>test</scope>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.openqa.selenium.server</groupId>
-            <artifactId>selenium-server</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-    
     <build>
         <plugins>
             <plugin>

Modified: geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/pom.xml?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/pom.xml (original)
+++ geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/pom.xml Fri Dec
 8 11:14:25 2006
@@ -42,14 +42,6 @@
         Since build executions are done here, a 'child' profile is explicitly defined here
to prevent inheriting other configurations and executions from parent.
     </description>
 
-    <dependencies>
-        <dependency>
-            <groupId>org.testng</groupId>
-            <artifactId>testng</artifactId>
-            <classifier>jdk15</classifier>
-        </dependency>
-    </dependencies>
-    
     <profiles>
         <profile>
             <id>child</id>

Modified: geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear13Test.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear13Test.java?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear13Test.java
(original)
+++ geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear13Test.java
Fri Dec  8 11:14:25 2006
@@ -18,6 +18,8 @@
  */
 
 package org.apache.geronimo.testsuite.deployment;
+
+import org.apache.geronimo.testsupport.SeleniumTestSupport;
 import org.testng.annotations.Test;
 
 /**

Modified: geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear14Test.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear14Test.java?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear14Test.java
(original)
+++ geronimo/server/trunk/testsuite/deployment-testsuite/test-deployments/src/test/java/org/apache/geronimo/testsuite/deployment/Ear14Test.java
Fri Dec  8 11:14:25 2006
@@ -19,6 +19,7 @@
 
 package org.apache.geronimo.testsuite.deployment;
 
+import org.apache.geronimo.testsupport.SeleniumTestSupport;
 import org.testng.annotations.Test;
 
 /**

Modified: geronimo/server/trunk/testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/pom.xml?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsuite/pom.xml (original)
+++ geronimo/server/trunk/testsuite/pom.xml Fri Dec  8 11:14:25 2006
@@ -49,31 +49,11 @@
 
     <dependencyManagement>
         <dependencies>
+          <!-- testsupport-common brings with it selenium and testng dependencies -->
             <dependency>
                 <groupId>org.apache.geronimo.testsupport</groupId>
                 <artifactId>testsupport-common</artifactId>
-                <scope>test</scope>
                 <version>${version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.testng</groupId>
-                <artifactId>testng</artifactId>
-                <classifier>jdk15</classifier>
-                <version>5.1</version>
-                <scope>test</scope>
-            </dependency>
-
-            <dependency>
-                <groupId>org.openqa.selenium.client-drivers</groupId>
-                <artifactId>selenium-java-client-driver</artifactId>
-                <version>0.8.1</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.openqa.selenium.server</groupId>
-                <artifactId>selenium-server</artifactId>
-                <version>0.8.1</version>
             </dependency>
         </dependencies>
     </dependencyManagement>

Modified: geronimo/server/trunk/testsupport/testsupport-common/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/testsupport-common/pom.xml?view=diff&rev=484700&r1=484699&r2=484700
==============================================================================
--- geronimo/server/trunk/testsupport/testsupport-common/pom.xml (original)
+++ geronimo/server/trunk/testsupport/testsupport-common/pom.xml Fri Dec  8 11:14:25 2006
@@ -17,11 +17,8 @@
     specific language governing permissions and limitations
     under the License.
 -->
-
 <!-- $Rev$ $Date$ -->
-
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
     <modelVersion>4.0.0</modelVersion>
     
     <parent>
@@ -67,6 +64,23 @@
             <artifactId>stax-api</artifactId>
         </dependency>
 
+        <!-- selenium -->
+        <dependency>
+            <groupId>org.openqa.selenium.client-drivers</groupId>
+            <artifactId>selenium-java-client-driver</artifactId>
+            <version>0.8.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openqa.selenium.server</groupId>
+            <artifactId>selenium-server</artifactId>
+            <version>0.8.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <classifier>jdk15</classifier>
+            <version>5.1</version>
+        </dependency>
     </dependencies>
     
 </project>

Added: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/ExtendedSelenium.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/ExtendedSelenium.java?view=auto&rev=484700
==============================================================================
--- geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/ExtendedSelenium.java
(added)
+++ geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/ExtendedSelenium.java
Fri Dec  8 11:14:25 2006
@@ -0,0 +1,51 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.geronimo.testsupport;
+
+import com.thoughtworks.selenium.Selenium;
+import com.thoughtworks.selenium.DefaultSelenium;
+
+import org.openqa.selenium.server.SeleniumServer;
+
+/**
+ * Provides custom extentions to Selenium.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ExtendedSelenium
+    extends DefaultSelenium
+{
+    public ExtendedSelenium(final String serverHost, final int serverPort, final String browserStartCommand,
final String browserURL) {
+        super(serverHost, serverPort, browserStartCommand, browserURL);
+    }
+    
+    /**
+     * Remove a cookie from the browser.
+     *
+     * <p>
+     * This requires some custom hooks in <tt>user-extensions.js</tt>.  
+     * When using the <tt>selenium-maven-plugin</tt> the defaults should be merged
+     * into the <tt>user-extensions.js</tt> which is loaded by the server.
+     * </p>
+     */
+    public void removeCookie(final String name, final String path) {
+        this.getEval("selenium.removeCookie('" + name + "', '" + path + "')");
+    }
+}

Propchange: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/ExtendedSelenium.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/ExtendedSelenium.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/ExtendedSelenium.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java?view=auto&rev=484700
==============================================================================
--- geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
(added)
+++ geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
Fri Dec  8 11:14:25 2006
@@ -0,0 +1,90 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.geronimo.testsupport;
+
+import com.thoughtworks.selenium.Selenium;
+
+import org.openqa.selenium.server.SeleniumServer;
+
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.AfterSuite;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public class SeleniumTestSupport
+    extends TestSupport
+{
+    protected static ExtendedSelenium selenium;
+    
+    protected ExtendedSelenium createSeleniumClient(String url) throws Exception {
+        super.setUp();
+        
+        if (url == null) {
+            url = "http://localhost:" + SeleniumServer.DEFAULT_PORT;
+        }
+        
+        log.info("Creating Selenium client for URL: " + url);
+        
+        ExtendedSelenium selenium = new ExtendedSelenium(
+            "localhost", SeleniumServer.DEFAULT_PORT, "*firefox", url);
+        
+        return selenium;
+    }
+    
+    @BeforeSuite
+    protected void startSeleniumClient() throws Exception {
+        log.info("Starting Selenium client");
+        
+        selenium = createSeleniumClient("http://localhost:8080/");
+        selenium.start();
+    }
+    
+    @AfterSuite
+    protected void stopSeleniumClient() throws Exception {
+        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");
+        
+        selenium.stop();
+    }
+     */
+}
+

Propchange: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/SeleniumTestSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message