org.apache.maven.surefire.util
Class LazyTestsToRun

java.lang.Object
  extended by org.apache.maven.surefire.util.TestsToRun
      extended by org.apache.maven.surefire.util.LazyTestsToRun

public class LazyTestsToRun
extends TestsToRun

A variant of TestsToRun that is provided with test class names from an InputStream (e.g. System.in). The method iterator() returns an Iterator that blocks on calls to Iterator.hasNext() until new classes are available, or no more classes will be available.

Author:
Andreas Gudian

Constructor Summary
LazyTestsToRun(InputStream testSource, ClassLoader testClassLoader, PrintStream originalOutStream)
          C'tor
 
Method Summary
protected  void addWorkItem(String className)
           
 boolean allowEagerReading()
           
 Iterator iterator()
          Returns an iterator over the located java.lang.Class objects
protected  void requestNextTest()
           
 String toString()
           
 
Methods inherited from class org.apache.maven.surefire.util.TestsToRun
containsAtLeast, containsExactly, fromClass, getLocatedClasses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazyTestsToRun

public LazyTestsToRun(InputStream testSource,
                      ClassLoader testClassLoader,
                      PrintStream originalOutStream)
C'tor

Parameters:
testSource - source to read the tests from
testClassLoader - class loader to load the test classes
originalOutStream - the output stream to use when requesting new new tests
Method Detail

addWorkItem

protected void addWorkItem(String className)

requestNextTest

protected void requestNextTest()

iterator

public Iterator iterator()
Description copied from class: TestsToRun
Returns an iterator over the located java.lang.Class objects

Overrides:
iterator in class TestsToRun
Returns:
an unmodifiable iterator

toString

public String toString()
Overrides:
toString in class TestsToRun

allowEagerReading

public boolean allowEagerReading()
Overrides:
allowEagerReading in class TestsToRun
Returns:
true, if the classes may be read eagerly. false, if the classes must only be read lazy.


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.