[ 
https://issues.apache.org/jira/browse/HADOOP-15536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16528186#comment-16528186
 ] 

Steve Loughran commented on HADOOP-15536:
-----------------------------------------

+1 from me. I will highlight that for future, look at LambdaTestUtils for 
writing tests

{code}
LambdaTestUtils.intercept(FileAlreadyExistsException.class, 
   "Can not create a directory since a file is already present",
    () -> FileUtil.mkDirs(falseDirectory.getAbsolutePath()));
{code}

This does the checks of type and content, and whatever gets returned from the 
closure is included in the assertion raised.
 
   

> Adding support in FileUtil for the creation of directories
> ----------------------------------------------------------
>
>                 Key: HADOOP-15536
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15536
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Giovanni Matteo Fumarola
>            Assignee: Giovanni Matteo Fumarola
>            Priority: Major
>         Attachments: HADOOP-15536-HADOOP-15461.v1.patch, 
> HADOOP-15536-HADOOP-15461.v2.patch, HADOOP-15536-HADOOP-15461.v3.patch, 
> HADOOP-15536.v1.patch
>
>
> Adding support in FileUtil for the creation of directories.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to