tags:

views:

150

answers:

1

Hi

I am new to Junit.I am using JUnit 3.8. My problem is,the methods of my application involve database operations(insert,update,delete...) and also one method may have call to number of other methods. I am hardcoding the input values in the test cases.So for the first time the test case,for example record insertion, passes.For the second time,it fails ..throws exception that record already exists.

How to write junit test case for such methods(involving db operations)? How to write test case for methods involving call to other methods?

Please help me...

Thanks in advance.

+1  A: 

You should take a deep look for DBUnit in raltionship with Databases. And you should update to a newer release of JUnit 4.8.1 is the newest as far as i know.

khmarbaise
But in newer release annotations are used.I dont know annotations,thats why i am trying with junit3.8.
Rashmi