Class TestClassFailures

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

public final class TestClassFailures extends Object
Represents the aggregated test failures for a specific test class.
Since:
1.0
Author:
Erik C. Thauvin
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new TestClassFailures object for a specific test class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a test failure to the collection of failures for this specific test class.
    boolean
    Determines if this object is equal to another object.
    Retrieves the name of the test class associated with the test failures.
    Retrieves a sorted list of all test failures associated with this test class.
    int
    Retrieves the total number of test failures associated with a specific test class.
    double
    Retrieves the total execution time of the test failures associated with a specific test class.
    int
    Calculates the hash code for this object.
    void
    Sorts the failures in-place.
    Returns a string representation of this object.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TestClassFailures

      public TestClassFailures(String className)
      Constructs a new TestClassFailures object for a specific test class.
      Parameters:
      className - the name of the test class; must not be null
  • Method Details

    • addFailure

      public void addFailure(TestFailure failure)
      Adds a test failure to the collection of failures for this specific test class.
      Parameters:
      failure - the TestFailure object to be added; must not be null
      Throws:
      NullPointerException - if the failure is null
    • getClassName

      public String getClassName()
      Retrieves the name of the test class associated with the test failures.
      Returns:
      the name of the test class as a non-null string
    • getFailures

      public List<TestFailure> getFailures()
      Retrieves a sorted list of all test failures associated with this test class.

      The failures are sorted by class name first, then by test name.

      Returns:
      a sorted list of TestFailure objects representing all test failures for this test class
    • getTotalFailures

      public int getTotalFailures()
      Retrieves the total number of test failures associated with a specific test class.
      Returns:
      the total count of test failures as an integer
    • getTotalTime

      public double getTotalTime()
      Retrieves the total execution time of the test failures associated with a specific test class.
      Returns:
      the total execution time as a double
    • hashCode

      public int hashCode()
      Calculates the hash code for this object.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • equals

      public boolean equals(Object obj)
      Determines if this object is equal to another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise
    • toString

      public String toString()
      Returns a string representation of this object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this object
    • sortFailures

      public void sortFailures()
      Sorts the failures in-place. This method is called internally to ensure failures are sorted before the final results are returned.