Ferrari Massimo | 16 Aug 2004 10:38
Picon

Emma HTML report shows uncovered line although it is

I have a very simple class which delegate calls to an XADataSource.
Although the method getXAConnection(String userName, String password) is called (I see a log in the
stdout), the HTML report shows is as uncovered (red lines).
Am I doing something wrong or is it a ... bug?
I attached the class.
Best regards
Massimo
Attachment (XADataSourceWrapper.java): application/octet-stream, 1733 bytes
Ferrari Massimo | 17 Aug 2004 08:13
Picon

RE: Emma HTML report shows uncovered line although it is

Yes it helps, thank you!
Massimo
 
-----Original Message-----
From: vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org [mailto:vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org]
Sent: Montag, 16. August 2004 18:10
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [EMMA-users] Emma HTML report shows uncovered line although it is


EMMA uses basic blocks as its fundamental approach for figuring out code coverage. Line coverage is derived from basic block coverage. For efficiency reasons, EMMA does not consider method calls as basic block delimiters (the assumption being that "normal" code is usually written to complete "normally").

Now, if a method does abort with an exception it will mark the entire enclosing basic block as uncovered. The block will usually include a few lines of code before the method call. I agree that the results usually look somewhat odd, but it's a tradeoff decision I've made between efficiency and "oddness" of results in what I thought would be a rare testing case. The users are expected to fix this by making their method complete normally at least once (seems like it should be their goal anyway).

This has come up in the "Open Discussion" online forum a couple times.The FAQ content around how EMMA does code coverage is helpful reading for this: http://emma.sourceforge.net/faq.html. I am in the process of re-vamping the website and will consider this issue for another FAQ entry.

Hope this helps,
Vlad.


Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        <emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
cc:        

Subject:        RE: [EMMA-users] Emma HTML report shows uncovered line although it is

I really apologize, getXAConnection throws an exception!
But... then I don't understand why the method is marked in red and why isn't the System.out.println statement marked as green.
Best Regards!
Massimo
 
 
-----Original Message-----
From: Ferrari Massimo
Sent: Montag, 16. August 2004 15:10
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [EMMA-users] Emma HTML report shows uncovered line although it is

No exception is thrown.
I have extrapolated a simple test case which reproduces the error, please let me know where to upload it because it is 3 MB of data...
You have to configure a datasource in XADataSourceWrapper.java (I'm using oracle) and set the correct JAVA_HOME in build/setenv.bat.
Then run build/build.bat in the build directory.
The HTML is stored under docs/coverage.
Best Regards!
Massimo
 
-----Original Message-----
From: vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org [mailto:vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org]
Sent: Montag, 16. August 2004 14:45
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [EMMA-users] Emma HTML report shows uncovered line although it is


Does _xaDataSource.getXAConnection(user, password) throw exception?


Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        <emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
cc:        

Subject:        [EMMA-users] Emma HTML report shows uncovered line although it is

I have a very simple class which delegate calls to an XADataSource.
Although the method getXAConnection(String userName, String password) is called (I see a log in the stdout), the HTML report shows is as uncovered (red lines).
Am I doing something wrong or is it a ... bug?
I attached the class.
Best regards
Massimo
<<source file>>

vlad | 16 Aug 2004 18:10
Favicon

RE: Emma HTML report shows uncovered line although it is


EMMA uses basic blocks as its fundamental approach for figuring out code coverage. Line coverage is derived from basic block coverage. For efficiency reasons, EMMA does not consider method calls as basic block delimiters (the assumption being that "normal" code is usually written to complete "normally").

Now, if a method does abort with an exception it will mark the entire enclosing basic block as uncovered. The block will usually include a few lines of code before the method call. I agree that the results usually look somewhat odd, but it's a tradeoff decision I've made between efficiency and "oddness" of results in what I thought would be a rare testing case. The users are expected to fix this by making their method complete normally at least once (seems like it should be their goal anyway).

This has come up in the "Open Discussion" online forum a couple times.The FAQ content around how EMMA does code coverage is helpful reading for this: http://emma.sourceforge.net/faq.html. I am in the process of re-vamping the website and will consider this issue for another FAQ entry.

Hope this helps,
Vlad.


Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        <emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
cc:        

Subject:        RE: [EMMA-users] Emma HTML report shows uncovered line although it is

I really apologize, getXAConnection throws an exception!
But... then I don't understand why the method is marked in red and why isn't the System.out.println statement marked as green.
Best Regards!
Massimo
 
 
-----Original Message-----
From: Ferrari Massimo
Sent: Montag, 16. August 2004 15:10
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [EMMA-users] Emma HTML report shows uncovered line although it is

No exception is thrown.
I have extrapolated a simple test case which reproduces the error, please let me know where to upload it because it is 3 MB of data...
You have to configure a datasource in XADataSourceWrapper.java (I'm using oracle) and set the correct JAVA_HOME in build/setenv.bat.
Then run build/build.bat in the build directory.
The HTML is stored under docs/coverage.
Best Regards!
Massimo
 
-----Original Message-----
From: vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org [mailto:vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org]
Sent: Montag, 16. August 2004 14:45
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [EMMA-users] Emma HTML report shows uncovered line although it is


Does _xaDataSource.getXAConnection(user, password) throw exception?


Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        <emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
cc:        

Subject:        [EMMA-users] Emma HTML report shows uncovered line although it is

I have a very simple class which delegate calls to an XADataSource.
Although the method getXAConnection(String userName, String password) is called (I see a log in the stdout), the HTML report shows is as uncovered (red lines).
Am I doing something wrong or is it a ... bug?
I attached the class.
Best regards
Massimo
<<source file>>

Ferrari Massimo | 16 Aug 2004 15:17
Picon

RE: Emma HTML report shows uncovered line although it is

I really apologize, getXAConnection throws an exception!
But... then I don't understand why the method is marked in red and why isn't the System.out.println statement marked as green.
Best Regards!
Massimo
 
 
-----Original Message-----
From: Ferrari Massimo
Sent: Montag, 16. August 2004 15:10
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [EMMA-users] Emma HTML report shows uncovered line although it is

No exception is thrown.
I have extrapolated a simple test case which reproduces the error, please let me know where to upload it because it is 3 MB of data...
You have to configure a datasource in XADataSourceWrapper.java (I'm using oracle) and set the correct JAVA_HOME in build/setenv.bat.
Then run build/build.bat in the build directory.
The HTML is stored under docs/coverage.
Best Regards!
Massimo
 
-----Original Message-----
From: vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org [mailto:vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org]
Sent: Montag, 16. August 2004 14:45
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [EMMA-users] Emma HTML report shows uncovered line although it is


Does _xaDataSource.getXAConnection(user, password) throw exception?



Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        <emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
cc:        

Subject:        [EMMA-users] Emma HTML report shows uncovered line although it is

I have a very simple class which delegate calls to an XADataSource.
Although the method getXAConnection(String userName, String password) is called (I see a log in the stdout), the HTML report shows is as uncovered (red lines).
Am I doing something wrong or is it a ... bug?
I attached the class.
Best regards
Massimo
<<source file>>

Ferrari Massimo | 16 Aug 2004 15:10
Picon

RE: Emma HTML report shows uncovered line although it is

No exception is thrown.
I have extrapolated a simple test case which reproduces the error, please let me know where to upload it because it is 3 MB of data...
You have to configure a datasource in XADataSourceWrapper.java (I'm using oracle) and set the correct JAVA_HOME in build/setenv.bat.
Then run build/build.bat in the build directory.
The HTML is stored under docs/coverage.
Best Regards!
Massimo
 
-----Original Message-----
From: vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org [mailto:vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org]
Sent: Montag, 16. August 2004 14:45
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [EMMA-users] Emma HTML report shows uncovered line although it is


Does _xaDataSource.getXAConnection(user, password) throw exception?



Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        <emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
cc:        

Subject:        [EMMA-users] Emma HTML report shows uncovered line although it is

I have a very simple class which delegate calls to an XADataSource.
Although the method getXAConnection(String userName, String password) is called (I see a log in the stdout), the HTML report shows is as uncovered (red lines).
Am I doing something wrong or is it a ... bug?
I attached the class.
Best regards
Massimo
<<source file>>

vlad | 16 Aug 2004 14:45
Favicon

Re: Emma HTML report shows uncovered line although it is


Does _xaDataSource.getXAConnection(user, password) throw exception?



Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        <emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
cc:        

Subject:        [EMMA-users] Emma HTML report shows uncovered line although it is

I have a very simple class which delegate calls to an XADataSource.
Although the method getXAConnection(String userName, String password) is called (I see a log in the stdout), the HTML report shows is as uncovered (red lines).
Am I doing something wrong or is it a ... bug?
I attached the class.
Best regards
Massimo
<<source file>>


Gmane