Class MockReaderWrapper

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Readable

    public class MockReaderWrapper
    extends Reader
    Wraps a Reader, and can throw random or fixed exceptions, and spoon feed read chars.
    • Constructor Detail

      • MockReaderWrapper

        public MockReaderWrapper​(Random random,
                                 Reader in)
    • Method Detail

      • throwExcAfterChar

        public void throwExcAfterChar​(int charUpto)
        Throw an exception after reading this many chars.
      • throwExcNext

        public void throwExcNext()
      • ready

        public boolean ready()
        Overrides:
        ready in class Reader
      • isMyEvilException

        public static boolean isMyEvilException​(Throwable t)