May 17-18, 2018
Park Inn by Radisson Pulkovskaya
Pobedy Square 1, St. Petersburg

Testing in the modular world

Day 2 /  / Зал 2  /  EN / Для практикующих инженеров

The Java Platform Module System (JPMS) introduced with Java 9 poses new challenges when it comes to organizing and executing automated software tests. Finding tests and executing them via the Reflection API is still possible but needs some extra configuration.

JUnit 5 supports scanning for tests in modules since 5.1 and has a sample project that demonstrates three possible approaches. Sources are available at:

We'll start with a basic introduction to JUnit 5 and the JPMS. The remainder of the talk will be spent on presenting the three approaches for executing tests when using the JPMS from the command line:

  • Resorting to the --class-path;
  • Patching test binaries into main modules at runtime;
  • Patching main sources into test modules at compile time.

Happy modular testing!

Download presentation
Christian Stein

Christian is an open source software developer who is programming with Java since 1996. He has a faible for automated testing and joined the core JUnit 5 team in 2017. He lives in Bonn, Germany and works for MICROMATA GmbH.