wood burning stoves*
The moose likes Testing and the fly likes Writing test case without database operations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Writing test case without database operations" Watch "Writing test case without database operations" New topic
Author

Writing test case without database operations

Deepa More
Ranch Hand

Joined: May 22, 2006
Posts: 68
How to write test case for classes that calls database operations using entity beans and data of test case should be read from or write into some xml file?
How to use mock objects here?
The application is J2EE based uses EJBs and back end as db2.
Any examples available?

Thanks
Deepa
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Are these BMP or CMP entity beans?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Deepa More:
data of test case should be read from or write into some xml file?

Regarding reading the data... If you're using JUnit 3.8, see here for an example of how to write data-driven test cases. If you're using JUnit 4.x, see this instead.

I'm not sure, though, what would you like to write into the XML file?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing test case without database operations