continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r743564 - in /continuum/trunk/continuum-webapp-test: ./ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/continuum/ src/test/java/org/apache/continuum/web/ src/test/java/org/apache/continuum/web/test/ src...
Date Wed, 11 Feb 2009 23:31:07 GMT
Author: wsmoak
Date: Wed Feb 11 23:31:07 2009
New Revision: 743564

URL: http://svn.apache.org/viewvc?rev=743564&view=rev
Log:
[CONTINUUM-2073] Rework the pom to execute a simple test of the About page, assuming that
Continuum is already running and configured.  Add AboutTest and it.properties.

Added:
    continuum/trunk/continuum-webapp-test/src/test/java/
    continuum/trunk/continuum-webapp-test/src/test/java/org/
    continuum/trunk/continuum-webapp-test/src/test/java/org/apache/
    continuum/trunk/continuum-webapp-test/src/test/java/org/apache/continuum/
    continuum/trunk/continuum-webapp-test/src/test/java/org/apache/continuum/web/
    continuum/trunk/continuum-webapp-test/src/test/java/org/apache/continuum/web/test/
    continuum/trunk/continuum-webapp-test/src/test/java/org/apache/continuum/web/test/AboutTest.java
    continuum/trunk/continuum-webapp-test/src/test/resources/it.properties
Modified:
    continuum/trunk/continuum-webapp-test/Readme.txt
    continuum/trunk/continuum-webapp-test/pom.xml

Modified: continuum/trunk/continuum-webapp-test/Readme.txt
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/Readme.txt?rev=743564&r1=743563&r2=743564&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/Readme.txt (original)
+++ continuum/trunk/continuum-webapp-test/Readme.txt Wed Feb 11 23:31:07 2009
@@ -6,6 +6,13 @@
  * in Selenium IDE, modify the Base URL if necessary (for example, http://localhost:8080/continuum)
  * in Selenium IDE, click the 'Play entire test suite' icon
 
+Run Selenium tests in src/test/java with Maven
+ * Start Continuum, create admin user, and save General Configuration
+ * modify src/test/resources/it.properties as needed
+ * mvn clean install
+
+======= OLD INSTRUCTIONS FOR src/test/it BELOW =======
+
 Test Continuum with Tomcat 5.x and firefox
     'mvn clean install' or 'mvn clean install -Ptomcat5x,firefox'
 

Modified: continuum/trunk/continuum-webapp-test/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/pom.xml?rev=743564&r1=743563&r2=743564&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/pom.xml (original)
+++ continuum/trunk/continuum-webapp-test/pom.xml Wed Feb 11 23:31:07 2009
@@ -22,381 +22,22 @@
   <parent>
     <groupId>org.apache.continuum</groupId>
     <artifactId>continuum</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.3.2-SNAPSHOT</version>
   </parent>
   <artifactId>continuum-webapp-test</artifactId>
   <name>Continuum Webapp Test</name>
   <packaging>pom</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-webapp</artifactId>
-      <type>war</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-web-ui-tests</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <scope>test</scope>
-    </dependency>
-    
-    <!--
-       All dependencies defined below are the dependencies list of continuum-webapp
-       We need them because we need to add in WEB-INF-lib all jars that aren't in
-       the webapp because they are provided by appserver
-    -->
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-configuration</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-app-configuration-model</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-app-configuration-web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-security</artifactId>
-    </dependency>
-    <dependency> <!-- added since depMgt doesn't override imported dependencies
-->
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-xwork-integration</artifactId>
-      <version>1.0-alpha-3</version>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-      <version>2.4</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>jsp-api</artifactId>
-      <version>2.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>opensymphony</groupId>
-      <artifactId>sitemesh</artifactId>
-      <version>2.2.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.extremecomponents</groupId>
-      <artifactId>extremecomponents</artifactId>
-      <version>1.0.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-log4j-logging</artifactId>
-    </dependency>
-    <!--
-    <dependency>
-      <groupId>mysql</groupId>
-      <artifactId>mysql-connector-java</artifactId>
-    </dependency>
-    -->
-    <dependency>
-      <groupId>commons-fileupload</groupId>
-      <artifactId>commons-fileupload</artifactId>
-      <version>1.1</version>
-    </dependency>
-    <dependency>
-      <groupId>taglibs</groupId>
-      <artifactId>standard</artifactId>
-      <version>1.1.2</version>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>jstl</artifactId>
-      <version>1.1.2</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-bazaar</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-clearcase</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-cvsexe</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-local</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-perforce</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-starteam</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-svnexe</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-synergy</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-provider-vss</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-notifier-irc</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-notifier-jabber</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-notifier-msn</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-notifier-wagon</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-xmlrpc</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-xmlrpc</artifactId>
-      <version>1.0-beta-4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-provider-api</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-file</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-http-lightweight</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-ssh</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-ssh-external</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-webdav</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <!--
-      Plexus Security Dependencies
-      -->
-    <dependency>
-      <groupId>org.codehaus.plexus.security</groupId>
-      <artifactId>plexus-security-ui-web</artifactId>
-      <type>war</type>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus.security</groupId>
-      <artifactId>plexus-security-ui-web-taglib</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-jdo2</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>xerces</groupId>
-          <artifactId>xercesImpl</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>xerces</groupId>
-          <artifactId>xmlParserAPIs</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.derby</groupId>
-      <artifactId>derby</artifactId>
-    </dependency>
-    <!--
-    <dependency>
-      <groupId>postgresql</groupId>
-      <artifactId>postgresql</artifactId>
-      <version>8.0-312.jdbc3</version>
-    </dependency>
-    -->
-    <dependency>
-      <groupId>jpox</groupId>
-      <artifactId>jpox</artifactId>
-      <exclusions>
-        <!-- targeting JDK 1.4 we don't need this -->
-        <exclusion>
-          <groupId>javax.sql</groupId>
-          <artifactId>jdbc-stdext</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.1</version>
-    </dependency>
-    <dependency>
-      <groupId>javax.mail</groupId>
-      <artifactId>mail</artifactId>
-      <version>1.4</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>javax.activation</groupId>
-      <artifactId>activation</artifactId>
-      <version>1.1</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
 
   <build>
-    <testSourceDirectory>src/test/it</testSourceDirectory>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>dependency-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>unzip-continuum-webapp</id>
-            <phase>generate-resources</phase>
-            <goals>
-              <goal>unpack</goal>
-            </goals>
-            <configuration>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>${project.groupId}</groupId>
-                  <artifactId>continuum-webapp</artifactId>
-                  <version>${project.version}</version>
-                  <type>war</type>
-                </artifactItem>
-              </artifactItems>
-              <outputDirectory>${project.build.directory}/${container.name}conf/webapps/continuum</outputDirectory>
-            </configuration>
-          </execution>
-          <execution>
-            <id>prepare-provided-dependencies</id>
-            <phase>generate-resources</phase>
-            <goals>
-              <goal>copy-dependencies</goal>
-            </goals>
-            <configuration>
-              <overWriteReleases>false</overWriteReleases>
-              <overWriteSnapshots>true</overWriteSnapshots>
-              <excludeTransitive>false</excludeTransitive>
-              <outputDirectory>${project.build.directory}/providedDependencies</outputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-antrun-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>copy-container-conf</id>
-            <phase>package</phase>
-            <configuration>
-              <tasks>
-                <copy todir="${project.build.directory}/${container.name}conf">
-                  <fileset dir="src/test/${container.name}"/>
-                </copy>
-                <copy todir="${project.build.directory}/installs/${container.name}/apache-tomcat-5.5.20/apache-tomcat-5.5.20/common/lib">
-                  <fileset dir="${project.build.directory}/providedDependencies">
-                    <include name="**/derby-*.jar"/>
-                  </fileset>
-                </copy>
-              </tasks>
-            </configuration>
-            <goals>
-              <goal>run</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>copy-provided-dependencies</id>
-            <phase>package</phase>
-            <configuration>
-              <tasks>
-                <copy todir="${project.build.directory}/${container.name}conf">
-                  <fileset dir="src/test/${container.name}"/>
-                </copy>
-                <copy todir="${project.build.directory}/${container.name}conf/webapps/continuum/WEB-INF/lib">
-                  <fileset dir="${project.build.directory}/providedDependencies">
-                    <include name="activation-*.jar"/>
-                    <include name="classworlds-*.jar"/>
-                    <include name="icu4j-*.jar"/>
-                    <include name="jpox-*.jar"/>
-                    <include name="velocity-dep-*.jar"/>
-                    <include name="xalan-*.jar"/>
-                    <include name="xercesImpl-*.jar"/>
-                    <include name="xml-apis-*.jar"/>
-                    <include name="xmlParserAPIs-*.jar"/>
-                    <include name="mail-*.jar"/>
-                    <include name="plexus-container-default-*.jar"/>
-                    <include name="jdo2-api-*.jar"/>
-                    <include name="connector-*.jar"/>
-                    <include name="nlog4j-*.jar"/>
-                    <include name="log4j-*.jar"/>
-                  </fileset>
-                </copy>
-              </tasks>
-            </configuration>
-            <goals>
-              <goal>run</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>check-continuum-loaded</id>
-            <phase>integration-test</phase>
-            <configuration>
-              <tasks>
-                <get src="http://localhost:9595/continuum/" dest="${project.build.directory}/index.html"/>
-                <delete file="${project.build.directory}/index.html"/>
-              </tasks>
-            </configuration>
-            <goals>
-              <goal>run</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+          <verbose>true</verbose>
+        </configuration>
         <executions>
           <execution>
             <goals>
@@ -406,119 +47,62 @@
         </executions>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>selenium-maven-plugin</artifactId>
-        <version>1.0-SNAPSHOT</version>
+        <artifactId>maven-resources-plugin</artifactId>
         <executions>
           <execution>
-            <id>start-selenium</id>
-            <phase>pre-integration-test</phase>
             <goals>
-              <goal>start-server</goal>
+              <goal>testResources</goal>
             </goals>
           </execution>
         </executions>
-        <configuration>
-          <background>true</background>
-        </configuration>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.cargo</groupId>
-        <artifactId>cargo-maven2-plugin</artifactId>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>selenium-maven-plugin</artifactId>
         <executions>
           <execution>
-            <id>start-container</id>
             <phase>pre-integration-test</phase>
             <goals>
-              <goal>start</goal>
+              <goal>start-server</goal>
             </goals>
             <configuration>
-              <wait>false</wait>
+              <background>true</background>
             </configuration>
           </execution>
-          <execution>
-            <id>stop-container</id>
-            <phase>post-integration-test</phase>
-            <goals>
-                <goal>stop</goal>
-            </goals>
-          </execution>
         </executions>
-        <configuration>
-          <container>
-            <containerId>${container.name}</containerId>
-            <zipUrlInstaller>
-              <url>${container.url}</url>
-              <installDir>${project.build.directory}/installs/${container.name}</installDir>
-            </zipUrlInstaller>
-            <log>${project.build.directory}/logs/${container.name}.log</log>
-            <output>${project.build.directory}/logs/${container.name}.out</output>
-            <timeout>600000</timeout>
-          </container>
-          <configuration>
-            <home>${project.build.directory}/${container.name}conf</home>
-            <type>existing</type>
-            <properties>
-              <cargo.servlet.port>9595</cargo.servlet.port>
-            </properties>
-          </configuration>
-        </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <executions>
           <execution>
+            <id>integration-tests</id>
             <phase>integration-test</phase>
             <goals>
               <goal>test</goal>
             </goals>
           </execution>
         </executions>
-        <configuration>
-          <systemProperties>
-            <property>
-              <name>browser</name>
-              <value>${browser}</value>
-            </property>
-          </systemProperties>
-        </configuration>
       </plugin>
     </plugins>
   </build>
-  
-  <profiles>
-    <profile>
-      <id>tomcat5x</id>
-      <activation>
-        <activeByDefault>true</activeByDefault>
-      </activation>
-      <properties>
-        <container.name>tomcat5x</container.name>
-        <container.url>http://apache.multidist.com/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.zip</container.url>
-      </properties>
-    </profile>
-
-    <profile>
-      <id>firefox</id>
-      <activation>
-        <activeByDefault>true</activeByDefault>
-      </activation>
-      <properties>
-        <browser>*firefox</browser>
-      </properties>
-    </profile>
-    <profile>
-      <id>iexplore</id>
-      <properties>
-        <browser>*iexplore</browser>
-      </properties>
-    </profile>
-    <profile>
-      <id>otherbrowser</id>
-      <properties>
-        <browser>*custom ${browserPath}</browser>
-      </properties>
-    </profile>
-  </profiles>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.openqa.selenium.client-drivers</groupId>
+      <artifactId>selenium-java-client-driver</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.openqa.selenium.client-drivers</groupId>
+      <artifactId>selenium-java-client-driver</artifactId>
+      <version>0.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
 </project>

Added: continuum/trunk/continuum-webapp-test/src/test/java/org/apache/continuum/web/test/AboutTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/java/org/apache/continuum/web/test/AboutTest.java?rev=743564&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/java/org/apache/continuum/web/test/AboutTest.java
(added)
+++ continuum/trunk/continuum-webapp-test/src/test/java/org/apache/continuum/web/test/AboutTest.java
Wed Feb 11 23:31:07 2009
@@ -0,0 +1,42 @@
+package org.apache.continuum.web.test;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+import com.thoughtworks.selenium.Selenium;
+
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+public class AboutTest extends TestCase {
+
+	private String baseUrl;
+    public String maxWaitTimeInMs;
+    private Selenium selenium;
+
+    public void setUp() throws Exception {
+
+        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" );
+
+        String seleniumHost = p.getProperty( "SELENIUM_HOST" );
+        int seleniumPort = Integer.parseInt( (p.getProperty( "SELENIUM_PORT" ) ) );
+        String seleniumBrowser = p.getProperty( "SELENIUM_BROWSER" );
+
+        selenium = new DefaultSelenium( seleniumHost, seleniumPort, seleniumBrowser, baseUrl
);
+        selenium.start();
+    }
+
+    public void tearDown() throws Exception {
+	    selenium.stop();
+    }
+
+    public void testAboutDisplay() {
+    	selenium.open( baseUrl + "/about.action" );
+    	selenium.waitForPageToLoad( maxWaitTimeInMs );
+
+    	assertEquals("Continuum - About", selenium.getTitle());
+    }
+}

Added: continuum/trunk/continuum-webapp-test/src/test/resources/it.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/resources/it.properties?rev=743564&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/it.properties (added)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/it.properties Wed Feb 11 23:31:07
2009
@@ -0,0 +1,11 @@
+#properties for integration tests
+
+BASE_URL=http://localhost:9090
+MAX_WAIT_TIME_IN_MS=60000
+
+ADMIN_USERNAME=admin
+ADMIN_PASSWORD=admin123
+
+SELENIUM_HOST=localhost
+SELENIUM_PORT=4444
+SELENIUM_BROWSER=*firefox



Mime
View raw message