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

Many misusages of assertEquals(expected, actual)

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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

              People

              • Assignee:
                Unassigned
                Reporter:
                suda Akihiro Suda
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: