You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mark Slater (Jira)" <ji...@apache.org> on 2023/12/21 17:43:00 UTC
[jira] [Closed] (IO-826) Construct BrokenInputStream, BrokenReader, BrokenOutputStream, and BrokenWriter with RuntimeExceptions
[ https://issues.apache.org/jira/browse/IO-826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Slater closed IO-826.
--------------------------
All looks good. Thanks!
> Construct BrokenInputStream, BrokenReader, BrokenOutputStream, and BrokenWriter with RuntimeExceptions
> ------------------------------------------------------------------------------------------------------
>
> Key: IO-826
> URL: https://issues.apache.org/jira/browse/IO-826
> Project: Commons IO
> Issue Type: New Feature
> Components: Streams/Writers
> Affects Versions: 2.15.1
> Reporter: Mark Slater
> Priority: Minor
> Fix For: 2.16.0
>
>
> 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 {{{}RuntimeException{}}}s in addition to {{{}IOException{}}}s.
>
> I'll submit a PR for your consideration shortly.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)