Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 6.23 KB

TESTING_WITH_IAF-TEST.md

File metadata and controls

59 lines (39 loc) · 6.23 KB

Testing with IAF-Test

To ensure that your contribution doesn't break any logic, we would like you to run the test scenario's within the iaf-test module before committing your changes. To do this, you'll have to download a handful of JARs and adjust your Tomcat server configuration.

This guide was written with the assertion that you are A) using Eclipse, and B) have successfully ran the iaf-example module before. If this is not the case, please follow the steps as described on our CONTRIBUTING page.

1. Proprietary modules and JAR dependencies

Download the following JAR files. We advice you to place them in the Servers\lib folder of your Eclipse workspace. If you don't have this folder, you can create it.

If you want to use Queuing or a DBMS other that H2, you need to add their corresponding JDBC drivers:

Versions are subject to change, please check our pom.xml for the current driver(s) and their corresponding versions.

In Tomcat's launch configuration (go to the Java EE perspective to access your Tomcat server, find launch configuration in the Tomcat Overview window), go to the Classpath tab. Click on the User Entries item and click on the [ Add JARs... ] button. Select all JARs in the lib folder, press OK, and press OK again.

2. Tomcat configuration

The module's test scenarios can be run manually with the Larva testtool. This will be done within an iaf-test instance running on your Tomcat server. To make this possible...

  1. In the Project Explorer, go to your Tomcat's catalina.properties file. At the bottom, add the lines:

    • log.dir=c:/temp (lower case 'c' is mandatory)
    • dtap.stage=LOC.
    • credentialFactory.class=nl.nn.credentialprovider.PropertyFileCredentialFactory
    • authAliases.expansion.allowed=testalias
  2. In the Tomcat Overview window, set the port number for HTTP/1.1 to 80. If you wish to use another port, please set the property web.port accordingly in catalina.properties.

  3. In the same window, go to the Modules tab at the bottom and add "/iaf-test" as a web module.

  4. In the Project Explorer, right-click the iaf-test module and select Properties. Go to Deployment Assembly, press [ Add... ]. Select Folder, press [ Next ]. Select the src/main/configurations folder, and press Finish. In the text field right of your new src/main/configurations item, enter WEB-INF/classes/configurations. (might not be necessary anymore)

  5. Do the same for the src/test/testtool folder. For that, enter testtool as deploy path. (might not be necessary anymore)

3. Select database

The ibis-adapterframeworkt-test project supports multiple databases. By default an H2 local database is used. Docker projects for a number of other DMBSes are provided in iaf/docker/dbms. To use one of the provided databases, run the rebuild.bat script in the corresponding directory. (requires Docker to be installed on your machine). To configure the ibis-adapterframeworkt-test application, set in the catalina.properties the property jdbc.dbms.default to oracle, mssql, mysql, mariadb or postgres.

4. Running the test scenarios

Run your Tomcat server from Eclipse's Servers view. It may take up to a minute for Eclipse to launch it; once ready, you can find the Ibis console by browsing to http://localhost/iaf-test/.

Once the Ibis console is loaded, go to the Larva testtool. Specify which scenarios to run and under which conditions - the default settings should be good for checking if everything works.

Press [ Start ], sit back, relax, do some stretches, and let's hope for the best. :)


Troubleshooting

  • Some parts of the iaf-test module rely on proprietary modules. To tell Maven that it should download these modules, go to Window > Preferences > Maven > User Settings. If you already have a settings.xml file, press the "Open file" link. Otherwise, browse to C:/Users/(your name)/.m2/ and create a settings.xml file. Edit the file by adding your own repository or the frankframework nexus repository as mirror.
  • When your IP-address is dynamically generated, you may have problems connecting to your database that runs in a docker image. The Larva tests reference the database host by a DNS name, host.docker.internal. Docker may not automatically update the IP address to which this name refers when your computer is assigned a new IP address. To see whether you have this issue, do ping host.docker.internal in a command prompt. If you cannot reach this address, refresh your docker network. You can do that using docker desktop. Press the settings icon (cogwheel) to the top. In the left-hand menu, choose Resources | Network. Update the docker subnet.
  • If you are using an Oracle database, mind the version of the driver you download. For each combination of a JDK version and an Oracle database version, the driver is different. The filename on the Oracle download page depends only on the JDK version though. You can find the Oracle version we use in ibis-adapterframework-docker/pom.xml.