HomeDownloadsUser GuideDevelopment

Development: Integration

The original goal of the integration project was to run integration tests on the Permis code within a continuous integration tool. Once implemented it proved to be a good starting point for integrators to quickly explore the Permis framework.

All the integration project does is to run tests against the four examples, but it does so automatically, using short shell and ant scripts and short java test classes, and even starting an LDAP and a EJB server when needed.

This document describes how to set up a local copy of the integration project an how to run it. Our advise is, before setting up an LDAP or an EJB server on your own, run the integration project and give a look at its short, insightful scripts and tests!

Checking out integration

The integration project only works together with a local development copy of the openpermis project. If you dont have yet such a copy get one following the instructions of Setup.

Once you have a local development copy of openpermis, you may check out the integration project from the SVN repository.

Anonymous Subversion Access:

svn checkout https://svn.forge.osor.eu/svn/openpermis/trunk/integration

Developer Subversion Access:

svn checkout --username ${USER} https://svn.forge.osor.eu/svn/openpermis/trunk/integration

Alternatively you may of course also use a graphical SVN client or use the SVN repository browser of your favourite IDE (the project repository already contains preconfigured settings for Eclipse).

For the integration project to work correctly, it has to be in the same directory as the openpermis project. In addition, the folder containing the integration project MUST have the name integration and the folder containing openpermis MUST have the name openpermis, just like in the SVN repository. Actually you get this automatically right if you check out the whole trunk at once.

The integration project takes more than 100mb because it contains a JBoss and an OpenDS.

The scripts running the integration tests require ant. If you don't have it, get it here.

The shell scripts has to be executed within a Unix-style shell. If you are working on Windows you can get and install a Unix-style shell here: http://www.cygwin.com/.

To compile the java test classes you need a Java SE Development Kit which you can find here .

Structure of integration

...
run-integration.sh
examples
simple
build.xml
SimpleIntegrationTest.java
run-simple-integration.sh
xacml
build.xml
XacmlIntegrationTest.java
run-xacml-integration.sh
ldap
build.xml
LdapIntegrationTest.java
run-ldap-integration.sh
ejb
build.xml
EjbIntegrationTest.java
run-ejb-integration.sh
...

Running integration

You can run all the integration tests at once by executing the shell script run-integration.sh at the root of integration.

This script takes three arguments:

  1. your user name
  2. the name of your machine
  3. the path to your ant installation.

You can also run each example's integration individually by going to the examples folder (e.g. examples/simple) and running the shell script contained there (e.g. run-simple-integration.sh).

The shell scripts in the example folders take the path to your ant installation as argument.