org.apache.maven.plugin.surefire.booterclient.lazytestprovider
Class TestProvidingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestProvidingInputStream
All Implemented Interfaces:
Closeable

public class TestProvidingInputStream
extends InputStream

An InputStream that, when read, provides test class names out of a queue.

The Stream provides only one test at a time, but only after provideNewTest() has been invoked.

After providing each test class name, followed by a newline character, a flush is performed on the FlushReceiver provided by the FlushReceiverProvider that can be set using setFlushReceiverProvider(FlushReceiverProvider).

Author:
Andreas Gudian

Constructor Summary
TestProvidingInputStream(Queue<String> testItemQueue)
          C'tor
 
Method Summary
 void close()
           
 void provideNewTest()
          Signal that a new test is to be provided.
 int read()
           
 void setFlushReceiverProvider(FlushReceiverProvider flushReceiverProvider)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestProvidingInputStream

public TestProvidingInputStream(Queue<String> testItemQueue)
C'tor

Parameters:
testItemQueue - source of the tests to be read from this stream
Method Detail

setFlushReceiverProvider

public void setFlushReceiverProvider(FlushReceiverProvider flushReceiverProvider)
Parameters:
flushReceiverProvider - the provider for a flush receiver.

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

provideNewTest

public void provideNewTest()
Signal that a new test is to be provided.


close

public void close()
Specified by:
close in interface Closeable
Overrides:
close in class InputStream


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