incubator-photark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r942771 - in /incubator/photark/trunk: ./ photark-ui-test/ photark-ui-test/src/test/java/org/apache/photark/ui/ photark-webapp/
Date Mon, 10 May 2010 15:01:04 GMT
Author: lresende
Date: Mon May 10 15:01:03 2010
New Revision: 942771

URL: http://svn.apache.org/viewvc?rev=942771&view=rev
Log:
PHOTARK-27 - Automating execution of HTML Unit tests via mvn -Pintegration

Added:
    incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3BrowserTestCase.java
  (contents, props changed)
      - copied, changed from r941155, incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3TestBrowser.java
    incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7BrowserTestCase.java
  (contents, props changed)
      - copied, changed from r941155, incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7TestBrowser.java
    incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8BrowserTestCase.java
  (contents, props changed)
      - copied, changed from r941155, incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8TestBrowser.java
Removed:
    incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3TestBrowser.java
    incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7TestBrowser.java
    incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8TestBrowser.java
Modified:
    incubator/photark/trunk/photark-ui-test/pom.xml
    incubator/photark/trunk/photark-webapp/pom.xml
    incubator/photark/trunk/pom.xml

Modified: incubator/photark/trunk/photark-ui-test/pom.xml
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui-test/pom.xml?rev=942771&r1=942770&r2=942771&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui-test/pom.xml (original)
+++ incubator/photark/trunk/photark-ui-test/pom.xml Mon May 10 15:01:03 2010
@@ -28,7 +28,21 @@
 	<artifactId>photark-ui-tests</artifactId>
 	<name>Apache PhotArk UI Integration Test</name>
     
+    
+    <properties>
+        <http.port>8080</http.port>
+        <http.base>http://localhost:${http.port}/photark</http.base>
+        <tomcat.home>${env.CATALINA_HOME}</tomcat.home>
+    </properties>
+
     <dependencies>
+    	<dependency>
+    		<groupId>org.apache.photark</groupId>
+    		<artifactId>photark-webapp</artifactId>
+    		<version>1.0-incubating-SNAPSHOT</version>
+    		<type>war</type>
+    	</dependency>
+							
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
@@ -43,4 +57,122 @@
            	<scope>test</scope>
 		</dependency>
     </dependencies>
+
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.codehaus.cargo</groupId>
+				<artifactId>cargo-maven2-plugin</artifactId>
+				<version>1.0.1-beta-1</version>
+                
+				<configuration>
+                    <wait>false</wait>
+
+					<container>
+						<containerId>tomcat6x</containerId>
+                        <type>installed</type>
+                        <home>${tomcat.home}</home>
+                        <systemProperties>
+                            <org.apache.commons.logging.Log>
+                                org.apache.commons.logging.impl.SimpleLog
+                            </org.apache.commons.logging.Log>
+                        </systemProperties>
+					</container>
+
+                    <configuration>
+                        <properties>
+                            <cargo.servlet.port>${http.port}</cargo.servlet.port>
+                        </properties>
+                        <type>existing</type>
+                        <home>${tomcat.home}</home>
+                                            
+						<deployables>
+							<deployable>
+								<groupId>org.apache.photark</groupId>
+								<artifactId>photark-webapp</artifactId>
+								<type>war</type>
+								<properties>
+									<context>photark</context>
+								</properties>
+							</deployable>
+						</deployables>
+                    </configuration>
+					
+                    
+					<!-- Deployer configuration -->
+					<!--deployer>
+                        <type>installed</type>
+						<type>embedded</type>
+						<deployables>
+							<deployable>
+								<groupId>org.apache.photark</groupId>
+								<artifactId>photark-webapp</artifactId>
+								<type>war</type>
+								<properties>
+									<context>photark</context>
+								</properties>
+							</deployable>
+						</deployables>
+					</deployer-->
+				</configuration>
+                
+				<executions>
+					<execution>
+						<id>start-container</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+                            <goal>deployer-deploy</goal>
+							<goal>start</goal>
+						</goals>
+					</execution>
+					<execution>
+						<id>stop-container</id>
+						<phase>post-integration-test</phase>
+						<goals>
+							<goal>stop</goal>
+						</goals>
+					</execution>
+				</executions>				
+                
+                
+   			</plugin>
+
+			<!--
+				NOTE: This horrible looking configuration sets up the surefire
+				plugin to not run tests during the 'test' phase, but instead during
+				the 'integration-test' phase.
+			-->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<skip>true</skip>
+				</configuration>
+				<executions>
+					<execution>
+						<id>test</id>
+						<phase>test</phase>
+						<goals>
+							<goal>test</goal>
+						</goals>
+						<configuration>
+							<skip>true</skip>
+						</configuration>
+					</execution>
+					<execution>
+						<id>integration</id>
+						<phase>integration-test</phase>
+						<goals>
+							<goal>test</goal>
+						</goals>
+						<configuration>
+							<skip>false</skip>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+
 </project>

Copied: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3BrowserTestCase.java
(from r941155, incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3TestBrowser.java)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3BrowserTestCase.java?p2=incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3BrowserTestCase.java&p1=incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3TestBrowser.java&r1=941155&r2=942771&rev=942771&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3TestBrowser.java
(original)
+++ incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3BrowserTestCase.java
Mon May 10 15:01:03 2010
@@ -28,6 +28,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import com.gargoylesoftware.htmlunit.BrowserVersion;
@@ -44,7 +45,7 @@ import com.gargoylesoftware.htmlunit.htm
 import com.gargoylesoftware.htmlunit.html.HtmlTable;
 
 
-public class FF3TestBrowser {
+public class FF3BrowserTestCase {
 
 	public static WebClient webClient;
 
@@ -71,7 +72,8 @@ public class FF3TestBrowser {
 		//albums loaded
 		assertTrue( table.getRow(1).getCell(0).asText().contains("boston"));
 		//Gallery pictures loaded
-		assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00860.jpg"));

+		assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00"));
//Don't use a specific image
+		                                                                                      
                        //as we can get <> order in <> OS
 		
 		//clicking on an image
 		assertTrue(page.getElementById("albumImage").getAttribute("src").contains("space.gif"));
@@ -81,8 +83,8 @@ public class FF3TestBrowser {
 		
 		Thread.sleep(3000);
 		//checking whether there are images in the album
-		assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00860.jpg"));
-
+		assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00"));
//Don't use a specific image
+                                                                                        
                                     //as we can get <> order in <> OS
 	}
 
 	@Test
@@ -90,7 +92,7 @@ public class FF3TestBrowser {
 		//passing credentials
 		final List collectedAlerts = new ArrayList();
 		webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts));
-		((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("admin",
"password"); 
+		((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("photark-admin",
"password"); 
 
 		final HtmlPage page = webClient.getPage("http://localhost:8080/photark/admin/upload.html");
 		Thread.sleep(3000);

Propchange: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3BrowserTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/FF3BrowserTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7BrowserTestCase.java
(from r941155, incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7TestBrowser.java)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7BrowserTestCase.java?p2=incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7BrowserTestCase.java&p1=incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7TestBrowser.java&r1=941155&r2=942771&rev=942771&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7TestBrowser.java
(original)
+++ incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7BrowserTestCase.java
Mon May 10 15:01:03 2010
@@ -44,7 +44,7 @@ import com.gargoylesoftware.htmlunit.htm
 import com.gargoylesoftware.htmlunit.html.HtmlTable;
 
 
-public class IE7TestBrowser {
+public class IE7BrowserTestCase {
 
 	public static WebClient webClient;
 
@@ -71,7 +71,8 @@ public class IE7TestBrowser {
 		//albums loaded
 		assertTrue( table.getRow(1).getCell(0).asText().contains("boston"));
 		//Gallery pictures loaded
-		assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00860.jpg"));

+		assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00"));
//Don't use a specific image
+                                                                                        
                                      //as we can get <> order in <> OS 
 		
 		//clicking on an image
 		assertTrue(page.getElementById("albumImage").getAttribute("src").contains("space.gif"));
@@ -80,7 +81,8 @@ public class IE7TestBrowser {
 		final HtmlPage page2= anchor.click(); 
 		Thread.sleep(3000);
 		//checking whether there are images in the album
-		assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00860.jpg"));
+		assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00"));
//Don't use a specific image
+                                                                                        
                                     //as we can get <> order in <> OS
 
 	}
 
@@ -89,7 +91,7 @@ public class IE7TestBrowser {
 		//passing credentials
 		final List collectedAlerts = new ArrayList();
 		webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts));
-		((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("admin",
"password"); 
+		((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("photark-admin",
"password"); 
 
 		final HtmlPage page = webClient.getPage("http://localhost:8080/photark/admin/upload.html");
 		Thread.sleep(3000);

Propchange: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7BrowserTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE7BrowserTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8BrowserTestCase.java
(from r941155, incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8TestBrowser.java)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8BrowserTestCase.java?p2=incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8BrowserTestCase.java&p1=incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8TestBrowser.java&r1=941155&r2=942771&rev=942771&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8TestBrowser.java
(original)
+++ incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8BrowserTestCase.java
Mon May 10 15:01:03 2010
@@ -44,7 +44,7 @@ import com.gargoylesoftware.htmlunit.htm
 import com.gargoylesoftware.htmlunit.html.HtmlTable;
 
 
-public class IE8TestBrowser {
+public class IE8BrowserTestCase {
 
 	public static WebClient webClient;
 
@@ -71,7 +71,8 @@ public class IE8TestBrowser {
 		//albums loaded
 		assertTrue( table.getRow(1).getCell(0).asText().contains("boston"));
 		//Gallery pictures loaded
-		assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00860.jpg"));

+		assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00"));
//Don't use a specific image
+                                                                                        
                                      //as we can get <> order in <> OS 
 		
 		//clicking on an image
 		assertTrue(page.getElementById("albumImage").getAttribute("src").contains("space.gif"));
@@ -80,7 +81,8 @@ public class IE8TestBrowser {
 		final HtmlPage page2= anchor.click(); 
 		Thread.sleep(3000);
 		//checking whether there are images in the album
-		assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00860.jpg"));
+		assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00"));
//Don't use a specific image
+                                                                                        
                                     //as we can get <> order in <> OS
 
 	}
 
@@ -89,7 +91,7 @@ public class IE8TestBrowser {
 		//passing credentials
 		final List collectedAlerts = new ArrayList();
 		webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts));
-		((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("admin",
"password"); 
+		((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("photark-admin",
"password"); 
 
 		final HtmlPage page = webClient.getPage("http://localhost:8080/photark/admin/upload.html");
 		Thread.sleep(3000);

Propchange: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8BrowserTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/photark/trunk/photark-ui-test/src/test/java/org/apache/photark/ui/IE8BrowserTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/photark/trunk/photark-webapp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-webapp/pom.xml?rev=942771&r1=942770&r2=942771&view=diff
==============================================================================
--- incubator/photark/trunk/photark-webapp/pom.xml (original)
+++ incubator/photark/trunk/photark-webapp/pom.xml Mon May 10 15:01:03 2010
@@ -154,6 +154,12 @@
 			<version>1.5.3</version>
 		</dependency>		
 		 
+		<dependency>
+		    <groupId>log4j</groupId>
+		    <artifactId>log4j</artifactId>
+		    <version>1.2.16</version>
+		</dependency>
+		 
 		<!-- marking dependency as provided to exclude from war file -->
 		<dependency>
 			<groupId>javax.servlet</groupId>

Modified: incubator/photark/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/pom.xml?rev=942771&r1=942770&r2=942771&view=diff
==============================================================================
--- incubator/photark/trunk/pom.xml (original)
+++ incubator/photark/trunk/pom.xml Mon May 10 15:01:03 2010
@@ -149,6 +149,9 @@
             <id>codehaus-snapshot</id>
             <name>Codehaus Snapshot Repository</name>
             <url>http://snapshots.repository.codehaus.org</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
             <snapshots>
                 <enabled>true</enabled>
             </snapshots>
@@ -188,12 +191,11 @@
                 <module>photark-jcr</module>
                 <module>photark-ui</module>
                 <module>photark-ui-admin</module>
-                <module>photark-ui-test</module>
                 <module>photark-appengine-webapp</module>                
                 <module>photark-webapp</module>
             </modules>
         </profile>
-        
+
         <!-- ====================================================================== -->
         <!-- Profile to build release distribution                                  -->
         <!-- ====================================================================== -->
@@ -206,13 +208,28 @@
                 <module>photark-jcr</module>
                 <module>photark-ui</module>
                 <module>photark-ui-admin</module>
-                <module>photark-ui-test</module>                
                 <module>photark-appengine-webapp</module>                
                 <module>photark-webapp</module>
             </modules>
         </profile>
 
-
+        <!-- ====================================================================== -->
+        <!-- Profile to build integration-test with tomcat                          -->
+        <!-- ====================================================================== -->
+        <profile>
+            <id>integration</id>
+            <modules>
+                <module>distribution</module>
+                <module>photark</module>
+                <module>photark-filesystem</module>                
+                <module>photark-jcr</module>
+                <module>photark-ui</module>
+                <module>photark-ui-admin</module>
+                <module>photark-ui-test</module>                
+                <module>photark-appengine-webapp</module>                
+                <module>photark-webapp</module>
+            </modules>
+        </profile>
         <!-- ====================================================================== -->
         <!-- Profile to run Apache License check plugin                             -->
         <!-- usage:                                                                 -->



Mime
View raw message