JUnit for Struts Action class
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anand_Tiruveedula
Posted On:   Friday, August 16, 2002 09:47 PM

Hi,

I would like to know how to perform JUnit test for an struts Action class, using mocktest.




I am able to write JUnit test case for individual methods, but I want to write a single Junit test case for the entire Action class.



Thanks in advance,

Anand

Re: JUnit for Struts Action class

Posted By:   Lance_Walton  
Posted On:   Sunday, August 18, 2002 06:17 PM

Hi.

Two questions:


  • Are you using the mock objects from Struts Test Case at SourceForge (or something like them) for you mock testing?
  • Why do you want to write a single test case for an entire Action class? Unit tests are best when they are very fine grained; when one fails, you know exactly why without having to find out what the message corresponds to in your test.


But to answer your question, can you not just write a method that sets up a fixture, does your asserts, sets up the next fixture, does some more asserts, etc.

Apologies if I missed the point of your question...

Regards,

Lance

----

Lance Walton - lance@teaminabox.co.uk

Team In A Box - Software without Tragedy

http://www.teaminabox.co.uk

About | Sitemap | Contact