[ 
https://issues.apache.org/jira/browse/WICKET-4112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Grigorov resolved WICKET-4112.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.2
         Assignee: Martin Grigorov

Improved with r1180916.

Now BaseWicketTester keeps meta data about the started component like a flag 
that indicates whether the component is instantiated by Wicket or not and uses 
it internally to decide how to construct the component path.
It is transparent to the user - she always has to assert with: 
tester.assertXYZ("herComponentId", ...). 

@Andrea: thanks for your work on this!
                
> WicketTester#startComponentInPage and WicketTester#assertModelValue have 
> inconsistent behavior.
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4112
>                 URL: https://issues.apache.org/jira/browse/WICKET-4112
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.0, 1.5.1
>            Reporter: Martin Dilger
>            Assignee: Martin Grigorov
>             Fix For: 1.5.2
>
>         Attachments: 
> 0001-WICKET-4122-WicketTester-uses-absolute-Path-to-refer.patch, 
> WICKET-4112.patch, wicket.zip
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to