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

abhishek bafna edited comment on OOZIE-2493 at 8/3/16 7:56 PM:
---------------------------------------------------------------

[~rkanter] I looked into the classes inheriting from the {{MainTestCase}}. 
Except {{TestDistcpMain}}, all the others are writing into the {{action.xml}} 
just once, so they are not performing the {{delete}} operation on the file. 
Because, It is performing two tests in a single testcase.

Essentially the problem is, after the testcase is completed, in the 
{{tearDown}} method we are just resetting the {{XTestCase#testCaseDir}}, 
instead we should be removing the content of the directory then might set it to 
null. Same goes for the {{XFsTestCase#tearDown}}. Let me know what do you thing 
about this approach.


was (Author: abhishekbafna):
[~rkanter] I looked into the classes inheriting from the {{MainTestCase}}. 
Except {{TestDistcpMain}}, all the others are writing into the {{action.xml}} 
just once, so they are not performing the {{delete}} operation on the file.

Essentially the problem is, after the testcase is completed, in the 
{{tearDown}} method we are just resetting the {{XTestCase#testCaseDir}}, 
instead we should be removing the content of the directory then might set it to 
null. Same goes for the {{XFsTestCase#tearDown}}. Let me know what do you thing 
about this approach.

> TestDiscp leaves action.xml behind on local filesystem
> ------------------------------------------------------
>
>                 Key: OOZIE-2493
>                 URL: https://issues.apache.org/jira/browse/OOZIE-2493
>             Project: Oozie
>          Issue Type: Bug
>          Components: tests
>            Reporter: abhishek bafna
>            Assignee: abhishek bafna
>              Labels: patch
>             Fix For: 4.3.0
>
>         Attachments: OOZIE-2493-02.patch, OOZIE-2493-03.patch, 
> OOZIE-2493.patch
>
>
> In the TestDistcpMain#testMain test case, it is deleting a file using HDFS 
> FileSystem instance which actually created on a local FileSystem.
> {code}
> // getting file hadoop system instance 
> FileSystem fs = getFileSystem();
> ...
> // creating a storing file on local file system
> File actionXml = new File(getTestCaseDir(), "action.xml");
> ...
> // Now trying to delete the file on hadoop file system
> fs.delete(new Path(getTestCaseDir(), "action.xml"), true);
> {code}



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

Reply via email to