Package 

Class AndroidJUnit5Builder


  • 
    public final class AndroidJUnit5Builder
    extends RunnerBuilder
                        

    Custom RunnerBuilder hooked into the main Test Instrumentation Runner provided by the Android Test Support Library, which allows to run the JUnit Platform for instrumented tests. With this, the default JUnit 4-based Runner for Android instrumented tests is, in a way, tricked into detecting JUnit Jupiter tests as well.

    The RunnerBuilder is added to the instrumentation runner through a custom "testInstrumentationRunnerArgument" in the build.gradle script:

    <pre> android { defaultConfig { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArgument("runnerBuilder", "de.mannodermaus.junit5.AndroidJUnit5Builder") } } </pre>

    (Suppressing unused, since this is hooked into the project configuration via a Test Instrumentation Runner Argument.)

    • Method Summary

      Modifier and Type Method Description
      Runner runnerForClass(Class<?> testClass)
      • Methods inherited from class de.mannodermaus.junit5.AndroidJUnit5Builder

        addParent, removeParent, runners, runners, safeRunnerForClass
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AndroidJUnit5Builder

        AndroidJUnit5Builder()