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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.7.0
    • 2.8.0, 3.0.0-alpha1
    • None
    • None

    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

        1. HADOOP-12164.000.patch
          4 kB
          Lei (Eddy) Xu

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: