Class TestClassFailures

java.lang.Object
rife.bld.extension.junitreporter.TestClassFailures

public class TestClassFailures extends Object
Groups test failures by class name, preserving insertion order.

Failures are stored in the order they are added, which typically matches JUnit execution order from the XML report. This ensures --index=N.M references map to the Mth failure as it occurred during test execution.

This class is mutable during parsing but returns unmodifiable views.

Since:
1.0
Author:
Erik C. Thauvin
  • Constructor Details

    • TestClassFailures

      public TestClassFailures(String className)
      Constructs a new TestClassFailures for the specified class.
      Parameters:
      className - the fully qualified test class name; must not be null
      Throws:
      NullPointerException - if className is null
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addFailure

      public void addFailure(TestFailure failure)
      Adds a failure to this class group.

      Failures are appended in insertion order. The total execution time is incremented by the failure's time.

      Parameters:
      failure - the TestFailure to add; must not be null
      Throws:
      NullPointerException - if failure is null
    • getClassName

      public String getClassName()
      Returns the fully qualified test class name.
      Returns:
      the class name; never null
    • getFailures

      public List<TestFailure> getFailures()
      Returns an unmodifiable list of failures in insertion order.

      The order matches the sequence failures were added, typically reflecting JUnit execution order from the XML report.

      Returns:
      an unmodifiable list of TestFailure instances in insertion order
    • getTotalFailures

      public int getTotalFailures()
      Returns the total number of failures in this class.
      Returns:
      the failure count
    • getTotalTime

      public double getTotalTime()
      Returns the sum of execution times for all failures in this class.
      Returns:
      the total time in seconds