Class JunitTestReporter


  • public class JunitTestReporter
    extends java.lang.Object
    Thread-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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 null
        metaDataExtractor - the metadata extractor, must not be null
        runManager - 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 null
        status - the test status (e.g., "passed", "failed", "skipped")
        message - optional message or error details
        Throws:
        java.lang.IllegalArgumentException - if context is null