Help

Controls

Switch Workspace

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Comparing current revision with historical revision 1.
Document History: How do I run functional tests on Weld examples?
Current revision:
26
Parent:
Weld
Created On:
17. Dec 2009, 15:13 (kapy)
Last Modified On:
16. Sep 2011, 23:39 (sbryzak)
Historical revisions:
25 23. Mar 2010, 15:19 (sbryzak) ShowDiff
24 23. Mar 2010, 15:18 (mgencur) ShowDiff
23 22. Jan 2010, 16:01 (mgencur) ShowDiff
22 22. Jan 2010, 16:00 (mgencur) ShowDiff
21 22. Jan 2010, 15:58 (mgencur) ShowDiff
20 22. Jan 2010, 15:57 (mgencur) ShowDiff
19 22. Jan 2010, 15:54 (mgencur) ShowDiff
18 22. Jan 2010, 15:51 (mgencur) ShowDiff
17 22. Jan 2010, 15:50 (mgencur) ShowDiff
16 22. Jan 2010, 15:45 (mgencur) ShowDiff
15 22. Jan 2010, 15:41 (mgencur) ShowDiff
14 22. Jan 2010, 15:40 (mgencur) ShowDiff
13 22. Jan 2010, 15:35 (mgencur) ShowDiff
12 22. Jan 2010, 15:23 (mgencur) ShowDiff
11 22. Jan 2010, 15:17 (mgencur) ShowDiff
10 22. Jan 2010, 14:45 (mgencur) ShowDiff
9 22. Jan 2010, 14:42 (mgencur) ShowDiff
8 22. Jan 2010, 14:10 (mgencur) ShowDiff
7 14. Jan 2010, 14:32 (kapy) ShowDiff
6 08. Jan 2010, 14:02 (kapy) ShowDiff
5 18. Dec 2009, 10:43 (kapy) ShowDiff
4 17. Dec 2009, 16:04 (kapy) ShowDiff
3 17. Dec 2009, 15:49 (kapy) ShowDiff
2 17. Dec 2009, 15:48 (kapy) ShowDiff
1 17. Dec 2009, 15:13 (kapy) ShowDiff
0 (Initial Revision) ShowDiff

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.