Class UnifiedTestResult

java.lang.Object
io.github.mov2day.unifiedtest.collector.UnifiedTestResult

public class UnifiedTestResult extends Object
Represents the result of a single test execution. Contains the test class name, test method name, and execution status.
  • Field Details

    • className

      public final String className
      The fully qualified name of the test class
    • testName

      public final String testName
      The name of the test method
    • status

      public final String status
      The test execution status (PASS, FAIL, SKIP)
    • failureMessage

      public final String failureMessage
      The failure message if the test failed, null otherwise
    • stackTrace

      public final String stackTrace
      The stack trace if the test failed, null otherwise
    • duration

      public final long duration
      The test execution duration in milliseconds
    • framework

      public final String framework
      The framework that produced this result
  • Constructor Details

    • UnifiedTestResult

      public UnifiedTestResult(String className, String testName, String status, String failureMessage, String stackTrace, long duration)
      Creates a new test result with the specified details.
    • UnifiedTestResult

      public UnifiedTestResult(String className, String testName, String status, String failureMessage, String stackTrace, long duration, String framework)
      Creates a new test result with the specified details and framework.
    • UnifiedTestResult

      public UnifiedTestResult(String className, String testName, String status, String failureMessage, String stackTrace)
      Creates a new test result with failure details but no duration.
    • UnifiedTestResult

      public UnifiedTestResult(String className, String testName, String status)
      Creates a new test result without failure details or duration.
    • UnifiedTestResult

      public UnifiedTestResult(String className, String testName, String status, long duration)
      Creates a new test result with duration but no failure details.
  • Method Details

    • addMetadata

      public void addMetadata(String key, String value)
      Adds metadata generated after collection, such as trace IDs.
    • getMetadata

      public Map<String,String> getMetadata()
      Gets immutable metadata for report rendering.
    • withFramework

      public UnifiedTestResult withFramework(String frameworkName)
      Returns this result if it already has a framework, otherwise returns a copy with the supplied framework.