From line 7 changed to line 7:
++ How do I execute functional test on a example?
++ How do I execute functional test on an example?
From line 26 added to line 26:
This is the case of Numberguess example, where profile *jboss5* must be added.
From line 36 added to line 37:
++ How do I execute functional test on an example in cluster?
From line 37 added to lines 39 to 75:
Running functional test on examples in cluster is a little more complicated. Currently clustering tests are available only for numberguess example. Anyway there are other examples planned. Clustering test should be executed separately from other tests, not as part of test bundle.
Steps for running functional tests in cluster:
# Download JBoss AS 6.0.0.M1 and unzip it twice to two different folders
# Update both jboss instances with current trunk of Weld.
# Run first and second instance of JBoss AS sequentially with time gap around 20 seconds
# Run the tests
ad 1)
You can download JBoss application server from [www.jboss.org=>http://www.jboss.org/jbossas/downloads/]
ad 2)
Weld core can be downloaded from [annonsvn=>http://anonsvn.jboss.org/repos/weld/core/]. After downloading of Weld core set JBOSS\_HOME environment property to point to the first JBoss instance's directory and run the following command at core/jboss-as dir.
`$ mvn -Pupdate-jboss-as install`
Do the same with the second JBoss instance.
ad 3)
Run first and second instance of JBoss AS
`$ JBOSS1_HOME/bin/run.sh -c all -g DocsPartition -u 239.255.101.101 -b localhost -Djboss.messaging.ServerPeerID=1 -Djboss.service.binding.set=ports-default`
`$ JBOSS2_HOME/bin/run.sh -c all -g DocsPartition -u 239.255.101.101 -b localhost -Djboss.messaging.ServerPeerID=2 -Djboss.service.binding.set=ports-01`
NOTE: Do it exactly as stated above. The test assume certain URL adresses which are ensured by these commands.
ad 4)
Run the following command at jsf/numberguess directory in weld distribution
`$ mvn -P ftest-jboss-cluster-60,jboss6cluster -Djboss.master.configuration=$PATH_TO_MASTER_ALL_CONFIGURATION verify
`
NOTE: jboss.master.configuration parameter points for example to /home/applications/JBoss-6.0.0.M1.master/server/all. Profile jboss6cluster causes the application to be packaged according to cluster environment's restrictions. Profile ftest-jboss-cluster-60 executes the functional testsuite.
From line 55 added to lines 94 to 96:
Last, but not least, you can change which methods are run, verbosity and the other parameters by modifying TestNG suite file located in
|src/test/selenium| directory. Just select the file with respect to container you would like to use for testing.
From line 58 added to lines 100 to 101:
Simple tests:
From line 61 added to lines 105 to 171:
= jsf/permalink
Clustering tests:
= jsf/numberguess
If you are not able to download functional test from any repository, you can find them at [Ftest SVN=>https://svn.jboss.org/repos/weld/ftest] or [Anonymous Ftest SVN=>http://anonsvn.jboss.org/repos/weld/ftest], where you can either download |trunk| and all modules, or just |common| and required module. There's a [checkout.sh script=>http://anonsvn.jboss.org/repos/weld/ftest/trunk/checkout.sh], which will fetch all the functional test modules at once.
You can build and install them into your local Maven repository with: `$ mvn install`
++ How do I add functional tests for my own Weld Example?
Since all the execution is defined in *weld-example-parent* in
|pluginManagement| section of profiles, in your example you will
just add the same profile with definition of functional test dependency and plugins to be executed. This suppose that *weld-example-parent* is parent of your example and ftest artifact is written ;). Profile used for JBoss AS 6 M1 and Weld login example is stated below:
`
<profile>
<id>ftest-jboss-remote-60</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<ftest.artifact>ftest-login</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.cargo</groupId>
<artifactId>cargo-maven2-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>
`
Pleas note that existence of property *${ftest.artifact}* is necessary, because it allows parent to store functional test source
at appropriate place while Maven processes example source.