You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/11/12 00:32:00 UTC

[jira] [Commented] (WW-4977) Fixing flaky test in Jsr168DispatcherTest and Jsr286DispatcherTest

    [ https://issues.apache.org/jira/browse/WW-4977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16683083#comment-16683083 ] 

ASF GitHub Bot commented on WW-4977:
------------------------------------

OrDTesters opened a new pull request #263: [WW-4977] Fixing flaky test in Jsr168DispatcherTest and Jsr286DispatcherTest.
URL: https://github.com/apache/struts/pull/263
 
 
   Issue link: https://issues.apache.org/jira/browse/WW-4977
   
   testRender_ok and testProcessAction_ok in Jsr168DispatcherTest have test-order dependencies and fail when they are run after testModeChangeUsingPortletWidgets. Similarly, testRender_ok and testProcessAction_ok in Jsr286DispatcherTest also have this problem.
   
   These tests can be fixed by adding the entry {STRUTS_ALWAYS_SELECT_FULL_NAMESPACE=“true”} to initParams in testModeChangeUsingPortletWidgets. The fix will enable the tests in these classes to now pass in any order. Let me know if you want to discuss more.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Fixing flaky test in Jsr168DispatcherTest and Jsr286DispatcherTest
> ------------------------------------------------------------------
>
>                 Key: WW-4977
>                 URL: https://issues.apache.org/jira/browse/WW-4977
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>            Reporter: OrDTesters
>            Priority: Minor
>
> testRender_ok and testProcessAction_ok in Jsr168DispatcherTest have test-order dependencies and fail when they are run after testModeChangeUsingPortletWidgets. Similarly, testRender_ok and testProcessAction_ok in Jsr286DispatcherTest also have this problem.
>  
> These tests can be fixed by adding the entry \{STRUTS_ALWAYS_SELECT_FULL_NAMESPACE=“true”} to initParams in testModeChangeUsingPortletWidgets, as shown in the following pull request. The fix will enable the tests in these classes to now pass in any order.
> (*to be replaced with a link to pull request when a pull request is made*)
>  
> Without the fix, the tests will get an error. More specifically, the error from Jsr168DispatcherTest.testProcessAction_ok is shown below. Let me know if you want to discuss more.
>   
> {code:java}
> org.jmock.core.DynamicMockError: mockActionProxyFactory: unexpected invocation
> Invoked: mockActionProxyFactory.createActionProxy("", "testAction", null, <{com.opensymphony.xwork2.dispatcher.HttpServletRequest=org.apache.struts2.dispatcher.StrutsRequestWrapper@6063f37, application={viewNamespace=/view, struts.mapper.alwaysSelectFullNamespace=true}, com.opensymphony.xwork2.ActionContext.locale=en_US, com.opensymphony.xwork2.dispatcher.HttpServletResponse=org.apache.struts2.portlet.servlet.PortletServletResponse@42036f8, struts.portlet.modeActionMap={help=ActionMapping{name='default', namespace='', method='null', extension='null', params={}, result=null}, preview=ActionMapping{name='default', namespace='', method='null', extension='null', params={}, result=null}, edit=ActionMapping{name='default', namespace='', method='null', extension='null', params={}, result=null}, about=ActionMapping{name='default', namespace='', method='null', extension='null', params={}, result=null}, edit_defaults=ActionMapping{name='default', namespace='', method='null', extension='null', params={}, result=null}, config=ActionMapping{name='default', namespace='', method='null', extension='null', params={}, result=null}, view=ActionMapping{name='default', namespace='/view', method='null', extension='null', params={}, result=null}, print=ActionMapping{name='default', namespace='', method='null', extension='null', params={}, result=null}}, struts.portlet.portletNamespace=, struts.portlet.modeNamespaceMap={help=, preview=, edit=, about=, edit_defaults=, config=, view=/view, print=}, com.opensymphony.xwork2.ActionContext.application={viewNamespace=/view, struts.mapper.alwaysSelectFullNamespace=true}, attr=AttributeMap {request={}, session={}, application={viewNamespace=/view, struts.mapper.alwaysSelectFullNamespace=true}}, struts.portlet.request=null, com.opensymphony.xwork2.dispatcher.ServletContext=org.apache.struts2.portlet.servlet.PortletServletContext@5ef8d5e5, struts.portlet.defaultActionForMode=ActionMapping{name='default', namespace='/view', method='null', extension='null', params={}, result=null}, struts.portlet.phase=ACTION_PHASE, com.opensymphony.xwork2.ActionContext.session={}, struts.portlet.context=null, session={}, request={}, struts.portlet.config=null, struts.actionMapping=ActionMapping{name='testAction', namespace='', method='null', extension='action', params={}, result=null}, parameters={struts.portlet.mode=[Ljava.lang.String;@22a2de19, struts.portlet.action=[Ljava.lang.String;@72a34d12}, com.opensymphony.xwork2.ActionContext.parameters={struts.portlet.mode=view, struts.portlet.action=/view/testAction}, struts.portlet.response=mockActionResponse}>)
> Allowed:
> expected once: createActionProxy( eq("/view"), eq("testAction"), null, an instance of java.util.Map ), returns <mockActionProxy>  
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)