aspose file tools*
The moose likes Testing and the fly likes Choosing frame work for UNIT test Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Choosing frame work for UNIT test" Watch "Choosing frame work for UNIT test" New topic
Author

Choosing frame work for UNIT test

Sree Reddy
Greenhorn

Joined: Dec 20, 2002
Posts: 13
Hi,
We need to prepare and write unit test cases for automated testing.
Our project uses structs frame work.
Basically we have DB Objects, which will perfrom insert/select/update/delete operations. One or many methods for each operation. And regular bean objects to hold the values returned from Database.
Now we need to prepare test cases for
1. Test where DB objects performing all the operation correct.
2. Test all overall application with respect to action classes.
After browsing various posts on this forum, I thought "StrutsTestCase" frame work would be the best approach.
Is it a good approach? OR any other better solutions.
Can any of you suggest me best solution.
Any useful links how best we can proceed?
I am new to testcase frameworks.
Thanks in Advance,
Sree.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
If you want to test the "DB objects", you might want to look at dbUnit with which you can set up the database to a known state before each test execution (note that this isn't really unit testing). If you want to test Struts Actions, the StrutsTestCase is probably your best bet. Furthermore, you can test pretty much whatever you want using mock objects (EasyMock, MockObjects, JMock).


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Choosing frame work for UNIT test