• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Testing JSP

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Experts there,

I need some and help and kind of direction to go about writing my test cases to test JSP.

This is my application Architecture:
JSP<->Struts<->SL<->BusinessClasses<->DBClasses

JSP<->Struts<->SL is my web component and currently I am least or not at all concerned about Business and DB Classes. Currently I am coding my web component and wanted to write test cases for the same.
SL above are just POJO's where I have lookup for my business classes. As of now I have some dummy data hardcoded which I use to test my JSP manually through browser.

What approach you all would suggest me to go with.
I have looked at Cactus, It provides testcases for Servlets, Jsp Tag libraries and Filters.

How can I write test cases for my Jsp pages using Cactus.
There is one more point here. As I am using Struts, Can I test my JSP's without using StrutsTestCase framework?

I see so many frameworks for testing. But I don't see any procedure or help to go about writing testcases for project like mine. If I have to combine these test frameworks what would be the best process. And I guess most of the project have very similar architecture as mine.

Your help and direction would be greatly appreciated.

Thank you very much inadvance.
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First thing to note is that all of these frameworks build on top of junit.

I would recommend starting by testing the Struts actions themselves. You can use mock objects (easyMock and jMock are good frameworks) to get mock request/response objects. Through these pure junit tests, you can test the logic without a server running.

Once the action is tested, Cactus can test the JSPs themselves.
 
reply
    Bookmark Topic Watch Topic
  • New Topic