Interface TestResultTable.TreeIterator

All Superinterfaces:
Enumeration<TestResult>, Iterator<TestResult>
Enclosing class:
TestResultTable

public static interface TestResultTable.TreeIterator extends Enumeration<TestResult>, Iterator<TestResult>
Defines an iterator/enumerator interface for retrieving tests out of the tree. This is a read-only interface, so remove() is not supported.
  • Method Details

    • hasMoreElements

      boolean hasMoreElements()
      Specified by:
      hasMoreElements in interface Enumeration<TestResult>
    • nextElement

      TestResult nextElement()
      Specified by:
      nextElement in interface Enumeration<TestResult>
    • hasNext

      boolean hasNext()
      Specified by:
      hasNext in interface Iterator<TestResult>
    • next

      TestResult next()
      Specified by:
      next in interface Iterator<TestResult>
    • remove

      void remove()
      Do not call this method.
      Specified by:
      remove in interface Iterator<TestResult>
      Throws:
      UnsupportedOperationException - Not available for this iterator.
    • getRejectCount

      int getRejectCount()
      Find out how many tests were rejected by filters while doing iteration. This number will be available despite the setting on setRecordRejects().
      Returns:
      The number of tests found by rejected by the filters. The value will be between zero and max. int.
    • setRecordRejects

      void setRecordRejects(boolean state)
      Should the rejected tests be tracked. The default is to not record this info, activating this feature will make getFilterStats() return useful info. The setting can be changed at any time, but never resets the statistics. The recorded statistics represent iterator output during this object's lifetime, while this feature was enabled. The setting here does not affect information from getRejectCount()
      Parameters:
      state - True to activate this feature, false to disable.
      See Also:
    • getResultStats

      int[] getResultStats()
      Find out which states the test which have been enumerated already were in. The result is valid at any point in time, and represent the stats for the entire selected set of tests when hasMoreElements() is false.
      Returns:
      Indexes refer to those values found in Status
      See Also:
    • getFilterStats

      Find out which filters rejected which tests. The data is valid at any point in time; hasNext() does not have to be false. Note that filters are evaluated in the order shown in getFilters() and that the statistics only registered the first filter that rejected the test; there may be additional filters which would also reject any given test.

      The hashtable has keys of TestResults, and values which are TestFilters. Because of CompositeFilters, the set of filters found in the ``values'' is not necessarily equivalent to those given by getFilters().

      Returns:
      Array as described or null if no tests have been rejected yet.
      Since:
      3.0.3
    • getFilters

      TestFilter[] getFilters()
      Find out what the effective filters are.
      Returns:
      Null if there are no active filters.
    • getInitialURLs

      String[] getInitialURLs()
      Find out what the effective initial URLs for this enumerator are. The returned array can be any combination of URLs to individual tests or URLs to directories. Remember these are URLs, so the paths are not platform specific.
      Returns:
      Null if no nodes or tests were found. Any array of the initial URLs otherwise.
    • peek

      Object peek()
      Peek into the future to see which object will be returned next.
      Returns:
      The next object scheduled to come out of next(), or null if hasNext() is false.
    • isPending

      boolean isPending(TestResult node)
      Will the iterator be returning the given node later. There is no checking to ensure that the parameter is within the iterator's "address space". The comparison is not reference based, but location based, so, will the test at the location indicated by the given test be evaluated for iterator later? This query is done without respect to the filters.
      Parameters:
      node - The test result indicating the location in question.
      Returns:
      True if the test in question has not been passed by the iterator and may still be returned. False if the given test will not subsequently be returned by this iterator.