You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2016/08/20 14:50:22 UTC

[jira] [Commented] (CONFIGURATION-638) After a few unit tests, a few newly created directories not cleaned completely.

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

Oliver Heger commented on CONFIGURATION-638:
--------------------------------------------

Thanks for the report and the patch. I fully agree that unit tests should do a proper cleanup.

I see that in your patch you delete files manually. This is fine. However, in some newer tests we use the JUnit @Rule annotation together with {{TemporaryFolder}} to create temporary files and let JUnit take care that they are removed automatically at test end. This simplifies the affected test classes. Do you think it is possible to update your patch to make use of this functionality, too?

> After a few unit tests, a few newly created directories not cleaned completely.
> -------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-638
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-638
>             Project: Commons Configuration
>          Issue Type: Bug
>            Reporter: Ahmet Celik
>            Priority: Minor
>         Attachments: cleaning.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> After a few unit tests, created folders and files are not deleted. It's a bad practice in software engineering, because disk shouldn't be polluted.
> After execution of the test class 'org.apache.commons.configuration2.TestDynamicCombinedConfiguration' ,  'target/test-classes/testwrite' folder isn't deleted recursively.
> After execution of the test class 'org.apache.commons.configuration2.TestPropertiesConfiguration',  'target/sharp#1.properties' and 'target/testsave-custom-url.properties' files aren't deleted.
> After execution of the class 'org.apache.commons.configuration2.TestXMLConfiguration',  'target/testsample2.xml' file isn't deleted.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)