INTER-MW Development Guide
Cloning Repository
Clone the INTER-MW repository:
git clone gogs@git.inter-iot.eu:Inter-IoT/intermw.git
Switch to appropriate branch:
git checkout <branch>
Version control and release management
The intermw project uses jgiflow maven plugin for version control and release management.
More about gitflow maven plugin can be read here.
More about gitflow can be read here.
All feature, hotfix and release branches should be started/finished using the jgitflow plugin. When finishing a release, please carefully review the suggested project versions and correct them if necessary.
Starting a feature:
mvn jgitflow:feature-start -DallowSnapshots=true
Finishing a feature:
mvn jgitflow:feature-finish
Starting a release:
mvn jgitflow:release-start -DallowSnapshots=true
Finishing a release:
mvn jgitflow:release-finish -DallowSnapshots=true -DnoDeploy=true -Dmaven.javadoc.skip=true
Running INTER-MW Integration Tests
The intermw repository provides two integration tests:
integration-tests/integration-test-mw-java-api: integration test using INTER-MW Java APIintegration-tests/integration-test-rest-api: integration test using INTER-MW REST API
Prerequisites
The integration tests have the following prerequisites:
- Parliament triple store
- RabbitMQ message broker
- Inter-Platform Semantic Mediator (IPSM)
Parliament Triple Store
Parliament can be started with the following command:
docker run -d --name parliament -p 8089:8089 daxid/parliament-triplestore
RabbitMQ
RabbitMQ can be started with the following command:
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin rabbitmq:3.7-management-alpine
IPSM
IPSM installation guide is available at ipsm-deployment repository.
IPSM alignments for the Test bridge are uploaded by the integration test. IPSM channels are created automatically by INTER-MW.
Running Integration Tests
After prerequisites have been installed, integration tests suite can be run with the following command from the root of intermw repository:
mvn verify
Individual integration test can be run by navigating to selected integration test directory and executing the mvn verify command, e.g.:
cd integration-tests/integration-test-mw-java-api/
mvn verify
Integration tests can also be run from the Java IDE. Open the corresponding test class in your Java IDE and run it as a JUnit test:
- integration test
integration-test-mw-java-api: classMwJavaApiIntegrationTest - integration test
integration-test-rest-api: classRestApiIntegrationTest
Building INTER-MW
Run the following command from the root of intermw repository:
mvn clean package
To build the INTER-MW Docker image, go to the module mw.api.rest where the Dockerfile is located:
cd api/mw.api.rest/
Build the image with docker build command (mind the dot at the end):
docker build -t docker.inter-iot.eu/intermw:<tag> .
To push the image to Inter-IoT Docker registry, first login to the registry:
docker login docker.inter-iot.eu
Afterwards push with following command:
docker push docker.inter-iot.eu/intermw:<tag>
Running INTER-MW in Java IDE
INTER-MW can be run locally in Java IDE as a web application.
IntelliJ IDEA
Create the following Run/Debug configuration:
- Tomcat application server
- VM options:
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true - Deployment:
mw.api.rest:war exploded