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

James Chaplin commented on WW-5030:
-----------------------------------

Hi.  When I looked at the code spring-webmvc-portlet (Spring 4.3.x) and 
PortletMVC4Spring (Liferay) it seems that the older spring-webmvc-portlet mock 
implementation should be sufficient to satisfy the struts2-portlet-plugin and 
struts2-junit-plugin needs.

The idea would not be a "full fork", but rather a "limited fork" (i.e. copying 
while preserving the notices) of the mock object package from 
spring-webmvc-portlet (plus one interface the mocks depend on).  Since that is 
from Spring 4.3.x I thought the Spring folks would be the ones to give a 
"friendly notice" to in that circumstance ... if one is needed or looked upon 
as polite.

Rather than going as far as a common library, I was thinking the relevant 
portlet mock support package could be made into a Struts Plugin that the 
struts2-portlet-plugin depends on.

Please let me know if and/or how the Struts Team would like to proceed.

> ClassNotFoundException - MockPortletResponse
> --------------------------------------------
>
>                 Key: WW-5030
>                 URL: https://issues.apache.org/jira/browse/WW-5030
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.5.18
>            Reporter: John Bush
>            Priority: Major
>             Fix For: 2.6
>
>         Attachments: TestStrutsPortlet.zip, fail.txt, success.txt
>
>
> WW-3826 solved a problem running JUnit tests on portlet actions that use the 
> struts2-portlet-plugin and struts2-junit-plugin. The solution used Spring's 
> org.springframework.mock.web.portlet package in the spring-test framework. 
> Spring Portlet MVC is no longer supported (SPR-14129) and the package has 
> been removed starting with Spring 5. I'm not able to upgrade to Spring 5 
> without loosing my unit testing since having both versions of spring-test in 
> my classpath creates many other issues.
> I've attached a zipped portlet project for testing (TestStrutsPortlet.zip), 
> console log from a successful test (success.txt) and console log from a 
> failed test (fail.txt). All that needs to change is the spring-version in the 
> POM to recreate the testing.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to