[weld-commits] Weld SVN: r5991 - in archetypes/trunk: jsf/jee and 8 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Mar 3 08:24:12 EST 2010


Author: mgencur at redhat.com
Date: 2010-03-03 08:24:11 -0500 (Wed, 03 Mar 2010)
New Revision: 5991

Added:
   archetypes/trunk/jsf/jee-minimal/src/test/
   archetypes/trunk/jsf/jee-minimal/src/test/selenium/
   archetypes/trunk/jsf/jee-minimal/src/test/selenium/testsuite.xml
   archetypes/trunk/jsf/servlet-minimal/src/test/
   archetypes/trunk/jsf/servlet-minimal/src/test/selenium/
   archetypes/trunk/jsf/servlet-minimal/src/test/selenium/testsuite.xml
Modified:
   archetypes/trunk/jsf/jee-minimal/pom.xml
   archetypes/trunk/jsf/jee/pom.xml
   archetypes/trunk/jsf/servlet-minimal/pom.xml
   archetypes/trunk/pom.xml
Log:
first part of testsuite for automatic testing of weld archetypes

Modified: archetypes/trunk/jsf/jee/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee/pom.xml	2010-03-03 13:10:45 UTC (rev 5990)
+++ archetypes/trunk/jsf/jee/pom.xml	2010-03-03 13:24:11 UTC (rev 5991)
@@ -31,4 +31,7 @@
          </plugin>
       </plugins>
    </build>
+   
+   
+   
 </project>

Modified: archetypes/trunk/jsf/jee-minimal/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee-minimal/pom.xml	2010-03-03 13:10:45 UTC (rev 5990)
+++ archetypes/trunk/jsf/jee-minimal/pom.xml	2010-03-03 13:24:11 UTC (rev 5991)
@@ -31,4 +31,196 @@
          </plugin>
       </plugins>
    </build>
+   
+   <profiles>
+   		 <profile>
+         <id>ftest-jboss</id>
+         <activation>
+            <activeByDefault>false</activeByDefault>
+         </activation>
+
+         <properties>
+            <ftest.artifact>ftest-archetypes</ftest.artifact>
+            <ftest.version>0.1${ftest.version.discriminator}</ftest.version>
+            <selenium.browser.url>http://localhost:8080</selenium.browser.url>
+         </properties>
+
+         <dependencies>
+            <dependency>
+               <groupId>org.jboss.weld.examples.ftest</groupId>
+               <artifactId>${ftest.artifact}</artifactId>
+               <version>${ftest.version}</version>
+               <scope>test</scope>
+            </dependency>
+         </dependencies>
+
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-dependency-plugin</artifactId>
+               </plugin>
+               
+               <plugin>
+                  <groupId>org.codehaus.mojo</groupId>
+                  <artifactId>selenium-maven-plugin</artifactId>
+               </plugin>
+               
+               <plugin>
+                  <groupId>org.codehaus.mojo</groupId>
+                  <artifactId>failsafe-maven-plugin</artifactId>
+               </plugin>
+               
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-antrun-plugin</artifactId>
+                                    
+                  <executions>
+					 <!-- remove a project generated earlier  -->
+	                 <execution>
+							<id>remove-old-project</id>
+							<phase>process-sources</phase>
+							<configuration>
+								<tasks>
+									<echo message="Removing old project" />
+									<delete dir="${java.io.tmpdir}/${project.artifactId}" failonerror="false"/>
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+					 </execution>
+					 
+					 <!-- tomcat:run has to be executed in background otherwise it would block further maven execution -->
+					 <execution>
+							<id>wait-for-project</id>
+							<phase>pre-integration-test</phase>
+							<configuration>
+								<tasks>
+									<property name="url.to.wait" value="http://localhost:8080/${project.artifactId}" />												
+									<echo message="Waiting for application at ${url.to.wait} using jboss container" />												
+									<waitfor maxwait="${application.deploy.timeout}" maxwaitunit="second">								
+										<http url="${url.to.wait}" errorsBeginAt="404" />
+									</waitfor>
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+					 </execution>
+				 </executions>
+               </plugin>
+               
+               <plugin>
+			        <groupId>org.codehaus.mojo</groupId>
+			        <artifactId>exec-maven-plugin</artifactId>
+
+			        <executions>			        
+					  <!-- generate project using weld archetypes    -->
+			          <execution>	
+			          	<id>generate-project-artifacts</id>
+					  	<phase>generate-resources</phase>
+			          			  
+			          	<configuration>
+				          <executable>mvn</executable>
+				          <workingDirectory>${java.io.tmpdir}</workingDirectory>
+				          <arguments>
+				            <argument>archetype:generate</argument>
+				            <argument>-DinteractiveMode=n</argument>				            
+				            <argument>-DarchetypeArtifactId=${project.artifactId}</argument>
+				            <argument>-DarchetypeGroupId=org.jboss.weld.archetypes</argument>
+				            <argument>-DarchetypeVersion=${archetype.test.version}</argument>
+				            <argument>-DgroupId=com.mycompany</argument>
+				            <argument>-DartifactId=${project.artifactId}</argument>
+				            <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+				          </arguments>
+				        </configuration>		  
+			          			            
+			            <goals>
+			              <goal>exec</goal>
+			            </goals>
+			          </execution>
+			          
+					  <!-- just compile generated project    -->
+			          <execution>	
+			          	<id>package-project</id>
+					  	<phase>compile</phase>
+			          			  
+			          	<configuration>
+				          <executable>mvn</executable>
+				          <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+				          <arguments>
+				            <argument>package</argument>	
+				            <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>			           
+				          </arguments>
+				        </configuration>		  
+			          			            
+			            <goals>
+			              <goal>exec</goal>
+			            </goals>
+			          </execution>			          
+			          
+			          <!-- deploy    -->
+			          <execution>	
+			          	<id>deploy-project</id>
+					  	<phase>compile</phase>
+			          			  
+			          	<configuration>
+				          <executable>mvn</executable>
+				          <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+				          <arguments>
+				          	<argument>jboss:hard-deploy</argument>
+				            <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>				           
+				          </arguments>
+				        </configuration>		  
+			          			            
+			            <goals>
+			              <goal>exec</goal>
+			            </goals>
+			          </execution>	
+			          
+					  <!-- run unit tests    -->
+			          <execution>	
+			          	<id>run-unit-tests</id>
+					  	<phase>integration-test</phase>
+			          			  
+			          	<configuration>
+				          <executable>mvn</executable>
+				          <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+				          <arguments>
+				          	<argument>test</argument>
+				            <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>				           
+				          </arguments>
+				        </configuration>		  
+			          			            
+			            <goals>
+			              <goal>exec</goal>
+			            </goals>
+			          </execution>		
+			          
+			           <!-- undeploy    -->
+			          <execution>	
+			          	<id>undeploy-project</id>
+					  	<phase>post-integration-test</phase>
+			          			  
+			          	<configuration>
+				          <executable>mvn</executable>
+				          <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+				          <arguments>
+				          	<argument>jboss:hard-undeploy</argument>
+				            <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>				           
+				          </arguments>
+				        </configuration>		  
+			          			            
+			            <goals>
+			              <goal>exec</goal>
+			            </goals>
+			          </execution>	
+			        </executions>			 
+		      </plugin>
+                              
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
 </project>

Added: archetypes/trunk/jsf/jee-minimal/src/test/selenium/testsuite.xml
===================================================================
--- archetypes/trunk/jsf/jee-minimal/src/test/selenium/testsuite.xml	                        (rev 0)
+++ archetypes/trunk/jsf/jee-minimal/src/test/selenium/testsuite.xml	2010-03-03 13:24:11 UTC (rev 5991)
@@ -0,0 +1,29 @@
+
+	<!--
+		JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+		Middleware LLC, and individual contributors by the @authors tag. See
+		the copyright.txt in the distribution for a full listing of individual
+		contributors. This is free software; you can redistribute it and/or
+		modify it under the terms of the GNU Lesser General Public License as
+		published by the Free Software Foundation; either version 2.1 of the
+		License, or (at your option) any later version. This software is
+		distributed in the hope that it will be useful, but WITHOUT ANY
+		WARRANTY; without even the implied warranty of MERCHANTABILITY or
+		FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+		License for more details. You should have received a copy of the GNU
+		Lesser General Public License along with this software; if not, write
+		to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+		Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+	--> 
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Weld JSF JEE Minimal archetype test" verbose="2" parallel="false">
+    <listeners>
+		<listener class-name="org.jboss.weld.example.common.test.selenium.WeldFunctionalTestListener" />
+	</listeners>
+	<test name="JEE Minimal">
+		<parameter name="example.context.path" value="/weld-jsf-jee-minimal" />
+		<packages>
+			<package name="org.jboss.weld.archetype.jeeminimal.test.selenium" />
+		</packages>
+	</test>
+</suite>

Modified: archetypes/trunk/jsf/servlet-minimal/pom.xml
===================================================================
--- archetypes/trunk/jsf/servlet-minimal/pom.xml	2010-03-03 13:10:45 UTC (rev 5990)
+++ archetypes/trunk/jsf/servlet-minimal/pom.xml	2010-03-03 13:24:11 UTC (rev 5991)
@@ -32,4 +32,178 @@
          </plugin>
       </plugins>
    </build>
+   
+   <profiles>
+   	  <profile>
+         <id>ftest-embedded</id>
+         <activation>
+            <activeByDefault>false</activeByDefault>
+         </activation>
+
+         <properties>
+            <ftest.artifact>ftest-archetypes</ftest.artifact>
+            <ftest.version>0.1${ftest.version.discriminator}</ftest.version>
+            <selenium.browser.url>http://localhost:9090</selenium.browser.url>
+         </properties>
+
+         <dependencies>
+            <dependency>
+               <groupId>org.jboss.weld.examples.ftest</groupId>
+               <artifactId>${ftest.artifact}</artifactId>
+               <version>${ftest.version}</version>
+               <scope>test</scope>
+            </dependency>
+         </dependencies>
+
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-dependency-plugin</artifactId>
+               </plugin>
+               
+               <plugin>
+                  <groupId>org.codehaus.mojo</groupId>
+                  <artifactId>selenium-maven-plugin</artifactId>
+               </plugin>
+               
+               <plugin>
+                  <groupId>org.codehaus.mojo</groupId>
+                  <artifactId>failsafe-maven-plugin</artifactId>
+               </plugin>
+               
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-antrun-plugin</artifactId>
+                  <executions>
+					 <!-- remove a project generated earlier  -->
+	                 <execution>
+							<id>remove-old-project</id>
+							<phase>process-sources</phase>
+							<configuration>
+								<tasks>
+									<echo message="Removing old project" />
+									<delete dir="${java.io.tmpdir}/${project.artifactId}" failonerror="false"/>
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+					 </execution>
+					 
+					 <!-- tomcat:run has to be executed in background otherwise it would block further maven execution -->
+					 <execution>
+							<id>deploy-project</id>
+							<phase>pre-integration-test</phase>
+							<configuration>
+								<tasks>
+									<exec dir="${java.io.tmpdir}/${project.artifactId}" executable="mvn" spawn="true">
+	  									<arg value="${container}:run"/>
+	  									<arg value="-Dmaven.repo.local=${maven.private.repo}/"/>
+									</exec>
+									
+									<property name="url.to.wait" value="http://localhost:9090/${project.artifactId}" />												
+									<echo message="Waiting for application at ${url.to.wait} using ${container} container" />												
+									<waitfor maxwait="${application.deploy.timeout}" maxwaitunit="second">								
+										<http url="${url.to.wait}" errorsBeginAt="404" />
+									</waitfor>
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+					 </execution>
+					 
+					 <!-- killing container running in background -->
+					 <execution>
+							<id>stop-container</id>  
+							<phase>post-integration-test</phase>  
+							<configuration>
+								<tasks>
+									 <exec dir="${java.io.tmpdir}/${project.artifactId}" executable="bash">  
+							          	<arg value="-c"/>  
+							         	<arg value="ps -eaf --columns 1200 | grep ${container}:run | grep -v grep | awk '{ print $$2; }' | xargs kill"/>    
+							         </exec>  
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+					 </execution>					
+				 </executions>
+				     
+               </plugin>
+               
+               <plugin>
+			        <groupId>org.codehaus.mojo</groupId>
+			        <artifactId>exec-maven-plugin</artifactId>
+			        <executions>			        
+					  <!-- generate project using weld archetypes    -->
+			          <execution>	
+			          	<id>generate-project-artifacts</id>
+					  	<phase>generate-resources</phase>
+			          			  
+			          	<configuration>
+				          <executable>mvn</executable>
+				          <workingDirectory>${java.io.tmpdir}</workingDirectory>
+				          <arguments>
+				            <argument>archetype:generate</argument>
+				            <argument>-DinteractiveMode=n</argument>				            
+				            <argument>-DarchetypeArtifactId=${project.artifactId}</argument>
+				            <argument>-DarchetypeGroupId=org.jboss.weld.archetypes</argument>
+				            <argument>-DarchetypeVersion=${archetype.test.version}</argument>
+				            <argument>-DgroupId=com.mycompany</argument>
+				            <argument>-DartifactId=${project.artifactId}</argument>
+				            <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+				          </arguments>
+				        </configuration>		  
+			          			            
+			            <goals>
+			              <goal>exec</goal>
+			            </goals>
+			          </execution>
+			          
+					  <!-- just compile generated project    -->
+			          <execution>	
+			          	<id>compile-project</id>
+					  	<phase>compile</phase>
+			          			  
+			          	<configuration>
+				          <executable>mvn</executable>
+				          <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+				          <arguments>
+				            <argument>compile</argument>	
+				            <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>			           
+				          </arguments>
+				        </configuration>		  
+			          			            
+			            <goals>
+			              <goal>exec</goal>
+			            </goals>
+			          </execution>			          
+			          
+					  <!-- run unit tests    -->
+			          <execution>	
+			          	<id>run-unit-tests</id>
+					  	<phase>integration-test</phase>
+			          			  
+			          	<configuration>
+				          <executable>mvn</executable>
+				          <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+				          <arguments>
+				          	<argument>test</argument>
+				            <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>				           
+				          </arguments>
+				        </configuration>		  
+			          			            
+			            <goals>
+			              <goal>exec</goal>
+			            </goals>
+			          </execution>			          
+			        </executions>			 
+		      </plugin>
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
 </project>

Added: archetypes/trunk/jsf/servlet-minimal/src/test/selenium/testsuite.xml
===================================================================
--- archetypes/trunk/jsf/servlet-minimal/src/test/selenium/testsuite.xml	                        (rev 0)
+++ archetypes/trunk/jsf/servlet-minimal/src/test/selenium/testsuite.xml	2010-03-03 13:24:11 UTC (rev 5991)
@@ -0,0 +1,29 @@
+
+	<!--
+		JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+		Middleware LLC, and individual contributors by the @authors tag. See
+		the copyright.txt in the distribution for a full listing of individual
+		contributors. This is free software; you can redistribute it and/or
+		modify it under the terms of the GNU Lesser General Public License as
+		published by the Free Software Foundation; either version 2.1 of the
+		License, or (at your option) any later version. This software is
+		distributed in the hope that it will be useful, but WITHOUT ANY
+		WARRANTY; without even the implied warranty of MERCHANTABILITY or
+		FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+		License for more details. You should have received a copy of the GNU
+		Lesser General Public License along with this software; if not, write
+		to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+		Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+	--> 
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Weld JSF Servlet Minimal archetype test" verbose="2" parallel="false">
+    <listeners>
+		<listener class-name="org.jboss.weld.example.common.test.selenium.WeldFunctionalTestListener" />
+	</listeners>
+	<test name="ServletMinimal">
+		<parameter name="example.context.path" value="/weld-jsf-servlet-minimal" />
+		<packages>
+			<package name="org.jboss.weld.archetype.servletminimal.test.selenium" />
+		</packages>
+	</test>
+</suite>

Modified: archetypes/trunk/pom.xml
===================================================================
--- archetypes/trunk/pom.xml	2010-03-03 13:10:45 UTC (rev 5990)
+++ archetypes/trunk/pom.xml	2010-03-03 13:24:11 UTC (rev 5991)
@@ -67,6 +67,26 @@
       <module>jsf/jee-minimal</module>
       <module>jsf/jee</module>
    </modules>
+   
+   <properties>
+   	  <testng.version>5.10</testng.version>
+      <selenium.java.client.version>1.0.1</selenium.java.client.version>
+      <selenium.maven.plugin.version>1.0</selenium.maven.plugin.version>
+      <maven.antrun.plugin.version>1.3</maven.antrun.plugin.version>
+      <failsafe.maven.plugin.version>2.4.3-alpha-1</failsafe.maven.plugin.version>
+      <exec.maven.plugin.version>1.1</exec.maven.plugin.version>
+      <ant.junit.version>1.6.2</ant.junit.version>
+      <ftest.version.discriminator />
+      <selenium.browser>*firefoxproxy</selenium.browser>
+      <selenium.server.port>14444</selenium.server.port>
+      <selenium.server.host>localhost</selenium.server.host>
+      <selenium.speed>0</selenium.speed>
+      <selenium.timeout>30000</selenium.timeout>
+      <selenium.debug>false</selenium.debug>
+      <application.deploy.timeout>600</application.deploy.timeout> 
+      <archetype.test.version>1.0.0-BETA1</archetype.test.version>
+      
+   </properties>
 
    <!-- SCM and distribution management -->
    <scm>
@@ -74,4 +94,395 @@
       <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/archetypes/trunk</developerConnection>
       <url>http://fisheye.jboss.org/browse/weld/archetypes/trunk</url>
    </scm>
+   
+	<profiles>
+		<profile>
+         <id>ftest-embedded</id>
+         <activation>
+            <activeByDefault>false</activeByDefault>
+         </activation>
+
+         <properties>
+            <maven.private.repo>${java.io.tmpdir}/maven_private_repo</maven.private.repo>
+            <ftest.testsuite>testsuite.xml</ftest.testsuite>
+            <container>tomcat</container>  <!-- default is tomcat but jetty can be chosen by -Dcontainer=jetty -->
+         </properties>
+         
+         <dependencies>
+            <dependency>
+               <groupId>org.seleniumhq.selenium.client-drivers</groupId>
+               <artifactId>selenium-java-client-driver</artifactId>
+               <version>${selenium.java.client.version}</version>
+               <scope>test</scope>
+            </dependency>
+         </dependencies>
+
+         <build>
+            <pluginManagement>
+               <plugins>
+				  <!-- get functional tests from ftest artifact -->
+                  <plugin>
+                     <groupId>org.apache.maven.plugins</groupId>
+                     <artifactId>maven-dependency-plugin</artifactId>
+                     <executions>
+                        <execution>
+                           <id>copy-ftest</id>
+                           <phase>process-sources</phase>
+                           <goals>
+                              <goal>copy</goal>
+                           </goals>
+                           <configuration>
+                              <outputDirectory>${project.build.directory}/ftest</outputDirectory>
+                              <stripVersion>true</stripVersion>
+                              <artifactItems>
+                                 <artifactItem>
+                                    <groupId>org.jboss.weld.examples.ftest</groupId>
+                                    <artifactId>${ftest.artifact}</artifactId>
+                                    <overWrite>true</overWrite>
+                                 </artifactItem>
+                              </artifactItems>
+                           </configuration>
+                        </execution>
+                     </executions>
+                  </plugin>
+                  
+                  <!--  start Selenium server -->
+                  <plugin>
+                     <groupId>org.codehaus.mojo</groupId>
+                     <artifactId>selenium-maven-plugin</artifactId>
+                     <version>${selenium.maven.plugin.version}</version>
+                     <executions>
+                        <execution>
+                           <id>start-selenium</id>
+                           <phase>pre-integration-test</phase>
+                           <goals>
+                              <goal>start-server</goal>
+                           </goals>
+                           <configuration>
+                              <background>true</background>
+                              <port>${selenium.server.port}</port>
+                              <logOutput>true</logOutput>
+							  <logFile>${project.build.directory}/selenium/selenium-server.log</logFile>
+							  <browserSideLog>${selenium.debug}</browserSideLog>
+							  <debug>${selenium.debug}</debug>
+                           </configuration>
+      					</execution>
+                     </executions>
+                  </plugin>
+
+                  <!-- stop Selenium -->
+                  <plugin>
+                     <groupId>org.apache.maven.plugins</groupId>
+                     <artifactId>maven-antrun-plugin</artifactId>
+                     <version>${maven.antrun.plugin.version}</version>
+                     <executions>                     
+						<!-- deploy application to farm directory and waiting for the application to be ready				  -->
+						<execution>
+							<id>prepare-private-local-repo</id>
+							<phase>process-sources</phase>
+							<configuration>
+								<tasks>
+
+								<property name="tmpdir" value="${maven.private.repo}"/>
+								<delete dir="${tmpdir}" failonerror="false"/>
+								<mkdir dir="${tmpdir}"/>
+								
+								<copy todir="${tmpdir}" overwrite="true">
+   									<fileset dir="${user.home}/.m2/repository/org/jboss/weld/archetypes">
+   										<include name="**/*"/>
+   									</fileset>
+   								</copy>
+
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+						</execution>      
+															               
+						<!-- this ant script runs testng natively -->
+						<execution>
+							<id>stop-selenium</id>
+							<phase>post-integration-test</phase>
+							<configuration>
+								<tasks>
+									<echo message="Undeploying application..." />
+									<get taskname="selenium-shutdown" src="http://${selenium.server.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDownSeleniumServer" ignoreerrors="true" dest="${project.build.directory}/selenium.stop.msg" />
+									<echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+						</execution>                        
+                        
+                     </executions>
+                  </plugin>
+                  
+                  <plugin>
+                     <groupId>org.codehaus.mojo</groupId>
+			         <artifactId>exec-maven-plugin</artifactId>
+			         <version>${exec.maven.plugin.version}</version>
+			      </plugin>
+			      
+			      <!-- run functional tests -->
+                  <plugin>
+                     <groupId>org.codehaus.mojo</groupId>
+                     <artifactId>failsafe-maven-plugin</artifactId>
+                     <version>${failsafe.maven.plugin.version}</version>
+                     <configuration>
+                        <testClassesDirectory>${project.build.directory}/ftest</testClassesDirectory>
+                        <suiteXmlFiles>
+                           <suiteXmlFile>src/test/selenium/${ftest.testsuite}</suiteXmlFile>
+                        </suiteXmlFiles>
+                        <argLine>-Xmx748m</argLine>
+                        <forkMode>once</forkMode>
+                        <systemProperties>
+                           <property>
+                              <name>selenium.server.port</name>
+                              <value>${selenium.server.port}</value>
+                           </property>
+                           <property>
+                              <name>selenium.server.host</name>
+                              <value>${selenium.server.host}</value>
+                           </property>
+                           <property>
+                              <name>selenium.browser</name>
+                              <value>${selenium.browser}</value>
+                           </property>
+                           <property>
+                              <name>selenium.browser.url</name>
+                              <value>${selenium.browser.url}</value>
+                           </property>
+                           <property>
+                              <name>selenium.speed</name>
+                              <value>${selenium.speed}</value>
+                           </property>
+                           <property>
+                              <name>selenium.timeout</name>
+                              <value>${selenium.timeout}</value>
+                           </property>
+                           <property>
+                              <name>basedir</name>
+                              <value>${basedir}</value>
+                           </property>
+                        </systemProperties>
+                     </configuration>
+                     <executions>
+                        <execution>
+                           <id>integration-test</id>
+                           <phase>integration-test</phase>
+                           <goals>
+                              <goal>integration-test</goal>
+                           </goals>
+                        </execution>
+                        <execution>
+                           <id>verify</id>
+                           <phase>verify</phase>
+                           <goals>
+                              <goal>verify</goal>
+                           </goals>
+                        </execution>
+                     </executions>
+                  </plugin>
+			      
+               </plugins>
+            </pluginManagement>
+         </build>
+      </profile>
+      
+      <profile>
+         <id>ftest-jboss</id>
+         <activation>
+            <activeByDefault>false</activeByDefault>
+         </activation>
+
+         <properties>
+            <maven.private.repo>${java.io.tmpdir}/maven_private_repo</maven.private.repo>
+            <ftest.testsuite>testsuite.xml</ftest.testsuite>
+         </properties>
+         
+         <dependencies>
+            <dependency>
+               <groupId>org.seleniumhq.selenium.client-drivers</groupId>
+               <artifactId>selenium-java-client-driver</artifactId>
+               <version>${selenium.java.client.version}</version>
+               <scope>test</scope>
+            </dependency>
+         </dependencies>
+
+         <build>
+            <pluginManagement>
+               <plugins>
+               
+				  <!-- get functional tests from ftest artifact -->
+                  <plugin>
+                     <groupId>org.apache.maven.plugins</groupId>
+                     <artifactId>maven-dependency-plugin</artifactId>
+                     <executions>
+                        <execution>
+                           <id>copy-ftest</id>
+                           <phase>process-sources</phase>
+                           <goals>
+                              <goal>copy</goal>
+                           </goals>
+                           <configuration>
+                              <outputDirectory>${project.build.directory}/ftest</outputDirectory>
+                              <stripVersion>true</stripVersion>
+                              <artifactItems>
+                                 <artifactItem>
+                                    <groupId>org.jboss.weld.examples.ftest</groupId>
+                                    <artifactId>${ftest.artifact}</artifactId>
+                                    <overWrite>true</overWrite>
+                                 </artifactItem>
+                              </artifactItems>
+                           </configuration>
+                        </execution>
+                     </executions>
+                  </plugin>
+                  
+                  <!--  start Selenium server -->
+                  <plugin>
+                     <groupId>org.codehaus.mojo</groupId>
+                     <artifactId>selenium-maven-plugin</artifactId>
+                     <version>${selenium.maven.plugin.version}</version>
+                     <executions>
+                        <execution>
+                           <id>start-selenium</id>
+                           <phase>pre-integration-test</phase>
+                           <goals>
+                              <goal>start-server</goal>
+                           </goals>
+                           <configuration>
+                              <background>true</background>
+                              <port>${selenium.server.port}</port>
+                              <logOutput>true</logOutput>
+							  <logFile>${project.build.directory}/selenium/selenium-server.log</logFile>
+							  <browserSideLog>${selenium.debug}</browserSideLog>
+							  <debug>${selenium.debug}</debug>
+                           </configuration>
+      					</execution>
+                     </executions>
+                  </plugin>
+
+                  <!-- stop Selenium -->
+                  <plugin>
+                     <groupId>org.apache.maven.plugins</groupId>
+                     <artifactId>maven-antrun-plugin</artifactId>
+                     <version>${maven.antrun.plugin.version}</version>
+                     <executions>                     
+						<!-- deploy application to farm directory and waiting for the application to be ready				  -->
+						<execution>
+							<id>prepare-private-local-repo</id>
+							<phase>process-sources</phase>
+							<configuration>
+								<tasks>
+
+								<property name="tmpdir" value="${maven.private.repo}"/>
+								<delete dir="${tmpdir}" failonerror="false"/>
+								<mkdir dir="${tmpdir}"/>
+								
+								<copy todir="${tmpdir}" overwrite="true">
+   									<fileset dir="${user.home}/.m2/repository/org/jboss/weld/archetypes">
+   										<include name="**/*"/>
+   									</fileset>
+   								</copy>
+
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+						</execution>      
+															               
+						<!-- this ant script runs testng natively -->
+						<execution>
+							<id>stop-selenium</id>
+							<phase>post-integration-test</phase>
+							<configuration>
+								<tasks>
+									<echo message="Undeploying application..." />
+									<get taskname="selenium-shutdown" src="http://${selenium.server.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDownSeleniumServer" ignoreerrors="true" dest="${project.build.directory}/selenium.stop.msg" />
+									<echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
+								</tasks>
+							</configuration>
+							<goals>
+								<goal>run</goal>
+							</goals>
+						</execution>                        
+                     </executions>
+                  </plugin>
+                  
+                  <plugin>
+                     <groupId>org.codehaus.mojo</groupId>
+			         <artifactId>exec-maven-plugin</artifactId>
+			         <version>${exec.maven.plugin.version}</version>
+			      </plugin>
+			      
+			      <!-- run functional tests -->
+                  <plugin>
+                     <groupId>org.codehaus.mojo</groupId>
+                     <artifactId>failsafe-maven-plugin</artifactId>
+                     <version>${failsafe.maven.plugin.version}</version>
+                     <configuration>
+                        <testClassesDirectory>${project.build.directory}/ftest</testClassesDirectory>
+                        <suiteXmlFiles>
+                           <suiteXmlFile>src/test/selenium/${ftest.testsuite}</suiteXmlFile>
+                        </suiteXmlFiles>
+                        <argLine>-Xmx748m</argLine>
+                        <forkMode>once</forkMode>
+                        <systemProperties>
+                           <property>
+                              <name>selenium.server.port</name>
+                              <value>${selenium.server.port}</value>
+                           </property>
+                           <property>
+                              <name>selenium.server.host</name>
+                              <value>${selenium.server.host}</value>
+                           </property>
+                           <property>
+                              <name>selenium.browser</name>
+                              <value>${selenium.browser}</value>
+                           </property>
+                           <property>
+                              <name>selenium.browser.url</name>
+                              <value>${selenium.browser.url}</value>
+                           </property>
+                           <property>
+                              <name>selenium.speed</name>
+                              <value>${selenium.speed}</value>
+                           </property>
+                           <property>
+                              <name>selenium.timeout</name>
+                              <value>${selenium.timeout}</value>
+                           </property>
+                           <property>
+                              <name>basedir</name>
+                              <value>${basedir}</value>
+                           </property>
+                        </systemProperties>
+                     </configuration>
+                     <executions>
+                        <execution>
+                           <id>integration-test</id>
+                           <phase>integration-test</phase>
+                           <goals>
+                              <goal>integration-test</goal>
+                           </goals>
+                        </execution>
+                        <execution>
+                           <id>verify</id>
+                           <phase>verify</phase>
+                           <goals>
+                              <goal>verify</goal>
+                           </goals>
+                        </execution>
+                     </executions>
+                  </plugin>
+			      
+               </plugins>
+            </pluginManagement>
+         </build>
+      </profile>
+	</profiles>   
 </project>



More information about the weld-commits mailing list