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.
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.