[weld-commits] Weld SVN: r5544 - in examples/trunk: jsf/numberguess and 3 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Thu Jan 21 10:14:38 EST 2010


Author: mgencur at redhat.com
Date: 2010-01-21 10:14:38 -0500 (Thu, 21 Jan 2010)
New Revision: 5544

Added:
   examples/trunk/jsf/numberguess/src/test/selenium/jboss6x-cluster.xml
Modified:
   examples/trunk/jsf/numberguess/pom.xml
   examples/trunk/jsf/numberguess/src/main/java/org/jboss/weld/examples/numberguess/Game.java
   examples/trunk/jsf/numberguess/src/main/webapp-jboss5/WEB-INF/web.xml
   examples/trunk/pom.xml
Log:
WELD-396 added changes for running and testing examples in cluster

Modified: examples/trunk/jsf/numberguess/pom.xml
===================================================================
--- examples/trunk/jsf/numberguess/pom.xml	2010-01-20 23:24:43 UTC (rev 5543)
+++ examples/trunk/jsf/numberguess/pom.xml	2010-01-21 15:14:38 UTC (rev 5544)
@@ -59,6 +59,11 @@
          <activation>
             <activeByDefault>true</activeByDefault>
          </activation>
+         
+         <properties>
+         	<distributable.flag></distributable.flag>
+         </properties>
+         
          <dependencies>
 
             <dependency>
@@ -96,7 +101,7 @@
                      <webResources>
                         <resource>
                            <directory>src/main/webapp-jboss5</directory>
-                           <filtering>false</filtering>
+                           <filtering>true</filtering>
                         </resource>
                      </webResources>
                   </configuration>
@@ -104,7 +109,62 @@
             </plugins>
          </build>
       </profile>
+      
       <profile>
+         <id>jboss6cluster</id>
+         <activation>
+            <activeByDefault>false</activeByDefault>
+         </activation>
+         
+         <properties>
+         	<distributable.flag>&lt;distributable/&gt;</distributable.flag>
+         </properties>
+         
+         <dependencies>
+
+            <dependency>
+               <groupId>javax.annotation</groupId>
+               <artifactId>jsr250-api</artifactId>
+               <scope>provided</scope>
+            </dependency>
+
+            <dependency>
+               <groupId>javax.faces</groupId>
+               <artifactId>jsf-api</artifactId>
+               <scope>provided</scope>
+            </dependency>
+
+            <dependency>
+               <groupId>org.glassfish.web</groupId>
+               <artifactId>el-impl</artifactId>
+               <scope>runtime</scope>
+               <exclusions>
+                  <exclusion>
+                     <groupId>javax.el</groupId>
+                     <artifactId>el-api</artifactId>
+                  </exclusion>
+               </exclusions>
+            </dependency>
+
+         </dependencies>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-war-plugin</artifactId>
+                  <configuration>
+                     <webResources>
+                        <resource>
+                           <directory>src/main/webapp-jboss5</directory>
+                           <filtering>true</filtering>
+                        </resource>
+                     </webResources>
+                  </configuration>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>   
+      <profile>
          <id>tomcat</id>
          <dependencies>
 
@@ -530,6 +590,47 @@
             </plugins>
          </build>
       </profile>
+      <profile>
+         <id>ftest-jboss-cluster-60</id>
+         <activation>
+            <activeByDefault>false</activeByDefault>
+         </activation>
+
+         <properties>
+            <ftest.artifact>ftest-numberguess</ftest.artifact>
+            <ftest.version>0.1${ftest.version.discriminator}</ftest.version>
+         </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>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
    </profiles>
 
    <build>

Modified: examples/trunk/jsf/numberguess/src/main/java/org/jboss/weld/examples/numberguess/Game.java
===================================================================
--- examples/trunk/jsf/numberguess/src/main/java/org/jboss/weld/examples/numberguess/Game.java	2010-01-20 23:24:43 UTC (rev 5543)
+++ examples/trunk/jsf/numberguess/src/main/java/org/jboss/weld/examples/numberguess/Game.java	2010-01-21 15:14:38 UTC (rev 5544)
@@ -97,7 +97,7 @@
    
    public void validateNumberRange(FacesContext context,  UIComponent toValidate, Object value)
    {
-      if (remainingGuesses <= 1)
+      if (remainingGuesses <= 0)
       {
          FacesMessage message = new FacesMessage("No guesses left!");
          context.addMessage(toValidate.getClientId(context), message);

Modified: examples/trunk/jsf/numberguess/src/main/webapp-jboss5/WEB-INF/web.xml
===================================================================
--- examples/trunk/jsf/numberguess/src/main/webapp-jboss5/WEB-INF/web.xml	2010-01-20 23:24:43 UTC (rev 5543)
+++ examples/trunk/jsf/numberguess/src/main/webapp-jboss5/WEB-INF/web.xml	2010-01-21 15:14:38 UTC (rev 5544)
@@ -6,6 +6,8 @@
       http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    
+   ${distributable.flag}
+  
    <display-name>Web Beans Numberguess example</display-name>
    
    <context-param>

Added: examples/trunk/jsf/numberguess/src/test/selenium/jboss6x-cluster.xml
===================================================================
--- examples/trunk/jsf/numberguess/src/test/selenium/jboss6x-cluster.xml	                        (rev 0)
+++ examples/trunk/jsf/numberguess/src/test/selenium/jboss6x-cluster.xml	2010-01-21 15:14:38 UTC (rev 5544)
@@ -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 Numberguess example" verbose="2" parallel="false">
+    <listeners>
+		<listener class-name="org.jboss.weld.example.common.test.selenium.WeldFunctionalTestListener" />
+	</listeners>
+	<test name="numberguess_cluster_jboss5">
+		<parameter name="example.context.path" value="/weld-numberguess" />
+		<packages>
+			<package name="org.jboss.weld.example.numberguess.clustertest.selenium" />
+		</packages>
+	</test>
+</suite>


Property changes on: examples/trunk/jsf/numberguess/src/test/selenium/jboss6x-cluster.xml
___________________________________________________________________
Name: svn:executable
   + *

Modified: examples/trunk/pom.xml
===================================================================
--- examples/trunk/pom.xml	2010-01-20 23:24:43 UTC (rev 5543)
+++ examples/trunk/pom.xml	2010-01-21 15:14:38 UTC (rev 5544)
@@ -109,6 +109,7 @@
       <selenium.speed>0</selenium.speed>
       <selenium.timeout>30000</selenium.timeout>
       <selenium.debug>false</selenium.debug>
+      <application.deploy.timeout>300</application.deploy.timeout>      
    </properties>
 
    <!-- Dependency management, including any extra repositories needed -->
@@ -701,6 +702,226 @@
             </pluginManagement>
          </build>
       </profile>
+      
+      <profile>
+         <id>ftest-jboss-cluster-60</id>
+         <activation>
+            <activeByDefault>false</activeByDefault>
+         </activation>
+
+         <pluginRepositories>
+            <pluginRepository>
+               <id>repository.codehaus.repository</id>
+               <url>http://repository.codehaus.org/</url>
+               <releases>
+                  <enabled>true</enabled>
+               </releases>
+               <snapshots>
+                  <enabled>true</enabled>
+                  <updatePolicy>never</updatePolicy>
+               </snapshots>
+            </pluginRepository>
+         </pluginRepositories>
+
+         <properties>
+            <ftest.testsuite>jboss6x-cluster.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>
+                        <!--
+                           this can't be used until plugin sends the
+                           right command, using Ant GET instead
+                        -->
+                        <!--
+                           <execution> <id>stop-selenium</id>
+                           <phase>post-integration-test</phase> <goals>
+                           <goal>stop-server</goal> </goals>
+                           <configuration>
+                           <port>${selenium.server.port}</port>
+                           </configuration> </execution>
+                        -->
+                     </executions>
+                  </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>
+                           <property>
+                              <name>jboss.config</name>
+                              <value>${jboss.master.configuration}</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>
+
+
+                  <!-- 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>farm-example</id>
+							<phase>pre-integration-test</phase>
+							<configuration>
+								<tasks>
+									<property name="url.to.wait" value="http://localhost:8180/${project.build.finalName}"/>												
+									<copy file="${project.build.directory}/${project.build.finalName}.${project.packaging}" todir="${jboss.master.configuration}/farm"/>
+									<echo message="Waiting for application at ${url.to.wait}"/>												
+									<waitfor maxwait="${application.deploy.timeout}" maxwaitunit="second">								
+										<http url="${url.to.wait}" errorsBeginAt="404" />
+									</waitfor>
+								</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..."/>
+									<delete file="${jboss.master.configuration}/farm/${project.build.finalName}.${project.packaging}"/>
+								
+									<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>
+               </plugins>
+            </pluginManagement>
+         </build>
+      </profile>
+      
    </profiles>
 </project>
 



More information about the weld-commits mailing list