You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Anton Vodonosov (JIRA)" <ji...@apache.org> on 2010/11/22 15:02:14 UTC

[jira] Commented: (WICKET-1264) assertComponentOnAjaxResponse does not work with WicketTester.clickLink

    [ https://issues.apache.org/jira/browse/WICKET-1264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934468#action_12934468 ] 

Anton Vodonosov commented on WICKET-1264:
-----------------------------------------

The solution - disabling buffered responses to make tests passing - is problematic. 

My application relies on the fact the requests are buffered. In result the code that expects the buffering fails during tests, because the MockWebApplication.init() disables buffering (overriding my changes).

Also, I should say, disabling buffering to fix the problem means the wicket doesn't support buffered mode. Is it true?

> assertComponentOnAjaxResponse does not work with WicketTester.clickLink
> -----------------------------------------------------------------------
>
>                 Key: WICKET-1264
>                 URL: https://issues.apache.org/jira/browse/WICKET-1264
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.0-final
>         Environment: mac osx 10.4
>            Reporter: Nino Martinez
>            Priority: Minor
>             Fix For: 1.3.1
>
>         Attachments: WicketTesterAjaxTrouble.zip
>
>
> assertComponentOnAjaxResponse does not work with clickLink. Workaround are to call wickettester..executeAjaxEvent(ajaxLink,"onclick"); instead.
> Reason why this fails has something todo with that clickLink creates a servlet response which are empty hence this will always fail:
> 		// Get the AJAX response
> 		String ajaxResponse = getServletResponse().getDocument();
> 		// Test that the previous response was actually a AJAX response
> 		failMessage = "The Previous response was not an AJAX response. "
> 			+ "You need to execute an AJAX event, using clickLink, before using this assert";
> 		boolean isAjaxResponse = ajaxResponse.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ajax-response>");
> proposed fix are to rewrite wicketTester.clicklink(string path,boolean ajax) to call executeAjaxEvent instead if possible? 

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