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

Many misusages of assertEquals(expected, actual)

Add voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Test
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      The first arg of org.JUnit.Assert.assertEquals() should be an expected value, and the second one should be an actual value.

      void assertEquals(T expected, T actual);
      

      http://junit.org/apidocs/org/junit/Assert.html#assertEquals(java.lang.Object, java.lang.Object)

      However, there are so many violations in Hadoop, which can make a misleading message like this:

      AssertionError: expected:<actual> but was:<expected>
      

      .

      Please refer to just-rough-approx.txt.

      Attachments

        1. just-rough-approx.txt
          205 kB
          Akihiro Suda

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            suda Akihiro Suda

            Dates

              Created:
              Updated:

              Slack

                Issue deployment