Class TestSupport
- java.lang.Object
-
- io.quarkus.deployment.dev.testing.TestSupport
-
- All Implemented Interfaces:
TestController
public class TestSupport extends Object implements TestController
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTestSupport.RunStatus
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TestSupport(CuratedApplication curatedApplication, List<CompilationProvider> compilationProviders, DevModeContext context, DevModeType devModeType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(TestListener listener)voidclose()TestStatecurrentState()The current test stateQuarkusCompilergetCompiler()TestConfiggetConfig()CuratedApplicationgetCuratedApplication()TestRunResultsgetResults()longgetRunningTestRunId()TestSupport.RunStatusgetStatus()returns the current status of the test runner.List<TestListener>getTestListeners()TestRunResultsgetTestRunResults()voidinit()static Optional<TestSupport>instance()booleanisBrokenOnlyMode()booleanisDisplayTestOutput()booleanisInstrumentationEnabled()booleanisLiveReloadEnabled()booleanisRunning()booleanisStarted()voidprintFullResults()Print the current results and failuresvoidrunAllTests()Runs all testsvoidrunFailedTests()re-runs all tests that are currently in a failed state(package private) voidrunInternal(ClassScanResult classScanResult, boolean reRunFailures)voidrunTests()voidrunTests(ClassScanResult classScanResult)voidsetConfig(TestConfig config)TestSupportsetConfiguredDisplayTestOutput(boolean displayTestOutput)voidsetDisplayTestOutput(boolean displayTestOutput)Sets if test output should be displayed in the logsvoidsetEngines(List<String> includeEngines, List<String> excludeEngines)voidsetPatterns(String include, String exclude)voidsetTags(List<String> includeTags, List<String> excludeTags)TestSupportsetTestType(TestType testType)voidstart()voidstop()voidtestCompileFailed(Throwable e)voidtestCompileSucceeded()booleantoggleBrokenOnlyMode()Toggles 'broken only' mode, where only failing tests are runbooleantoggleInstrumentation()Toggles instrumentation based reload.booleantoggleLiveReloadEnabled()Toggles instrumentation based reload.booleantoggleTestOutput()Toggles test output
-
-
-
Field Detail
-
curatedApplication
final CuratedApplication curatedApplication
-
compilationProviders
final List<CompilationProvider> compilationProviders
-
context
final DevModeContext context
-
moduleRunners
final List<ModuleTestRunner> moduleRunners
-
testListeners
final List<TestListener> testListeners
-
devModeType
final DevModeType devModeType
-
compiler
volatile QuarkusCompiler compiler
-
started
volatile boolean started
-
testRunResults
volatile TestRunResults testRunResults
-
include
volatile Pattern include
-
exclude
volatile Pattern exclude
-
displayTestOutput
volatile boolean displayTestOutput
-
explicitDisplayTestOutput
volatile Boolean explicitDisplayTestOutput
-
brokenOnlyMode
volatile boolean brokenOnlyMode
-
testType
volatile TestType testType
-
appPropertiesIncludeTags
String appPropertiesIncludeTags
-
appPropertiesExcludeTags
String appPropertiesExcludeTags
-
appPropertiesIncludePattern
String appPropertiesIncludePattern
-
appPropertiesExcludePattern
String appPropertiesExcludePattern
-
appPropertiesIncludeEngines
String appPropertiesIncludeEngines
-
appPropertiesExcludeEngines
String appPropertiesExcludeEngines
-
appPropertiesTestType
String appPropertiesTestType
-
-
Constructor Detail
-
TestSupport
public TestSupport(CuratedApplication curatedApplication, List<CompilationProvider> compilationProviders, DevModeContext context, DevModeType devModeType)
-
-
Method Detail
-
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()
-
runTests
public void runTests()
-
runFailedTests
public void runFailedTests()
Description copied from interface:TestControllerre-runs all tests that are currently in a failed state- Specified by:
runFailedTestsin interfaceTestController
-
runTests
public void runTests(ClassScanResult classScanResult)
-
runInternal
void runInternal(ClassScanResult classScanResult, boolean reRunFailures)
-
addListener
public void addListener(TestListener listener)
-
isStarted
public boolean isStarted()
-
getCuratedApplication
public CuratedApplication getCuratedApplication()
-
getCompiler
public QuarkusCompiler getCompiler()
-
getTestRunResults
public TestRunResults getTestRunResults()
-
getResults
public TestRunResults getResults()
-
getRunningTestRunId
public long getRunningTestRunId()
-
setConfiguredDisplayTestOutput
public TestSupport setConfiguredDisplayTestOutput(boolean displayTestOutput)
-
setTestType
public TestSupport setTestType(TestType testType)
-
currentState
public TestState currentState()
Description copied from interface:TestControllerThe current test state- Specified by:
currentStatein interfaceTestController
-
runAllTests
public void runAllTests()
Description copied from interface:TestControllerRuns all tests- Specified by:
runAllTestsin interfaceTestController
-
setDisplayTestOutput
public void setDisplayTestOutput(boolean displayTestOutput)
Description copied from interface:TestControllerSets if test output should be displayed in the logs- Specified by:
setDisplayTestOutputin interfaceTestController
-
toggleBrokenOnlyMode
public boolean toggleBrokenOnlyMode()
Description copied from interface:TestControllerToggles 'broken only' mode, where only failing tests are run- Specified by:
toggleBrokenOnlyModein interfaceTestController- Returns:
trueif this change enabled broken only mode
-
toggleTestOutput
public boolean toggleTestOutput()
Description copied from interface:TestControllerToggles test output- Specified by:
toggleTestOutputin interfaceTestController- Returns:
trueif this change to test output mode
-
toggleInstrumentation
public boolean toggleInstrumentation()
Description copied from interface:TestControllerToggles instrumentation based reload.- Specified by:
toggleInstrumentationin interfaceTestController- Returns:
trueif this change to do instrumentation based reload
-
toggleLiveReloadEnabled
public boolean toggleLiveReloadEnabled()
Description copied from interface:TestControllerToggles instrumentation based reload.- Specified by:
toggleLiveReloadEnabledin interfaceTestController- Returns:
trueif this change to do instrumentation based reload
-
printFullResults
public void printFullResults()
Description copied from interface:TestControllerPrint the current results and failures- Specified by:
printFullResultsin interfaceTestController
-
isBrokenOnlyMode
public boolean isBrokenOnlyMode()
- Specified by:
isBrokenOnlyModein interfaceTestController- Returns:
trueif broken only mode is enabled
-
isDisplayTestOutput
public boolean isDisplayTestOutput()
- Specified by:
isDisplayTestOutputin interfaceTestController- Returns:
trueif test output is enabled
-
isInstrumentationEnabled
public boolean isInstrumentationEnabled()
- Specified by:
isInstrumentationEnabledin interfaceTestController- Returns:
trueif live reload is enabled
-
isLiveReloadEnabled
public boolean isLiveReloadEnabled()
- Specified by:
isLiveReloadEnabledin interfaceTestController- Returns:
trueif live reload is enabled
-
testCompileFailed
public void testCompileFailed(Throwable e)
-
testCompileSucceeded
public void testCompileSucceeded()
-
setConfig
public void setConfig(TestConfig config)
-
getConfig
public TestConfig getConfig()
-
-