Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2488

QuickFix proposal WicketTesterHelper.assertEquals(final Collection<?> expects, final Collection<?> actuals) should compare list sizes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4-RC7
    • 1.4.2, 1.5-M1
    • wicket
    • None

    Description

      Simple bug:

      WicketTesterHelper.assertEquals(expected, actual) method is supposed to check whether, for example, error messages match. However, if you have a situation with duplicate error messages, the test returns true even though logically the test should fail

      Simple fix proposal:

      Let's add size check in addition to the containsAll check:

      public static void assertEquals(final Collection<?> expects, final Collection<?> actuals)
      {
      if (!expects.containsAll(actuals) || !actuals.containsAll(expects) || (actuals.size() != expects.size()))

      { failWithVerboseMessage(expects, actuals); }

      }

      Attachments

        Activity

          People

            jdonnerstag Juegen Donnerstag
            mmakundi Martin Terra
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2m
                2m
                Remaining:
                Remaining Estimate - 2m
                2m
                Logged:
                Time Spent - Not Specified
                Not Specified