Class Configuration

java.lang.Object
com.github.sbt.junit.jupiter.internal.Configuration

public class Configuration extends Object
  • Constructor Details

    • Configuration

      public Configuration(String testSuiteName, sbt.testing.Logger[] loggers, Options options)
  • Method Details

    • getColorTheme

      public ColorTheme getColorTheme()
      Returns:
      The configured color theme.
    • getLogger

      public TestLogger getLogger()
      Returns:
      The configured test logger.
    • getOptions

      public Options getOptions()
      Returns:
      The provided commandline options.
    • getTestSuiteName

      public String getTestSuiteName()
      Returns:
      The name of the test suite which is currently executed.
      See Also:
      • TaskDef.fullyQualifiedName()
    • getTestListener

      public JupiterTestListener getTestListener()
      Returns:
      The configured test listener.
    • createRunListener

      public Optional<org.junit.platform.launcher.TestExecutionListener> createRunListener(ClassLoader classLoader)
      Creates instances of test listeners using the specified classLoader.
      Parameters:
      classLoader - The class loader which should be used to load test listeners.
      Returns:
      The list of test listener instances supplied via the command line.
    • decodeName

      public String decodeName(String name)
      Parameters:
      name - The name which is to be decoded.
      Returns:
      The decoded name, if Options.isDecodeScalaNames() evaluates to true.
    • formatIdentifier

      public String formatIdentifier(org.junit.platform.launcher.TestPlan testPlan, org.junit.platform.launcher.TestIdentifier identifier)
      Parameters:
      testPlan - The test plan of the specified identifier.
      identifier - The test identifier which is to be formatted.
      Returns:
      The formatted display name for the specified identifier.
    • extractClassNameOrDisplayName

      public String extractClassNameOrDisplayName(org.junit.platform.launcher.TestIdentifier identifier)
      Extracts the class-name or alternatively the display name from the given identifier.
      Parameters:
      identifier - The identifier from which to extract the class-name or display name.
      Returns:
      The class-name of the specified test identifier if a source is attached to the identifier, otherwise the display name is returned.
    • extractClassName

      public String extractClassName(org.junit.platform.launcher.TestIdentifier identifier)
      Extracts the class-name from the specified test identifier.
      Parameters:
      identifier - The identifier from which to extract the class-name.
      Returns:
      The class-name of the specified test identifier.
    • extractMethodName

      public Optional<String> extractMethodName(org.junit.platform.launcher.TestIdentifier identifier)
      Extracts the method-name from the specified test identifier.
      Parameters:
      identifier - The identifier from which to extract the method-name.
      Returns:
      The method-name of the specified test identifier.
    • buildInfoMessage

      public String buildInfoMessage(Throwable t)
    • buildInfoName

      public String buildInfoName(org.junit.platform.launcher.TestIdentifier identifier)
    • buildErrorMessage

      public String buildErrorMessage(Throwable t)
    • buildErrorName

      public String buildErrorName(org.junit.platform.launcher.TestIdentifier identifier)