[
https://issues.apache.org/jira/browse/IO-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13848172#comment-13848172
]
BELUGA BEHR commented on IO-417:
--------------------------------
Master Sebb,
I don't mean to turn this into a forum post, but how would you unit test the
following code? The test would be to get an IOException out of forceMkdir().
void method(String dirPath) throws IOException
{
if (filePath == null) { throw new IllegalArgumentException(); }
File dir = new File(dirPath);
IOUtils.forceMkdir(dir);
}
> FileNameUtils Invalid File Name
> -------------------------------
>
> Key: IO-417
> URL: https://issues.apache.org/jira/browse/IO-417
> Project: Commons IO
> Issue Type: Wish
> Components: Utilities
> Reporter: BELUGA BEHR
> Priority: Trivial
>
> Create a constant String (or file) that has an invalid file and/or directory.
> The file path used must be invalid on both Windows and *nix.
> Would be used for testing. I have done something similar when I'm unit
> testing a method that uses: FileUtils#forceMkDir().
> My unit tests expect the IOException.
> Thanks.
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)