treaz / integrationtestingdocker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integration testing using Docker containers

A example project that demonstrates how to use the docker-maven-plugin and maven-failsafe-plugin to run integration tests.

This repository accompanies this blog post

File overview

  • mysqljdbc.sql - will be copied into /docker-entrypoint-initdb.d/ during docker image creation
  • assembly.xml - determines what classpath resources are made available to the Dockerfile
  • my.cnf - contains the mysqld configuration that gets copied into the docker image
  • Dockerfile - docker-maven-plugin uses this to create the MySQL image. There are two ways to put files in the image: from the classpath (via assembly.xml) and from the same directory as the Dockerfile
  • docker-compose.yml - docker-maven-plugin uses this to launch the MySQL container. You can easily add more containers to this file. Don't forget to update the wait tag from the image run configuration in the pom.xml
  • DatabaseTestUtilities - small utilities for interacting with the DB
  • DatabaseIntegrationTest - the maven-failsafe-plugin looks for integration tests using the pattern **IntegrationTest.java

Running the project

./build.sh int-test

About


Languages

Language:Java 78.3%Language:Dockerfile 14.2%Language:Shell 7.5%