You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Lei (Eddy) Xu (JIRA)" <ji...@apache.org> on 2015/07/01 01:27:04 UTC

[jira] [Updated] (HADOOP-12164) Fix TestMove and TestFsShellReturnCode failed to get command name using reflection.

     [ https://issues.apache.org/jira/browse/HADOOP-12164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lei (Eddy) Xu updated HADOOP-12164:
-----------------------------------
    Attachment: HADOOP-12164.000.patch

Uploaded the patch, which added {{static String NAME}} fields to testing commands.

> Fix TestMove and TestFsShellReturnCode failed to get command name using reflection.
> -----------------------------------------------------------------------------------
>
>                 Key: HADOOP-12164
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12164
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.7.0
>            Reporter: Lei (Eddy) Xu
>            Assignee: Lei (Eddy) Xu
>            Priority: Minor
>         Attachments: HADOOP-12164.000.patch
>
>
> When enabled {{hadoop.shell.missing.defaultFs.warning}}, a few tests were failed as following:
> {noformat}
> java.lang.RuntimeException: failed to get .NAME
> 	at java.lang.Class.getDeclaredField(Class.java:1948)
> 	at org.apache.hadoop.fs.shell.Command.getCommandField(Command.java:458)
> 	at org.apache.hadoop.fs.shell.Command.getName(Command.java:401)
> 	at org.apache.hadoop.fs.shell.FsCommand.getCommandName(FsCommand.java:80)
> 	at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:111)
> 	at org.apache.hadoop.fs.shell.Command.run(Command.java:154)
> 	at org.apache.hadoop.fs.TestFsShellReturnCode.testChgrpGroupValidity(TestFsShellReturnCode.java:434)
> {noformat}
> The reason is that, in {{FsCommand#processRawArguments}}, it uses {{getCommandName()}}, which uses reflection to find {{static String NAME}} field, to build error message. But in the tests, the commands are built without {{static String NAME}} field, since it is not inherited. 



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