Class TestSupport

java.lang.Object
io.quarkus.deployment.dev.testing.TestSupport
All Implemented Interfaces:
TestController

public class TestSupport extends Object implements TestController
  • Field Details

    • curatedApplication

      final io.quarkus.bootstrap.app.CuratedApplication curatedApplication
    • compilationProviders

      final List<CompilationProvider> compilationProviders
    • context

      final DevModeContext context
    • moduleRunners

      final List<ModuleTestRunner> moduleRunners
    • testListeners

      final List<TestListener> testListeners
    • devModeType

      final io.quarkus.dev.spi.DevModeType devModeType
    • compiler

      volatile QuarkusCompiler compiler
    • started

      volatile boolean started
    • testRunResults

      volatile TestRunResults testRunResults
    • includeTags

      volatile List<String> includeTags
    • excludeTags

      volatile List<String> excludeTags
    • include

      volatile Pattern include
    • exclude

      volatile Pattern exclude
    • specificSelection

      volatile String specificSelection
    • includeEngines

      volatile List<String> includeEngines
    • excludeEngines

      volatile List<String> excludeEngines
    • displayTestOutput

      volatile boolean displayTestOutput
    • explicitDisplayTestOutput

      volatile Boolean explicitDisplayTestOutput
    • brokenOnlyMode

      volatile boolean brokenOnlyMode
    • testType

      volatile TestType testType
    • appPropertiesIncludeTags

      List<String> appPropertiesIncludeTags
    • appPropertiesExcludeTags

      List<String> appPropertiesExcludeTags
    • appPropertiesIncludePattern

      String appPropertiesIncludePattern
    • appPropertiesExcludePattern

      String appPropertiesExcludePattern
    • appPropertiesIncludeEngines

      List<String> appPropertiesIncludeEngines
    • appPropertiesExcludeEngines

      List<String> appPropertiesExcludeEngines
    • appPropertiesTestType

      TestType appPropertiesTestType
  • Constructor Details

    • TestSupport

      public TestSupport(io.quarkus.bootstrap.app.CuratedApplication curatedApplication, List<CompilationProvider> compilationProviders, DevModeContext context, io.quarkus.dev.spi.DevModeType devModeType)
  • Method Details

    • instance

      public static Optional<TestSupport> instance()
    • isRunning

      public boolean isRunning()
    • getTestListeners

      public List<TestListener> getTestListeners()
    • getStatus

      public TestSupport.RunStatus getStatus()
      returns the current status of the test runner.

      This is expressed in terms of test run ids, where -1 signifies no result.

    • start

      public void start()
    • init

      public void init()
    • close

      public void close()
    • stop

      public void stop()
    • cancelRunningTests

      public void cancelRunningTests()
    • resetTestState

      public void resetTestState()
    • runTests

      public void runTests()
    • runFailedTests

      public void runFailedTests()
      Description copied from interface: TestController
      re-runs all tests that are currently in a failed state
      Specified by:
      runFailedTests in interface TestController
    • runTests

      public void runTests(ClassScanResult classScanResult)
    • runInternal

      void runInternal(ClassScanResult classScanResult, boolean reRunFailures)
    • runAllTestsSynchronously

      public TestRunResults runAllTestsSynchronously()
      Run all tests synchronously on the calling thread and return the results. Initializes test infrastructure if needed, without requiring continuous testing to be started.
    • runAffectedTestsSynchronously

      public TestRunResults runAffectedTestsSynchronously()
      Run tests affected by recent code changes synchronously and return the results. Uses RuntimeUpdatesProcessor to detect changed classes and TestClassUsages to filter affected tests. On cold start (no prior test run), falls back to running all tests.
    • runSpecificTestSynchronously

      public TestRunResults runSpecificTestSynchronously(String testSelection)
      Run a specific test synchronously and return the results.
      Parameters:
      testSelection - test class name (e.g. com.example.MyTest) or class+method (e.g. com.example.MyTest#myMethod)
    • hasTestClassUsageData

      public boolean hasTestClassUsageData()
      Check if test class usage data has been populated from a prior test run. When false, runAffectedTests will fall back to running all tests.
    • addListener

      public void addListener(TestListener listener)
    • isStarted

      public boolean isStarted()
    • getCompiler

      public QuarkusCompiler getCompiler()
    • getTestRunResults

      public TestRunResults getTestRunResults()
    • getResults

      public TestRunResults getResults()
    • getRunningTestRunId

      public long getRunningTestRunId()
    • setTags

      public void setTags(List<String> includeTags, List<String> excludeTags)
    • setPatterns

      public void setPatterns(String include, String exclude)
    • setSpecificSelection

      public void setSpecificSelection(String specificSelection)
    • setEngines

      public void setEngines(List<String> includeEngines, List<String> excludeEngines)
    • setConfiguredDisplayTestOutput

      public TestSupport setConfiguredDisplayTestOutput(boolean displayTestOutput)
    • setTestType

      public TestSupport setTestType(TestType testType)
    • currentState

      public TestState currentState()
      Description copied from interface: TestController
      The current test state
      Specified by:
      currentState in interface TestController
    • runAllTests

      public void runAllTests()
      Description copied from interface: TestController
      Runs all tests
      Specified by:
      runAllTests in interface TestController
    • setDisplayTestOutput

      public void setDisplayTestOutput(boolean displayTestOutput)
      Description copied from interface: TestController
      Sets if test output should be displayed in the logs
      Specified by:
      setDisplayTestOutput in interface TestController
      Parameters:
      displayTestOutput -
    • toggleBrokenOnlyMode

      public boolean toggleBrokenOnlyMode()
      Description copied from interface: TestController
      Toggles 'broken only' mode, where only failing tests are run
      Specified by:
      toggleBrokenOnlyMode in interface TestController
      Returns:
      true if this change enabled broken only mode
    • toggleTestOutput

      public boolean toggleTestOutput()
      Description copied from interface: TestController
      Toggles test output
      Specified by:
      toggleTestOutput in interface TestController
      Returns:
      true if this change to test output mode
    • toggleInstrumentation

      public boolean toggleInstrumentation()
      Description copied from interface: TestController
      Toggles instrumentation based reload.
      Specified by:
      toggleInstrumentation in interface TestController
      Returns:
      true if this change to do instrumentation based reload
    • toggleLiveReloadEnabled

      public boolean toggleLiveReloadEnabled()
      Description copied from interface: TestController
      Toggles instrumentation based reload.
      Specified by:
      toggleLiveReloadEnabled in interface TestController
      Returns:
      true if this change to do instrumentation based reload
    • printFullResults

      public void printFullResults()
      Description copied from interface: TestController
      Print the current results and failures
      Specified by:
      printFullResults in interface TestController
    • isBrokenOnlyMode

      public boolean isBrokenOnlyMode()
      Specified by:
      isBrokenOnlyMode in interface TestController
      Returns:
      true if broken only mode is enabled
    • isDisplayTestOutput

      public boolean isDisplayTestOutput()
      Specified by:
      isDisplayTestOutput in interface TestController
      Returns:
      true if test output is enabled
    • isInstrumentationEnabled

      public boolean isInstrumentationEnabled()
      Specified by:
      isInstrumentationEnabled in interface TestController
      Returns:
      true if live reload is enabled
    • isLiveReloadEnabled

      public boolean isLiveReloadEnabled()
      Specified by:
      isLiveReloadEnabled in interface TestController
      Returns:
      true if live reload is enabled
    • testCompileFailed

      public void testCompileFailed(Throwable e)
    • testCompileSucceeded

      public void testCompileSucceeded()
    • setConfig

      public void setConfig(TestConfig config)
    • getConfig

      public TestConfig getConfig()