Author: mgencur(a)redhat.com
Date: 2010-03-05 09:26:54 -0500 (Fri, 05 Mar 2010)
New Revision: 6008
Modified:
archetypes/trunk/jsf/jee-minimal/pom.xml
archetypes/trunk/jsf/servlet-minimal/pom.xml
archetypes/trunk/pom.xml
Log:
WELDX-70 added testing of weld-jsf-jee-minimal with glassfish standalone
Modified: archetypes/trunk/jsf/jee-minimal/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee-minimal/pom.xml 2010-03-05 14:04:35 UTC (rev 6007)
+++ archetypes/trunk/jsf/jee-minimal/pom.xml 2010-03-05 14:26:54 UTC (rev 6008)
@@ -90,7 +90,6 @@
<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>
@@ -114,13 +113,11 @@
<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>
@@ -135,17 +132,14 @@
<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>
@@ -154,12 +148,10 @@
<argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
</arguments>
</configuration>
-
<goals>
<goal>exec</goal>
</goals>
</execution>
-
<!-- deploy -->
<execution>
<id>deploy-project</id>
@@ -173,17 +165,13 @@
<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>
@@ -192,17 +180,13 @@
<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>
@@ -211,7 +195,6 @@
<argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
</arguments>
</configuration>
-
<goals>
<goal>exec</goal>
</goals>
@@ -222,5 +205,151 @@
</plugins>
</build>
</profile>
+
+ <profile>
+ <id>ftest-glassfish</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.glassfish.maven.plugin</groupId>
+ <artifactId>maven-glassfish-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>
+ <property name="url.to.wait"
value="http://localhost:8080/${project.artifactId}" />
+ <echo message="Waiting for application at ${url.to.wait} using Glassfish
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>compile-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>
+ <!-- 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>
Modified: archetypes/trunk/jsf/servlet-minimal/pom.xml
===================================================================
--- archetypes/trunk/jsf/servlet-minimal/pom.xml 2010-03-05 14:04:35 UTC (rev 6007)
+++ archetypes/trunk/jsf/servlet-minimal/pom.xml 2010-03-05 14:26:54 UTC (rev 6008)
@@ -90,7 +90,6 @@
<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>
@@ -113,7 +112,6 @@
<goal>run</goal>
</goals>
</execution>
-
<!-- killing container running in background -->
<execution>
<id>stop-container</id>
@@ -131,7 +129,6 @@
</goals>
</execution>
</executions>
-
</plugin>
<plugin>
@@ -142,7 +139,6 @@
<execution>
<id>generate-project-artifacts</id>
<phase>generate-resources</phase>
-
<configuration>
<executable>mvn</executable>
<workingDirectory>${java.io.tmpdir}</workingDirectory>
@@ -157,17 +153,14 @@
<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>
@@ -176,17 +169,14 @@
<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>
@@ -195,13 +185,13 @@
<argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
</arguments>
</configuration>
-
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
+
</plugins>
</build>
</profile>
Modified: archetypes/trunk/pom.xml
===================================================================
--- archetypes/trunk/pom.xml 2010-03-05 14:04:35 UTC (rev 6007)
+++ archetypes/trunk/pom.xml 2010-03-05 14:26:54 UTC (rev 6008)
@@ -85,7 +85,6 @@
<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 -->
@@ -120,6 +119,7 @@
<build>
<pluginManagement>
<plugins>
+
<!-- get functional tests from ftest artifact -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -170,36 +170,30 @@
</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>
-
+ <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>
@@ -215,7 +209,6 @@
<goal>run</goal>
</goals>
</execution>
-
</executions>
</plugin>
@@ -365,6 +358,251 @@
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>${maven.antrun.plugin.version}</version>
+ <executions>
+ <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-glassfish</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>maven.java.net</id>
+ <
name>Java.net Maven2 Repository</name>
+ <
url>http://download.java.net/maven/2</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <properties>
+
<maven.private.repo>${java.io.tmpdir}/maven_private_repo</maven.private.repo>
+ <ftest.testsuite>testsuite.xml</ftest.testsuite>
+ <glassfish.admin.user>admin</glassfish.admin.user>
+ <glassfish.admin.password>changeit</glassfish.admin.password>
+ </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>
+
+ <plugin>
+ <groupId>org.glassfish.maven.plugin</groupId>
+ <artifactId>maven-glassfish-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+
<glassfishDirectory>${env.GLASSFISH_HOME}</glassfishDirectory>
+ <user>${glassfish.admin.user}</user>
+
<adminPassword>${glassfish.admin.password}</adminPassword>
+ <echo>true</echo>
+ <domain>
+ <name>domain1</name>
+ <adminPort>4848</adminPort>
+ <httpPort>8080</httpPort>
+ </domain>
+ <components>
+ <component>
+ <name>${project.artifactId}</name>
+
<artifact>${java.io.tmpdir}/${project.artifactId}/target/${project.artifactId}.war</artifact>
+ </component>
+ </components>
+ </configuration>
+ <executions>
+ <execution>
+ <id>deploy-project</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>undeploy-project</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>undeploy</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-domain</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop-domain</goal>
+ </goals>
+ </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>
@@ -377,24 +615,20 @@
<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>
-
+ <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>
@@ -479,7 +713,7 @@
</execution>
</executions>
</plugin>
-
+
</plugins>
</pluginManagement>
</build>