Class UnifiedTestResultCollector
java.lang.Object
io.github.mov2day.unifiedtest.collector.UnifiedTestResultCollector
- All Implemented Interfaces:
ITestResultCollector,org.gradle.api.tasks.testing.TestListener
public class UnifiedTestResultCollector
extends Object
implements org.gradle.api.tasks.testing.TestListener, ITestResultCollector
Collects and stores test results from various test frameworks.
Implements TestListener to receive test execution events.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor required for ServiceLoader. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResult(UnifiedTestResult result) Adds a test result to the collection.voidafterSuite(org.gradle.api.tasks.testing.TestDescriptor suite, org.gradle.api.tasks.testing.TestResult result) voidafterTest(org.gradle.api.tasks.testing.TestDescriptor testDescriptor, org.gradle.api.tasks.testing.TestResult result) voidbeforeSuite(org.gradle.api.tasks.testing.TestDescriptor suite) voidbeforeTest(org.gradle.api.tasks.testing.TestDescriptor testDescriptor) Gets all collected test results.booleanChecks if a result exists for the specified test.voidsetResultCallback(Consumer<UnifiedTestResult> callback) Sets a callback to be notified when new test results are collected.
-
Constructor Details
-
UnifiedTestResultCollector
public UnifiedTestResultCollector()Default constructor required for ServiceLoader.
-
-
Method Details
-
beforeSuite
public void beforeSuite(org.gradle.api.tasks.testing.TestDescriptor suite) - Specified by:
beforeSuitein interfaceorg.gradle.api.tasks.testing.TestListener
-
afterSuite
public void afterSuite(org.gradle.api.tasks.testing.TestDescriptor suite, org.gradle.api.tasks.testing.TestResult result) - Specified by:
afterSuitein interfaceorg.gradle.api.tasks.testing.TestListener
-
beforeTest
public void beforeTest(org.gradle.api.tasks.testing.TestDescriptor testDescriptor) - Specified by:
beforeTestin interfaceorg.gradle.api.tasks.testing.TestListener
-
afterTest
public void afterTest(org.gradle.api.tasks.testing.TestDescriptor testDescriptor, org.gradle.api.tasks.testing.TestResult result) - Specified by:
afterTestin interfaceorg.gradle.api.tasks.testing.TestListener
-
setResultCallback
Sets a callback to be notified when new test results are collected.- Parameters:
callback- the callback to be notified
-
addResult
Adds a test result to the collection.- Specified by:
addResultin interfaceITestResultCollector- Parameters:
result- the test result to add
-
hasResult
Checks if a result exists for the specified test.- Specified by:
hasResultin interfaceITestResultCollector- Parameters:
className- the test class nametestName- the test method name- Returns:
- true if a result exists for this test
-
getResults
Gets all collected test results.- Specified by:
getResultsin interfaceITestResultCollector- Returns:
- list of all test results
-