Package rife.bld.extension.junitreporter
Class TestClassFailures
java.lang.Object
rife.bld.extension.junitreporter.TestClassFailures
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 Summary
ConstructorsConstructorDescriptionTestClassFailures(String className) Constructs a newTestClassFailuresfor the specified class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailure(TestFailure failure) Adds a failure to this class group.Returns the fully qualified test class name.Returns an unmodifiable list of failures in insertion order.intReturns the total number of failures in this class.doubleReturns the sum of execution times for all failures in this class.toString()
-
Constructor Details
-
TestClassFailures
Constructs a newTestClassFailuresfor the specified class.- Parameters:
className- the fully qualified test class name; must not be null- Throws:
NullPointerException- ifclassNameis null
-
-
Method Details
-
toString
-
addFailure
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- theTestFailureto add; must not be null- Throws:
NullPointerException- iffailureis null
-
getClassName
Returns the fully qualified test class name.- Returns:
- the class name; never null
-
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
TestFailureinstances 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
-