File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Choosing frame work for UNIT test" Watch "Choosing frame work for UNIT test" New topic

Choosing frame work for UNIT test

Sree Reddy

Joined: Dec 20, 2002
Posts: 13
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,
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
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]
I agree. Here's the link:
subject: Choosing frame work for UNIT test
jQuery in Action, 3rd edition