Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-9679

Regular code cleanup in TestResourcePluginManager

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.0
    • None
    • Reviewed

    Description

      There are several things could be cleaned up in this class:
      1. stubResourcePluginmanager should be private.
      2. In tearDown, the result of dest.delete() should be checked
      3. In class CustomizedResourceHandler, there are several methods where exceptions decalarations are unnecessary.
      4. Class MyMockNM should be renamed to some more meaningful name.
      5. There are some danling javadoc comments, for example:

      /*
         * Make sure ResourcePluginManager is initialized during NM start up.
         */
      

      6. There are some exceptions unnecessarily declared on test methods but they are never thrown, an example:
      testLinuxContainerExecutorWithResourcePluginsEnabled

      7. Assert.assertTrue(false); expressions should be replaced with Assert.fail()
      8. A handful of usages of Mockito's spy method. This method is not preferred so we should think about replacing it with mocks, somehow.

      The rest can be figured out by whoever takes this jira

      Attachments

        Issue Links

          Activity

            People

              adam.antal Adam Antal
              snemeth Szilard Nemeth
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: