Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 Convention plugin with junit plugin

 
Rebecca Case
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/]
java.io.FileNotFoundException: 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?

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic