Skip to end of metadata
Go to start of metadata


The PicketLink Integration Test is a sub-project that provides some unit and integration tests to verify the reliability on major design items. You can clone this project from:

As PicketLink supports different containers, the tests need to run in each of them. The table bellow lists all the supported containers:

Container Version
JBoss AS 5.1.0.GA
JBoss AS 7.1.1.Final
JBoss AS 5.1.0.GA with JBossWS CXF Stack
Apache Tomcat 6.0.26


PicketLink Federation

You must have the PicketLink Federation libraries installed in your maven local repository. Check which version is being used by the integration tests looking at the parent/pom.xml. There is a property named version.picketlink.

PicketLink Quickstarts

The PicketLink Quickstarts provides a lot of useful examples about how to use the PicketLink features. The applications provided by this project are used during the integration tests.

Before executing the tests, make sure you have the quickstarts installed in your maven local repository. The version must match the PicketLink libraries version.

Project Organization

Basically, the project is organized in two modules:

  • unit-test
    Contains test classes and resources, only. For each feature there is a sub-module with specific tests and resources (Eg.: saml, ws-trust, etc).
    • util       : Utility classes to be used by the test cases.
    • saml     : SAML test cases.
    • ws-trust: WS-Trust test cases.
    • xacml  : XACML test cases.
    • trust     : PicketLink JAAS LoginModules test cases.
  • integration-tests
    Contains all the configurations required to run the tests on a specific server. For each target container there is a sub-module (Eg.: jboss-as7, jboss-as5, tomcat-6, etc).
    • integration-webapps: Contains some applications used during the tests.
    • jboss-as5                  : Configures a JBoss AS5 installation and execute the tests against it.
    • jboss-as5-cxf            : Configures a JBoss AS5 installation with the JBossWS CXF Stack configured and execute the tests against it.
    • jboss-as6                  : Configures a JBoss AS6 installation and execute the tests against it.
    • jboss-as7                  : Configures a JBoss AS7 installation and execute the tests against it.
    • tomcat-6                   : Configures a Apache Tomcat 6 installation and execute the tests against it.

Running the Tests

In order to execute the tests, you need to use one of the configured Maven Profiles.

Profile Description
all-tests Executes all test cases.
saml-tests Executes only the SAML test cases.
ws-trust-tests Executes only the WS-Trust test cases.
xacml-tests Executes only the XACML test cases

The example bellow shows how you can execute all tests:

You can also execute the tests for a specific feature. The example bellow executes only the WS-Trust test cases:

Executing the tests in a specific container

When you run one of the configured profiles, the default behaviour is to execute the tests against all the supported containers.

If you want to execute the tests in a specific container only, you can use the forceBinding parameter.

The example above will execute the tests only in JBoss AS 5.

How to create Test Cases

As said before, each feature has its own module, which contains only the specific test cases for that feature.

The following sections will show how to create a SAML test case. The same rule apply for the WS-Trust, XACML, etc.

Create a JUnit Test Case

@TargetContainers Annotation

As you can see, the class is using a @TargetContainers annotation. This annotation defines the containers in which the test should execute. In this case we are telling that we want to execute this test against all containers.


The integration tests uses Arquillian to start/stop the containers and deploy the testing applications. In the previous example, two applications will be deployed during the test execution: idp and sales-post. Both applications are provided by the PicketLink Quickstarts project, during the execution the war file is automatically retrieved from the maven repository.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.