Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

MockStrutsTestCase.  RSS feed

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I am trying to run a JUnit for a class which extends org.apache.struts.tiles.actions.TilesAction.
My Junit class extends servletunit.struts.MockStrutsTestCase.
I call
setRequestPathInfo("/something.do");

/something.do maps to the Action class which extends org.apache.struts.tiles.actions.TilesAction.
But when I put a breakpoint in this action which extends org.apache.struts.tiles.actions.TilesAction, it does not go there after i call the actionPerform().

If instead of
setRequestPathInfo("/something.do");
i change it to
another mapping which extends the normal org.apache.struts.action.Action,
it goes into the Action extending org.apache.struts.action.Action.

Can anyone let me know the solution for this.

thanks,
-Gayatri.
 
pie sneak
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method signature for TilesAction is different. It has an additional ComponentContext attribute:
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, TilesAction has an extra attribute ComponentContext.
actionPerform() in the Junit does call this execute() of TilesAction.
Is there any way by which we can call the execute of TilesAction.

Thanks,
-Gayatri
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!