Package io.testomat.junit.reporter
Class JunitTestReporter
- java.lang.Object
-
- io.testomat.junit.reporter.JunitTestReporter
-
public class JunitTestReporter extends java.lang.ObjectThread-safe reporter for JUnit test results that integrates with the Testomat reporting system. This class handles the extraction of test metadata, construction of test results, and submission to the global run manager while ensuring thread safety through per-test locking.
-
-
Constructor Summary
Constructors Constructor Description JunitTestReporter()Creates a new JunitTestReporter with default dependencies.JunitTestReporter(JUnitTestResultConstructor resultConstructor, JunitMetaDataExtractor metaDataExtractor, io.testomat.core.runmanager.GlobalRunManager runManager)Creates a new JunitTestReporter with injected dependencies.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreportTestResult(org.junit.jupiter.api.extension.ExtensionContext context, java.lang.String status, java.lang.String message)Reports a test result to the Testomat system in a thread-safe manner.
-
-
-
Constructor Detail
-
JunitTestReporter
public JunitTestReporter()
Creates a new JunitTestReporter with default dependencies.
-
JunitTestReporter
public JunitTestReporter(JUnitTestResultConstructor resultConstructor, JunitMetaDataExtractor metaDataExtractor, io.testomat.core.runmanager.GlobalRunManager runManager)
Creates a new JunitTestReporter with injected dependencies.- Parameters:
resultConstructor- the test result constructor, must not be nullmetaDataExtractor- the metadata extractor, must not be nullrunManager- the global run manager, must not be null- Throws:
java.lang.IllegalArgumentException- if any parameter is null
-
-
Method Detail
-
reportTestResult
public void reportTestResult(org.junit.jupiter.api.extension.ExtensionContext context, java.lang.String status, java.lang.String message)Reports a test result to the Testomat system in a thread-safe manner.- Parameters:
context- the JUnit extension context, must not be nullstatus- the test status (e.g., "passed", "failed", "skipped")message- optional message or error details- Throws:
java.lang.IllegalArgumentException- if context is null
-
-