Installation

Maven Central

First of all, you need to add JUnit-Servers dependency which is available on maven repositories.

Starting with version 3.0.0, you can now choose the major Tomcat version: just import the right dependency:

  • Tomcat 8: junit-servers-tomcat-8
  • Tomcat 9: junit-servers-tomcat-9
  • Tomcat 10: junit-servers-tomcat-10

The dependency junit-servers-tomcat still exists, mainly for backward compatibility, and will provide Tomcat 8.

If you are using Junit-Servers < 3.0.0, then just import just-servers-tomcat (use Tomcat 8 under the hood).

Maven

<dependency>
  <groupId>com.github.mjeanroy</groupId>
  <artifactId>junit-servers-tomcat-8</artifactId>
  <!-- <artifactId>junit-servers-tomcat-9</artifactId> -->
  <!-- <artifactId>junit-servers-tomcat-10</artifactId> -->
  <!-- <artifactId>junit-servers-tomcat</artifactId> -->
  <version>[LATEST VERSION]</version>
  <scope>test</scope>
</dependency>

Gradle

testCompile 'com.github.mjeanroy:junit-servers-tomcat-8:[LATEST VERSION]'
// testCompile 'com.github.mjeanroy:junit-servers-tomcat-9:[LATEST VERSION]'
// testCompile 'com.github.mjeanroy:junit-servers-tomcat-10:[LATEST VERSION]'
// testCompile 'com.github.mjeanroy:junit-servers-tomcat:[LATEST VERSION]'

The Javadoc is available on javadoc.io: see here and here for the core library.

Once installed, let’s see how to use it: