Class TestsToRun

java.lang.Object
org.apache.maven.surefire.api.util.TestsToRun
All Implemented Interfaces:
Iterable<Class<?>>

public class TestsToRun extends Object implements Iterable<Class<?>>
Contains all the tests that have been found according to specified include/exclude specification for a given surefire run.
Author:
Kristian Rosenvold (junit core adaption)
  • Constructor Details

    • TestsToRun

      public TestsToRun(Set<Class<?>> locatedClasses)
      Constructor
      Parameters:
      locatedClasses - A set of java.lang.Class objects representing tests to run
  • Method Details

    • fromClass

      public static TestsToRun fromClass(Class<?> clazz) throws TestSetFailedException
      Throws:
      TestSetFailedException
    • iterated

      public Iterator<Class<?>> iterated()
      Returns:
      test classes which have been retrieved by iterator().
    • iterator

      public Iterator<Class<?>> iterator()
      Returns an iterator over the located java.lang.Class objects
      Specified by:
      iterator in interface Iterable<Class<?>>
      Returns:
      an unmodifiable iterator
    • markTestSetFinished

      public final void markTestSetFinished()
    • isFinished

      public final boolean isFinished()
    • toString

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

      public boolean containsAtLeast(int atLeast)
    • containsExactly

      public boolean containsExactly(int items)
    • allowEagerReading

      public boolean allowEagerReading()
      Returns:
      true, if the classes may be read eagerly. false, if the classes must only be read lazy.
    • getLocatedClasses

      public Class<?>[] getLocatedClasses()
    • getClassByName

      public Class<?> getClassByName(String className)
      Get test class which matches className
      Parameters:
      className - string used to find the test class
      Returns:
      Class object with the matching name, null if could not find a class with the matching name