my dog learned polymorphism
The moose likes Struts and the fly likes Struts2 Convention plugin with junit plugin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 Convention plugin with junit plugin" Watch "Struts2 Convention plugin with junit plugin" New topic

Struts2 Convention plugin with junit plugin

Rebecca Case

Joined: Apr 10, 2010
Posts: 5
I'm using Struts 2.8.1 using the convention plugin and attemption to junit test this by utilizing StrutsSpringTestCase. The problem I'm experiencing is that the test throws an exception saying "No result defined for action com.becky.action.HowdyFolksAction and result success" if I don't use a Results annotation for "success" instead of just letting it find the correct jsp (which seems to sort of at least partially defeat the purpose).

Here's the test

and here's the action

Am I missing something or is it just that these plugins don't completely play well together?

Jared Tims

Joined: Oct 13, 2011
Posts: 1
Did you ever get the Strut2 Convention Plugin and the Struts2 jUnit Plugin to work together? I keep getting the following error:

2011-10-14 14:15:42,380 WARN org.springframework.mock.web.MockServletContext.getResourcePaths:212 - Couldn't get resource paths for class path resource [WEB-INF/content/] class path resource [WEB-INF/content/] cannot be resolved to URL because it does not exist

The test works fine if i use an xml file for my action mappings, so i can only think that it is the annotations of the Convention Plugin (@Action and @Result) that are causing it to fail?

I agree. Here's the link:
subject: Struts2 Convention plugin with junit plugin
It's not a secret anymore!