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

Alastair Maw updated WICKET-555:
--------------------------------

        Fix Version/s:     (was: 2.0 branch (discontinued))
                       1.3.0-beta3
             Assignee: Alastair Maw
    Affects Version/s:     (was: 2.0 branch (discontinued))

Please don't set fix versions without consultation, particularly not for 
version 2.0 (discontinued)! The developers will do this.

> WicketTester.assertComponentOnAjaxResponse fails if AJAX response contains 
> line breaks
> --------------------------------------------------------------------------------------
>
>                 Key: WICKET-555
>                 URL: https://issues.apache.org/jira/browse/WICKET-555
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.6, 1.2.7, 1.3.0-beta1
>            Reporter: Jordi Salvat i Alabart
>            Assignee: Alastair Maw
>             Fix For: 1.3.0-beta3
>
>
> (Note: I've found this on 1.2.6 -- I'm reporting as existing on later 
> versions based on reading the code.)
> When any of the components replaced by an AJAX response renders multiple HTML 
> lines, or if the AJAX response contains line breaks for any other reasons, 
> the WicketTester.assertComponentOnAjaxResponse always returns false.
> I've traced this to this statement:
>               boolean isComponentInAjaxResponse = 
> ajaxResponse.matches(".*<component id=\"" + markupId
>                               + "\" ?>.*");
> which never matches if ajaxResponse contains a \n because, in Java RegExps, 
> the dot doesn't match these unless DOTALL is set (and it is not by default).
> In the latest version I've found in SVN (sorry I'm not yet quite familiar 
> with the codebase,) this code has been moved unchanged to 
> org.apache.wicket.util.tester.BaseWicketTester.java -- so I assume the bug is 
> still there.
> The easiest solution is to add a single-line "(?s)" flag in front of the 
> regular expression:
>               boolean isComponentInAjaxResponse = 
> ajaxResponse.matches("(?s).*<component id=\"" + markupId
>                               + "\" ?>.*");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to