Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-826

Construct BrokenInputStream, BrokenReader, BrokenOutputStream, and BrokenWriter with RuntimeExceptions

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.15.1
    • 2.16.0
    • Streams/Writers
    • None

    Description

      I find BrokenReader very helpful  in tests of Reader exception handling, but at present, it can only be configured to throw IOException.  In some cases, I also want to test the handling of runtime exceptions, usually to test that they're propagated rather than caught.  To do this, I end up implementing a subclass of Reader.

      It would be great if BrokenReader, and its close relatives BrokenInputStream, BrokenWriter, and BrokenOutputStream, could be configured to throw RuntimeExceptions in addition to IOExceptions.

       

      I'll submit a PR for your consideration shortly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            markslater Mark Slater
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: