Menu

#2 mixed coverage in finally statements.

open
nobody
None
5
2004-02-26
2004-02-26
Ralf Reddin
No

This is more a question than a support request.

I'm using Gretel to build a nice test-coverage report on my unit
tests. It would be nice to get 100% test-coverage so that I can
show that every line of the code get's executed. Some part of my
code has a finally statement in it, like this simple example:

01 package example;
02
03 public class FinallyExample {
04 public static void main(String args[]) {
05 int i=10;
06 try {
07 i++;
08 } finally {
09 System.out.println("i is "+i);
10 }
11 System.out.println("end.");
12 }
13 }

When I run this code, the line 9 is always marked as "mixed".
The percentage of complete test-coverage never get's 100%.

Can I get 100% coverage in code with finally statements?

Discussion

  • Ralf Reddin

    Ralf Reddin - 2004-02-26

    a very simple java class with a finally statement.

     
  • Brett Favre

    Brett Favre - 2004-02-29

    Logged In: YES
    user_id=319385

    It looks like a bug to me. I'll look into it and see if I
    can figure out what's up.

     

Log in to post a comment.

MongoDB Logo MongoDB