Lei (Eddy) Xu created HADOOP-12164: -------------------------------------- Summary: 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
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)