• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to test struts with Junit

 
reena Mehta
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am new in testing
kindly give one example of test strutsApplicatio with Junit .it's urgent
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Honestly speaking, I never unit tested Struts app, but unit test are there for testing your business class (model) methods (unit). To test the controller (action) classes, please Google.

Please Google any junit tutorials and get started. happy Testing.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34856
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use JUnit and a mock testing framework (like easymock) to test the logic in my actions. For the web layer, you can use a tool like Selenium or Cactus.

Testing a Struts application is just like testing any other web app. And for mocking, like testing any other code.
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Easy mock for testing Struts and Http request.You need to create mock object of request and response. Search in google you will get ton of sample.
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can use StrutsTestCase . But I am afraid it is meant for Struts 1.x versions.

Regards,
Amit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic