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

WicketTester#startComponentInPage and WicketTester#assertModelValue have inconsistent behavior.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0, 1.5.1
    • 1.5.2
    • wicket
    • None

    Description

      I try the following (in Pseudocode):

      tester = new WicketTester();
      tester.startComponentInPage(new Label("test","hello");
      tester.assertModelValue("test","hello"); --> throws

      java.lang.IllegalArgumentException: Component is not a container and so does not contain the path test.

      Funny as it is, to make this work, you have to do the following assertion:

      tester.assertModelValue("", "hello");

      The error lies in
      public Component getComponentFromLastRenderedPage(String path,
      final boolean wantVisibleInHierarchy)
      in Line: path = startComponent.getId() + ":" + path;

      I will provide a patch this evening.

      Attachments

        1. 0001-WICKET-4122-WicketTester-uses-absolute-Path-to-refer.patch
          3 kB
          Martin Dilger
        2. wicket.zip
          31 kB
          Martin Dilger
        3. WICKET-4112.patch
          6 kB
          Andrea Del Bene

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            splitshade Martin Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: