Maven notes

Where to find good maven documentation

The best maven documentation is the Sonatype maven book: http://www.sonatype.com/books/mvnref-book/reference/

Run a single unit test

mvn test -Dtest=<classname>

Generate code coverage

akong@plain:~/Workspace/connect/Current/Product/Production/Gateway/AdminDistribution_10$ mvn cobertura:cobertura
[INFO] Scanning for projects...
...
akong@plain:~/Workspace/connect/Current/Product/Production/Gateway/AdminDistribution_10$ open target/site/cobertura/index.html 

Run the Validation Suite via Maven script

The Validation Suite can be run via a Maven script against a standalone installation of the application server:

$ cd <CONNECT_CLONE_DIR>/Product/SoapUI_Test/ValidationSuite
$ mvn verify -Dstandalone -Dproperties.dir=<applicaiton server configuration dir>

Several properties can be passed for mvn verify:

    -Dstandalone -- must be passed in for standalone testing
    -Dproperties.dir=<gateway config dir> -- for GlassFish this is <GlassFish home>/domains/domain1/config/nhin; there is an equivalent in WebSphere
    -Dhost=<machine name or IP address to act as the requesting gateway> -- defaults to localhost, but can be passed in to test on remote machines
    -Dport=<####> -- defaults to 8080; the unsecured port
    -Dsecured.port=<####> -- defaults to 8181; the secured port, used for defining HIEM response endpoints
    -Ddb.host=<machine name or IP address of the MySQL server> --  defaults to localhost
    -Ddb.port=<####> -- defaults to 3306
    -Ddb.user=<database user name> -- defaults to nhincuser
    -Ddb.password=<database password> -- defaults to nhincpass
    -Dtest.suite=<g0 or g1>
    -Dentity.skip -- pass in to skip Entity testing
    -Dmsgproxy.skip -- pass in to skip MsgProxy testing
    -Dtest.case=<test case name> -- one of "Document Submission Deferred Req"
                                  "Document Submission Deferred Resp"
                                  "Document Submission"
                                  "Patient Discovery Deferred Req"
                                  "Patient Discovery Deferred Resp"
                                  "Patient Discovery"
                                  "Document Query"
                                  "Document Retrieve"
                                  "Subscribe"
                                  "Notify"
                                  "Unsubscribe"
                                  "Admin Distribution"
Examples

Run all g0 Message Proxy test cases:

mvn verify -Dtest.suite=g0 -Dskip.entity -Dstandalone -Dproperties.dir=<applicaiton server configuration dir>

Run only PD Entity g1 test case:

mvn verify -Dtest.suite=g1 -Dtest.case="Patient Discovery" -Dskip.msgproxy -Dstandalone -Dproperties.dir=<applicaiton server configuration dir>

Run all DQ (g0 and g1, Entity and Message Proxy):

mvn verify -Dtest.case="Document Query" -Dstandalone -Dproperties.dir=<applicaiton server configuration dir>

Selective build and packaging

If PatientDiscoveryCore was modified...

mvn clean install -pl PatientDiscoveryCore -amd

where:
-pl = project list
-amd = also make dependents

This will result in:

[INFO] Reactor Build Order:
[INFO]
[INFO] CONNECT Patient Discovery Core
[INFO] CONNECT Adapter Web
[INFO] CONNECT Consumer Preferences Profile GUI
[INFO] CONNECT Deferred Queue Manager GUI
[INFO] CONNECT Universal Client GUI
[INFO] CONNECT Adapter - PatientDiscovery_a0
[INFO] CONNECT Gateway - PatientDiscovery_10
[INFO] CONNECT EAR

List available Maven profiles

mvn help:all-profiles