MockWebApplication should use PageFactory from given WebApplication.
--------------------------------------------------------------------

                 Key: WICKET-984
                 URL: https://issues.apache.org/jira/browse/WICKET-984
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.0-beta3
         Environment: This bug is not specific to environment.
            Reporter: Craig Lenzen
            Priority: Minor


I came across the following code in the MockWebApplication;

                               else if (target instanceof 
IBookmarkablePageRequestTarget)
                               {
                                       // create a new request cycle for the 
newPage call
                                       createRequestCycle();
                                       IBookmarkablePageRequestTarget 
pageClassRequestTarget =
(IBookmarkablePageRequestTarget)target;
                                       Class pageClass = 
pageClassRequestTarget.getPageClass();
                                       PageParameters parameters = 
pageClassRequestTarget.getPageParameters();
                                       if (parameters == null || 
parameters.size() == 0)
                                       {
                                               newLastRenderedPage = new 
DefaultPageFactory().newPage(pageClass);
                                       }
                                       else
                                       {
                                               newLastRenderedPage = new 
DefaultPageFactory().newPage(pageClass,
                                                               parameters);
                                       }
                               }

This code block was contained in the method 
"generateLastRenderedPage(WebRequestCycle cycle)".

A new instance of DefaultPageFactory should not be used rather it should use 
the one configured on the WebApplication passed in the constructor of 
MockWebApplication.  This issue is if a use relies on their own implementation 
of PageFactory there unit tests will fail because it is not being used. 

-- 
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