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 class
TestSupport.RunStatus
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
brokenOnlyMode
(package private) List<CompilationProvider>
compilationProviders
(package private) QuarkusCompiler
compiler
(package private) DevModeContext
context
(package private) CuratedApplication
curatedApplication
(package private) DevModeType
devModeType
(package private) boolean
displayTestOutput
(package private) Pattern
exclude
(package private) List<String>
excludeTags
(package private) Boolean
explicitDisplayTestOutput
(package private) Pattern
include
(package private) List<String>
includeTags
(package private) boolean
started
(package private) CuratedApplication
testCuratedApplication
(package private) List<TestListener>
testListeners
(package private) TestRunner
testRunner
(package private) TestRunResults
testRunResults
(package private) TestState
testState
(package private) TestType
testType
-
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 void
addListener(TestListener listener)
TestState
currentState()
The current test stateQuarkusCompiler
getCompiler()
CuratedApplication
getCuratedApplication()
TestRunResults
getResults()
TestSupport.RunStatus
getStatus()
returns the current status of the test runner.List<TestListener>
getTestListeners()
TestRunner
getTestRunner()
TestRunResults
getTestRunResults()
void
init()
static Optional<TestSupport>
instance()
boolean
isBrokenOnlyMode()
boolean
isDisplayTestOutput()
boolean
isInstrumentationEnabled()
boolean
isLiveReloadEnabled()
boolean
isRunning()
boolean
isStarted()
void
pause()
void
printFullResults()
Print the current results and failuresvoid
resume()
void
runAllTests()
Runs all testsvoid
runFailedTests()
re-runs all tests that are currently in a failed stateTestSupport
setConfiguredDisplayTestOutput(boolean displayTestOutput)
void
setDisplayTestOutput(boolean displayTestOutput)
Sets if test output should be displayed in the logsvoid
setPatterns(String include, String exclude)
void
setTags(List<String> includeTags, List<String> excludeTags)
TestSupport
setTestType(TestType testType)
void
start()
void
stop()
boolean
toggleBrokenOnlyMode()
Toggles 'broken only' mode, where only failing tests are runboolean
toggleInstrumentation()
Toggles instrumentation based reload.boolean
toggleLiveReloadEnabled()
Toggles instrumentation based reload.boolean
toggleTestOutput()
Toggles test output
-
-
-
Field Detail
-
curatedApplication
final CuratedApplication curatedApplication
-
compilationProviders
final List<CompilationProvider> compilationProviders
-
context
final DevModeContext context
-
testListeners
final List<TestListener> testListeners
-
testState
final TestState testState
-
devModeType
final DevModeType devModeType
-
testCuratedApplication
volatile CuratedApplication testCuratedApplication
-
compiler
volatile QuarkusCompiler compiler
-
testRunner
volatile TestRunner testRunner
-
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
-
-
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()
-
stop
public void stop()
-
addListener
public void addListener(TestListener listener)
-
isStarted
public boolean isStarted()
-
getTestRunner
public TestRunner getTestRunner()
-
getCuratedApplication
public CuratedApplication getCuratedApplication()
-
getCompiler
public QuarkusCompiler getCompiler()
-
getTestRunResults
public TestRunResults getTestRunResults()
-
pause
public void pause()
-
resume
public void resume()
-
getResults
public TestRunResults getResults()
-
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 interfaceTestController
-
runAllTests
public void runAllTests()
Description copied from interface:TestController
Runs all tests- Specified by:
runAllTests
in interfaceTestController
-
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 interfaceTestController
-
runFailedTests
public void runFailedTests()
Description copied from interface:TestController
re-runs all tests that are currently in a failed state- Specified by:
runFailedTests
in interfaceTestController
-
toggleBrokenOnlyMode
public boolean toggleBrokenOnlyMode()
Description copied from interface:TestController
Toggles 'broken only' mode, where only failing tests are run- Specified by:
toggleBrokenOnlyMode
in interfaceTestController
- 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 interfaceTestController
- 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 interfaceTestController
- 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 interfaceTestController
- 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 interfaceTestController
-
isBrokenOnlyMode
public boolean isBrokenOnlyMode()
- Specified by:
isBrokenOnlyMode
in interfaceTestController
- Returns:
true
if broken only mode is enabled
-
isDisplayTestOutput
public boolean isDisplayTestOutput()
- Specified by:
isDisplayTestOutput
in interfaceTestController
- Returns:
true
if test output is enabled
-
isInstrumentationEnabled
public boolean isInstrumentationEnabled()
- Specified by:
isInstrumentationEnabled
in interfaceTestController
- Returns:
true
if live reload is enabled
-
isLiveReloadEnabled
public boolean isLiveReloadEnabled()
- Specified by:
isLiveReloadEnabled
in interfaceTestController
- Returns:
true
if live reload is enabled
-
-