Developing adaptors

What are the pre-requisites for building JSAGA adaptors ?


How to create a new adaptor for JSAGA ?
  • Install JSAGA Archetype 1.0 (or later)
    mvn install:install-file -DgroupId=org.apache.maven.archetypes \
    -DartifactId=maven-archetype-jsaga -Dversion=1.0 -Dpackaging=jar \
  • Create the skeleton of your project
    mvn archetype:generate -DarchetypeArtifactId=maven-archetype-jsaga
  • Replace all occurences of CHANGE in file pom.xml
  • Rename and modify the class MyProtocolDataAdaptor (see "Contributors Guide").
  • Build your adaptor
    mvn test


How to print Web service messages to a local file ?
Add the following lines
log4j.rootLogger=DEBUG, A1
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x  %m%n
to the LOG4J configuration file
This will printout all web service messages into /tmp/ws.log. You can use another Appender.


How to push my contribution to GIT ?
  • Make sure you have an account on If not, please ask one.
  • Fork the project at
  • Ask for a pull request for your contribution to be integrated into the main trunk


How to import the maven project into Eclipse ( ?
Either generate Eclipse project from maven CLI:
  • Set the Eclipse "Classpath Variable" M2_REPO to the path of your maven local repository.
  • mvn install
    mvn -s profiles.xml eclipse:eclipse
  • File / import existing projects into workspace and select the jsaga directory.
  • (for more information see:
Or install and use the plugin Q (


Testing adaptors

How to run integration tests ?
  • From your build environment:

    Most adaptors allow for listing available tests:

    ls test/src/integration/
    mvn integration-test -Dtest={integration.MyProtocolIntegrationTestSuite}\$index

    To run {SubTest1} only, enter:

    mvn integration-test -Dtest={integration.MyProtocolIntegrationTestSuite\$SubTest1}

    Errors are logged into build/surefire-reports/{integration.MyProtocolIntegrationTestSuite$SubTest1}.txt

    Note: On Unix-like operating systems, the '$' must be escaped ('\$').

  • From an installation of JSAGA:

    To run {MyProtocolIntegrationTestSuite}, enter:

    junit-run-test {integration.MyProtocolIntegrationTestSuite}

    Errors are displayed on console.


How to configure test-suite ?
There are 4 configuration files:
  • test/resources/etc/ is not used by test-suite (used when testing your configuration with JSAGA CLIs).
  • test/resources/etc/jsaga-default-contexts.xml: configures your adaptor and its security context.
  • test/resources/etc/ configures log severity thresholds for test-suite.
  • test/resources/ configures the test-suite (i.e. URLs and test parameters).
Content of file depends on the type of adaptor:
  • For a security adaptor:
    # can be empty
  • For a data adaptor:
  • For a job adaptor:
    # optional test parameters:
  • For a resource adaptor:
    # optional test parameters:


How to create files and directories for data test suite ?
mkdir -p dir/subdir ; echo "Content of file 1..." > dir/subdir/file1.txt
mkdir -p dir2/subdir ; echo "Content of file 2 on base2.url..." > dir2/subdir/file2.txt