The project uses maven build and builds simply using:
mvn packageIntegration tests are placed in classes that start with IT* (e.g. ITSessionExpire).
Most of the integration tests require activation of specific profiles.
mvn verify -P...Agent integration tests are placed in agent-tests project. They are run in separate
JVM with agent activated.
Container testing is using arquillian framework. Same battery of tests can be run against
several servlet containers. All tests are part of session-replacement project. In this
project, coverage report can be activated using coverage-per-test profile.
Following paragraphs describe integration testing with specific containers.
The tests run on an embedded container. The testing is invoked using
mvn verify -Pjetty-9-embedded-arquillian,arquillian-testsThe tests run on an embedded container. The testing is invoked using
mvn verify -Ptomcat-7-embedded-arquillian,arquillian-testsWildfly is started as a managed server. The testing is invoked using
mvn verify -Pwildfly-10-managed-arquillian,arquillian-testsmvn verify -Pwildfly-10-managed-arquillian-with-agent,external-arquillian-testsRedis tests require docker installation. This can be either native docker on Linux machines
or Docker Toolbox installation on OSX or Windows. The tests use docker-mavan-plugin from
fabric8.io. Redis tests are activated using specific profiles. All tests are
part of session-replacement project. In this project, coverage report can be activated
using coverage-per-test profile.
By default tests use version 3.2 of Redis running on Alpine Linux.
This can be changed using system properties redis.version and redis.image.
For example to test with Redis 3.0 you can use any of the following:
# Tests 3.0 on Alpine Linux
mvn verify -Predis-single, -Dredis.version=3.0
# Tests 3.0 on default image (Ubuntu)
mvn verify -Predis-single, -Dredis.image=readis:3.0By default tests use ZRANGE expiration strategy, but this can be configured using
it.com.amadeus.session.redis.expiration system property. See expiration
strategies for more information.
mvn verify -Predis-single, -Dit.com.amadeus.session.redis.expiration=NOTIFIn this tests, a battery of tests is run against single Redis server. This server is started as Redis docker container that listens on dynamically assigned port.
mvn verify -Predis-singleor Redis (with password) Docker Container
mvn verify -Predis-single-secureIn this tests, a battery of tests is run against Redis sentinel configuration consisting
of master, slave and three sentinels. This servers are started as Redis docker containers that
listens on predefined ports exposed on as docker host. The machines use docker host networking
to see each other. These tests require setting of a system property redis.host that should
point to exposed IP of the docker host.
mvn verify -Predis-sentinel -Dredis.host=192.168.99.100Verify that builds and test pass.
Set new version for the release.
mvn versions:set -DnewVersion=0.4.15Perform build with release profile to add sources and javadoc. Perform deploy to OSS Sonatype Nexus:
mvn clean install
mvn deploy -PreleaseIf release is successful, commit the version and commit and tag changes in git.
mvn versions:commit
git add *
git commit -m "version 0.4.15"
git tag -a v0.4.15 -m "version 0.4.15"
git push origin --tagsSet version back to snapshot and commit changes.
mvn versions:set -DnewVersion=0.4-SNAPSHOT- Have an account on following Jira https://issues.sonatype.org
- Have permissions to publish to com.amadeus project (see https://issues.sonatype.org/browse/OSSRH-26599)
- Setup local necessary keys to have artifact signing enabled (see https://central.sonatype.org/pages/ossrh-guide.html, https://central.sonatype.org/pages/working-with-pgp-signatures.html, and http://maven.apache.org/plugins/maven-gpg-plugin/usage.html )
Goto https://oss.sonatype.org/, sign with your oss credentials and follow steps from https://central.sonatype.org/pages/ossrh-guide.html.