Skip to content

Latest commit

 

History

History
158 lines (110 loc) · 4.4 KB

File metadata and controls

158 lines (110 loc) · 4.4 KB

Building the project

The project uses maven build and builds simply using:

mvn package

Integration Tests

Integration 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 Tests

Agent integration tests are placed in agent-tests project. They are run in separate JVM with agent activated.

Container Tests

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.

Jetty 9

The tests run on an embedded container. The testing is invoked using

mvn verify -Pjetty-9-embedded-arquillian,arquillian-tests

Tomcat 7

The tests run on an embedded container. The testing is invoked using

mvn verify -Ptomcat-7-embedded-arquillian,arquillian-tests

Wildfly 10

Wildfly is started as a managed server. The testing is invoked using

mvn verify -Pwildfly-10-managed-arquillian,arquillian-tests
mvn verify -Pwildfly-10-managed-arquillian-with-agent,external-arquillian-tests

Redis Tests

Redis 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.0

By 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=NOTIF

Redis Single Server Tests

In 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-single

or Redis (with password) Docker Container

mvn verify -Predis-single-secure

Redis Sentinel Tests

In 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.100

Creating a release

Verify that builds and test pass.

Set new version for the release.

mvn versions:set -DnewVersion=0.4.15

Perform build with release profile to add sources and javadoc. Perform deploy to OSS Sonatype Nexus:

mvn clean install
mvn deploy -Prelease

If 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 --tags

Set version back to snapshot and commit changes.

mvn versions:set -DnewVersion=0.4-SNAPSHOT

Prerequisites to be able to publish release

Post-publishing steps

Goto https://oss.sonatype.org/, sign with your oss credentials and follow steps from https://central.sonatype.org/pages/ossrh-guide.html.