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

Make GenericTestUtils.assertExceptionContains robust

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 2.8.0, 3.0.0-alpha1, 2.7.6
    • Component/s: test
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      GenericTestUtils.assertExceptionContains calls Exception.getMessage(), followed by msg.contains().

      This will NPE for an exception with a null message, such as NPE.

      1. it should call toString()
      2. and do an assertNotNull on the result in case some subclass does something very bad
      3. and for safety, check the asser

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stevel@apache.org Steve Loughran
                Reporter:
                stevel@apache.org Steve Loughran
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: