vendredi 28 août 2015

Code coverage finally block

I have the following code construction:

try {
   //some code
}
catch(CustomException custExc) {
  //log
}
catch(CustomException2 custExc2) {
  //log
}
catch(Exception exc) {
  //log
}
finally {
  //some code
} 

I wrote unit tests: the first one covered the situation when an exception is not thrown (executing only try block code and finally block code) and 3 other which of them is covered each catch block once (executing try block one of catch block and finally block). Problem is that the Eclipse Emma plugin showed that I didn't covered finally block. Any ideas why can it happen?

Aucun commentaire:

Enregistrer un commentaire