Hi All,
I am writing Junit Test cases for DAO layer calss methods. And also we are taking Test Coverage. But the coverage is giving less because of catch block in the code. my code snippet is show bellow.
try{
Person person = new Person();
person.setName("Purushotham");
session.save(person);
}[b]catch (HibernateException hbexe) {
logger.error(hbexe.getMessage(), hbexe);
throw new CitcoSystemException(CitcoExceptionCategory.LOG, hbexe.getMessage(), hbexe);[/b]
}
if i covered this catch block in DAOlayer, i can get 100% coverage. please let me know how to do this one from junit test case method. please do the needful.
thanks in advance.
Regards,
_________________ Purushotham Podaralla
|