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

John Bush commented on WW-5030:
-------------------------------

It has been a while since I've looked at this closely but I don't think there 
was actually a dependency to spring-webmvc-portlet instead to spring-test. 
WW-3826 added StrutsPortletTestCase.java to struts2-portlet-plugin which 
created a dependency to the package org.springframework.mock.web.portlet in 
spring-test. That package got pruned as part of Spring's SPR-14129.

My opinions are: StrutsPortletTestCase.java should really be in the 
struts2-junit-plugin with the other Struts???TestCases. If it's deemed OK to 
use the code authored by Spring it should also reside in struts2-junit-plugin. 
My reasoning is that the other mock classes for Struts JUnit support is there 
only in this case it would be Struts' instead of Spring's(which is/was 
imported).

I acknowledge the universe of struts2-portlet-plugin users is probably very 
small. Also JSR 362 Portlet 3.0 API Specification is out and I assume there 
isn’t plans for adding JSR 362 support to the struts2-portlet-plugin. I don’t 
think the solution needs to be far forward thinking since it’s a legacy support 
issue.

Thanks, John

> 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