Skip to main content

Source code browse

Revision: 11310

Added multi_templating and seam
» Project Revision History

» Checkout URL

svn / trunk / test

FilenameAuthorRevisionModifiedLog Entry
..
edburns 9924 over 3 years ago SECTION: Modified Files --------...
mriem 11308 over 2 years ago Fixes http://java.net/jira/brows...
mriem 10617 almost 3 years ago Make sure the correct profile is...
mriem 10049 over 3 years ago Cleaning up POMs
mriem 11136 over 2 years ago Fixes http://java.net/jira/brows...
mriem 11286 over 2 years ago Added repackaging logic
mriem 11191 over 2 years ago Remove JavaNCSS report
mriem 11114 over 2 years ago Pulling properties common betwee...
mriem 11114 over 2 years ago Pulling properties common betwee...
mriem 11215 over 2 years ago Make sure the JsfTestRunner allo...
mriem 10049 over 3 years ago Cleaning up POMs
mriem 11310 over 2 years ago Added multi_templating and seam
mriem 11293 over 2 years ago Comment out the dependency plugi...
 Introduction
 ============

 Running tests against a Mojarra code base is using Maven as its carrier.
 In order for you to be able productive we are using several profiles so
 that you can pick and choose what you need for a particular scenario.

 So far the following scenarios have been identified:

	1. agnostic, tests not specific to a particular server.
	2. cluster, tests for a clustered server.
	3. selenium, tests that are browser specific.
	4. virtual, tests that execute on a virtual server.
        5. web-profile, tests that required JavaEE 6 Web Profile or later.

 In the test master POM we currently have the following profiles available:

	1. integration-failsafe, runs the integration tests.
        2. integration-glassfish-embedded, starts and stops the Embedded Glassfish.
        3. integration-glassfish-cargo, starts and stops an installed Glassfish.
        4. integration-tomcat-cargo, starts and stops Tomcat 7.x
        5. integration-selenium, runs the tests using Selenium.

 Running tests
 =============

 If you want to run the tests you can do it in several ways. The main reason why
 there are different ways is because we want to be able to run tests using  a 
 CI system, but also to run a single test by a developer. See below in which 
 ways we support testing:

    1. Running all tests against a running container.
    2. Running all tests against an installed version of Glassfish (not running).
    3. Running all tests against Tomcat 7.x.
    4. Running a single test against a running container.
    5. Running a single test against an installed version of Glassfish (not running).
    6. Running a single test method against a running container.

 Scenario 1
 ----------

 To run all the tests against a running container use the following command line:

    mvn -Pintegration-failsafe clean verify

 Scenario 2
 ----------

 To run all the tests against an installed version of Glassfish (not running):

    mvn -Pintegration-failsafe,integration-glassfish-cargo clean verify

 Scenario 3
 ----------

 To run all the tests against Tomcat 7.x:

    mvn -Pintegration-failsafe,integration-tomcat-cargo clean verify

 Scenario 4
 ----------

 To run a single test against a running container:

    mvn -Pintegration-failsafe -Dit.test=IndexPageIT clean verify

 where IndexPageIT is the name of the test class (note you can use regular
 expressions to match more than one test class here).

 Scenario 5
 ----------

 To run a single test against an installed version of Glassfish (not running).

    mvn -Pintegration-failsafe,integration-glassfish-cargo -Dit.test=IndexPageIT clean verify

 Scenario 6
 ----------

 To run a single test and single method against a running container use:

    mvn -Pintegration-failsafe -Dit.test=VersionPageIT#testVerifyMojarraVersion clean verify

 where VersionPageIT is the name of the test class, and testVerifyMojarraVersion
 the name of the test method (note you can use regular expressions to match 
 multiple test and methods).


 System Properties
 =================

 As part of the test harness we use several system properties that can be 
 passed in on the command line to affect how the tests are run. The table
 below lists some of the properties used, see the master POMs for more 
 details.

    Properties used by integration-failsafe profile
    ***********************************************

        property name                       property default value
        -------------                       ----------------------
        integration.serverName              localhost
        integration.serverPort              8080
        integration.protocol                http
        jsf.artifactId                      javax.faces
        jsf.groupId                         org.glassfish
        jsf.version                         ${project.version}    
        it.test                             <no default>


    Properties used by integration-glassfish-embedded profile
    *********************************************************

        No specific properties, use the ones defined in the
        integration-failsafe profile.


    Properties used by integration-glassfish-cargo profile
    ******************************************************

        property name                       property default value
        -------------                       ----------------------
        integration.container.id            glassfish3x
        integration.container.home          C:/Glassfish3.1.1


    Properties used by integration-tomcat-cargo profile
    ****************************************************

        property name                       property default value
        -------------                       ----------------------
        integration.container.id            tomcat7x
        integration.container.downloadUrl   http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.16/bin/apache-tomcat-7.0.16.zip
        integration.container.downloadDir   C:/Temp/Cargo/download
        integration.container.extractDir    C:/Temp/Cargo/extracts
        integration.container.home          C:/Temp/Cargo/tomcat7                
        tomcat.version                      7.0.16


 Pitfalls
 ========

 Since we are assuming a particular way of deployment you as the developer will
 have to be aware of the following pitfalls that might crop up if you are doing
 testing against different application servers.

    1. Make sure the context root in glassfish-web.xml matches the project.build.finalName,
       if you do not the test harness will not be able to run the tests since it
       relies on the integration.url used by the integration-failsafe profile to
       be build up in the following way 

        ${integration.protocol}://${integration.serverName}:$integration.serverPort}/${project.build.finalName}/

  Example invocation
  ==================

  Consider this entry in a maven ~/.m2/settings.xml <profiles> section:

    <profile>
      <id>mojarra-trunk</id>
      <properties>
        <integration.container.home>/full/path/to/container/glassfish-3.1.2/glassfish3</integration.container.home>
        <jsf.version>2.2.0-SNAPSHOT</jsf.version>
      </properties>
    </profile>

  The following mvn invocation, in this directory will invoke all the
  tests.  This assumes the container has already been started and
  configured with the version of Mojarra to test.

mvn -Dcargo.remote.password= -Pmojarra-trunk clean install
mvn -Dcargo.remote.password= -Pmojarra-trunk,integration-glassfish-cargo cargo:redeploy
mvn -Dcargo.remote.password= -Pmojarra-trunk,integration-failsafe verify 

 
--END
 
 
Close
loading
Please Confirm
Close