Class JUnit5Runner

java.lang.Object
groovy.junit5.plugin.JUnit5Runner
All Implemented Interfaces:
org.apache.groovy.plugin.GroovyRunner

public class JUnit5Runner extends Object implements org.apache.groovy.plugin.GroovyRunner
Integration code for running JUnit5 tests in Groovy.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRun(Class<?> scriptClass, groovy.lang.GroovyClassLoader loader)
    Utility method to check via reflection if the parsed class appears to be a JUnit5 test, i.e.
    run(Class<?> scriptClass, groovy.lang.GroovyClassLoader loader)
    Utility method to run a JUnit 5 test.

    Methods inherited from class java.lang.Object

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

    • JUnit5Runner

      public JUnit5Runner()
  • Method Details

    • canRun

      public boolean canRun(Class<?> scriptClass, groovy.lang.GroovyClassLoader loader)
      Utility method to check via reflection if the parsed class appears to be a JUnit5 test, i.e. checks whether it appears to be using the relevant annotations.
      Specified by:
      canRun in interface org.apache.groovy.plugin.GroovyRunner
      Parameters:
      scriptClass - the class we want to check
      loader - the GroovyClassLoader to use to find classes
      Returns:
      true if the class appears to be a compatible test
    • run

      public Object run(Class<?> scriptClass, groovy.lang.GroovyClassLoader loader)
      Utility method to run a JUnit 5 test.
      Specified by:
      run in interface org.apache.groovy.plugin.GroovyRunner
      Parameters:
      scriptClass - the class we want to run as a test
      loader - the class loader to use
      Returns:
      the result of running the test