Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12164

Fix TestMove and TestFsShellReturnCode failed to get command name using reflection.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      When enabled hadoop.shell.missing.defaultFs.warning, a few tests were failed as following:

      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)
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              eddyxu Lei (Eddy) Xu
              Reporter:
              eddyxu Lei (Eddy) Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: