Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing test case without database operations

 
Deepa More
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are these BMP or CMP entity beans?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic