bb.io
Class StreamDrainerForwarding.UnitTest

java.lang.Object
  extended by bb.io.StreamDrainerForwarding.UnitTest
Enclosing class:
StreamDrainerForwarding

public static class StreamDrainerForwarding.UnitTest
extends Object

See the Overview page of the project's javadocs for a general description of this unit test class.


Nested Class Summary
private static class StreamDrainerForwarding.UnitTest.Crashes
          StreamDrainerForwarding subclass which overrides onBytesRead to always throw a RuntimeException.
 
Constructor Summary
StreamDrainerForwarding.UnitTest()
           
 
Method Summary
private  void drain(StreamDrainer drainer)
           
private  InputStream makeInputStream()
           
 void test_all()
          Confirms that StreamDrainerForwarding immediately dumps to System.out all the bytes it drains from an InputStream.
 void test_onBytesRead()
          Confirms that the onBytesRead is being called by using a StreamDrainerForwarding.UnitTest.Crashes instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamDrainerForwarding.UnitTest

public StreamDrainerForwarding.UnitTest()
Method Detail

test_all

public void test_all()
              throws Exception
Confirms that StreamDrainerForwarding immediately dumps to System.out all the bytes it drains from an InputStream.

Throws:
Exception

test_onBytesRead

public void test_onBytesRead()
                      throws Exception
Confirms that the onBytesRead is being called by using a StreamDrainerForwarding.UnitTest.Crashes instance.

Throws:
Exception

makeInputStream

private InputStream makeInputStream()

drain

private void drain(StreamDrainer drainer)
            throws Exception
Throws:
Exception