Class TestsToRun

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Class<?>>
    Direct Known Subclasses:
    LazyTestsToRun

    public class TestsToRun
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.Class<?>>
    Contains all the tests that have been found according to specified include/exclude specification for a given surefire run.
    • Field Detail

      • locatedClasses

        private final java.util.List<java.lang.Class<?>> locatedClasses
      • finished

        private volatile boolean finished
      • iteratedCount

        private int iteratedCount
    • Constructor Detail

      • TestsToRun

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

      • iterated

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

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

        public final void markTestSetFinished()
      • isFinished

        public final boolean isFinished()
      • toString

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

        public boolean containsAtLeast​(int atLeast)
      • containsAtLeast

        private boolean containsAtLeast​(java.util.Iterator<java.lang.Class<?>> it,
                                        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 java.lang.Class<?>[] getLocatedClasses()
      • getClassByName

        public java.lang.Class<?> getClassByName​(java.lang.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
      • newWeakIterator

        private java.util.Iterator<java.lang.Class<?>> newWeakIterator()
        Returns:
        snapshot of tests upon constructs of internal iterator. Therefore weakly consistent while iterator() is being iterated.