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

Many misusages of assertEquals(expected, actual)

    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

            People

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

              Dates

                Created:
                Updated: