You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/09/02 03:26:34 UTC

svn commit: r439522 - in /geronimo/server/trunk/testsuite: ./ console-testsuite/ console-testsuite/basic/ console-testsuite/basic/src/ console-testsuite/basic/src/test/ console-testsuite/basic/src/test/java/ console-testsuite/basic/src/test/java/org/ c...

Author: jdillon
Date: Fri Sep  1 18:26:33 2006
New Revision: 439522

URL: http://svn.apache.org/viewvc?rev=439522&view=rev
Log:
Start of the Geronimo integration testsuite
Uses the server plugin to start/stop the server and the selenium plugin to start the selenium server
Some crude tests of the webconsole in SimpleLoginTest to show how Selenium works... needs Firefox, works on mac osx, might need additional magic for other os... not sure

Added:
    geronimo/server/trunk/testsuite/
    geronimo/server/trunk/testsuite/console-testsuite/
    geronimo/server/trunk/testsuite/console-testsuite/basic/
    geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml   (with props)
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/
    geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java   (with props)
    geronimo/server/trunk/testsuite/console-testsuite/pom.xml   (with props)
    geronimo/server/trunk/testsuite/pom.xml   (with props)
    geronimo/server/trunk/testsuite/src/
      - copied from r439088, geronimo/server/trunk/testsupport/src/
    geronimo/server/trunk/testsuite/src/site/
      - copied from r439382, geronimo/server/trunk/testsupport/src/site/

Added: geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml?rev=439522&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml (added)
+++ geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml Fri Sep  1 18:26:33 2006
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+
+<!-- $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>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <artifactId>console-testsuite</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+    <artifactId>basic</artifactId>
+    <name>Geronimo TestSuite, Console :: Basic</name>
+    <packaging>jar</packaging>
+    
+    <description>
+        Basic test for the Geronimo console.
+    </description>
+
+</project>

Propchange: geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/testsuite/console-testsuite/basic/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java?rev=439522&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java (added)
+++ geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java Fri Sep  1 18:26:33 2006
@@ -0,0 +1,119 @@
+/*
+ * 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.testsuite.console;
+
+import junit.framework.TestCase;
+
+import com.thoughtworks.selenium.Selenium;
+import com.thoughtworks.selenium.DefaultSelenium;
+
+import org.openqa.selenium.server.SeleniumServer;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public class SimpleLoginTest
+    extends TestCase
+{
+    private Selenium selenium;
+    
+    protected void setUp(String url) throws Exception {
+        super.setUp();
+        if (url == null) {
+            url = "http://localhost:" + SeleniumServer.DEFAULT_PORT;
+        }
+        selenium = new DefaultSelenium("localhost", SeleniumServer.DEFAULT_PORT, "*firefox", url);
+        selenium.start();
+    }
+    
+    protected void setUp() throws Exception {
+        super.setUp();
+        
+        this.setUp("http://localhost:8080/");
+    }
+    
+    protected void tearDown() throws Exception {
+        selenium.stop();
+    }
+    
+    public void testLogin() throws Exception {
+        selenium.open("/");
+        assertEquals("Apache Geronimo", selenium.getTitle());
+        
+        selenium.click("link=Console");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console Login", selenium.getTitle());
+        
+        selenium.type("j_username", "system");
+        selenium.type("j_password", "manager");
+        selenium.click("submit");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console", selenium.getTitle());
+	}
+    
+    public void testLoginAndLogout() throws Exception {
+        selenium.open("/");
+        assertEquals("Apache Geronimo", selenium.getTitle());
+        
+        selenium.click("link=Console");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console Login", selenium.getTitle());
+        
+        selenium.type("j_username", "system");
+        selenium.type("j_password", "manager");
+        selenium.click("submit");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console", selenium.getTitle());
+        
+        selenium.click("//a[contains(@href, '/console/logout.jsp')]");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console Login", selenium.getTitle());
+    }
+    
+    public void testClickSomeLinks() throws Exception {
+        selenium.open("/");
+        assertEquals("Apache Geronimo", selenium.getTitle());
+        
+        selenium.click("link=Console");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console Login", selenium.getTitle());
+        
+        selenium.type("j_username", "system");
+        selenium.type("j_password", "manager");
+        selenium.click("submit");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console", selenium.getTitle());
+        
+        selenium.click("link=Information");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console", selenium.getTitle());
+        
+        selenium.click("link=JVM");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console", selenium.getTitle());
+        
+        selenium.click("link=DB Info");
+        selenium.waitForPageToLoad("30000");
+        assertEquals("Geronimo Console", selenium.getTitle());
+    }
+}
+

Propchange: geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/testsuite/console-testsuite/basic/src/test/java/org/apache/geronimo/testsuite/console/SimpleLoginTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/console-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/console-testsuite/pom.xml?rev=439522&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/console-testsuite/pom.xml (added)
+++ geronimo/server/trunk/testsuite/console-testsuite/pom.xml Fri Sep  1 18:26:33 2006
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+
+<!-- $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>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <artifactId>testsuite</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+    <artifactId>console-testsuite</artifactId>
+    <name>Geronimo TestSuite, Console</name>
+    <packaging>pom</packaging>
+    
+    <description>
+        Geronimo console testsuite.
+    </description>
+    
+    <dependencies>
+
+        <dependency>
+            <groupId>org.openqa.selenium.client-drivers</groupId>
+            <artifactId>selenium-java-client-driver</artifactId>
+            <version>0.8.1</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.openqa.selenium.server</groupId>
+            <artifactId>selenium-server</artifactId>
+            <version>0.8.1</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>dependency-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-assemblies</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.apache.geronimo.assemblies</groupId>
+                                    <artifactId>geronimo-jetty-j2ee</artifactId>
+                                    <version>${pom.version}</version>
+                                    <classifier>bin</classifier>
+                                    <type>zip</type>
+                                </artifactItem>
+                            </artifactItems>
+                            <outputDirectory>${project.build.directory}/assemblies</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <plugin>
+                <groupId>org.apache.geronimo.plugins</groupId>
+                <artifactId>selenium-maven-plugin</artifactId>
+                
+                <executions>
+                    <execution>
+                        <id>start-server</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>start</goal>
+                        </goals>
+                    </execution>
+                    
+                    <!--
+                    FIXME: No stop... hope the process dies when mvn does
+                    
+                    <execution>
+                        <id>stop-server</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                    -->
+                </executions>
+            </plugin>
+            
+            <plugin>
+                <groupId>org.apache.geronimo.plugins</groupId>
+                <artifactId>server-maven-plugin</artifactId>
+                
+                <configuration>
+                    <assembly>
+                        <groupId>org.apache.geronimo.assemblies</groupId>
+                        <artifactId>geronimo-jetty-j2ee</artifactId>
+                        <version>${pom.version}</version>
+                        <classifier>bin</classifier>
+                        <type>zip</type>
+                    </assembly>
+                </configuration>
+                
+                <executions>
+                    <execution>
+                        <id>start-server</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>start</goal>
+                        </goals>
+                    </execution>
+                    
+                    <execution>
+                        <id>stop-server</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-invoker-plugin</artifactId>
+                <version>1.0-SNAPSHOT</version>
+                
+                <configuration>
+                    <debug>true</debug>
+                    <projectsDirectory>${pom.basedir}</projectsDirectory>
+                    <pomIncludes>
+                        <pomInclude>*/pom.xml</pomInclude>
+                    </pomIncludes>
+                </configuration>
+                
+                <executions>
+                    <execution>
+                        <id>integration-test</id>
+                        <phase>integration-test</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <!--
+            NOTE: Cargo will not currently work woth G 1.2, needs some patches,
+                  in the mean time use the server plugin.
+            -->
+            <plugin>
+                <groupId>org.codehaus.cargo</groupId>
+                <artifactId>cargo-maven2-plugin</artifactId>
+                
+                <configuration>
+                    <container>
+                        <containerId>geronimo1x</containerId>
+                        <home>${project.build.directory}/assemblies/geronimo-jetty-j2ee-${pom.version}</home>
+                        <type>installed</type>
+                    </container>
+                    <configuration>
+                        <type>existing</type>
+                        <home>${project.build.directory}/assemblies/geronimo-jetty-j2ee-${pom.version}</home>
+                    </configuration>
+                </configuration>
+                
+                <!--
+                <executions>
+                    <execution>
+                        <id>start-container</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>start</goal>
+                        </goals>
+                    </execution>
+                    
+                    <execution>
+                        <id>stop-container</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                -->
+            </plugin>
+            
+        </plugins>
+    </build>
+
+</project>

Propchange: geronimo/server/trunk/testsuite/console-testsuite/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/console-testsuite/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/testsuite/console-testsuite/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/pom.xml?rev=439522&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/pom.xml (added)
+++ geronimo/server/trunk/testsuite/pom.xml Fri Sep  1 18:26:33 2006
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+
+<!-- $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>
+        <groupId>org.apache.geronimo</groupId>
+        <artifactId>geronimo</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+    <groupId>org.apache.geronimo.testsuite</groupId>
+    <artifactId>testsuite</artifactId>
+    <name>Geronimo TestSuite</name>
+    <packaging>pom</packaging>
+    
+    <description>
+        Geronimo integration testsuite.
+    </description>
+    
+    <modules>
+        <module>console-testsuite</module>
+    </modules>
+    
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.codehaus.cargo</groupId>
+                    <artifactId>cargo-maven2-plugin</artifactId>
+                    <version>0.3-SNAPSHOT</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+    
+    <repositories>
+        <repository>
+            <id>openqa</id>
+            <name>OpenQA Repository</name>
+            <url>http://maven.openqa.org</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+    </repositories>
+
+</project>

Propchange: geronimo/server/trunk/testsuite/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/testsuite/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml