You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Deepa Remesh <dr...@gmail.com> on 2005/11/22 01:40:33 UTC

Question about EMMA code coverage tool

I was running EMMA tool to get coverage for network server code. I
found Raman's document at
http://db.apache.org/derby/binaries/DerbyCodeCoverageUsingEmma.pdf
very helpful when using EMMA.

I noticed that the coverage for the test derbynet/testProtocol.java is
not being recorded by the tool. This test sends commands which get
executed at network server. The code which runs in the network server
process is not getting recorded. I am looking into how this can be
recorded in the coverage. If anyone familiar with EMMA has any
suggestions for this, please let me know.

Thanks,
Deepa

Re: Question about EMMA code coverage tool

Posted by Deepa Remesh <dr...@gmail.com>.
On 11/22/05, Daniel John Debrunner <dj...@debrunners.com> wrote:
> Deepa Remesh wrote:
>
>
> > I had checked this out. The coverage for testProtocol.java did not get
> > recorded in these runs too.

Sorry, I meant to say "coverage for the code tested by
testProtocol.java" is not recorded.

>
> I thought the code coverage info only included information for classes
> that shipped as part of the product jars. From the name I'm assuming
> that testProtocol is a test and should not be in any of the shipped
> product jars.

testProtocol.java tests protocol errors and covers error paths which
can be seen in the stack traces in DerbyNetClient.out generated by the
test run. e.g, In the coverage report, it does not show coverage for
the method 'DRDAConnThread.badObjectLength', whereas it is actually
covered:

<snippet from DerbyNetClient.out>
.
.
.
org.apache.derby.impl.drda.DRDAProtocolException
	at org.apache.derby.impl.drda.DRDAConnThread.throwSyntaxrm(DRDAConnThread.java:406)
	at org.apache.derby.impl.drda.DRDAConnThread.badObjectLength(DRDAConnThread.java:6750)
	at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSAT(DRDAConnThread.java:1255)
	at org.apache.derby.impl.drda.DRDAConnThread.exchangeServerAttributes(DRDAConnThread.java:957)
	at org.apache.derby.impl.drda.DRDAConnThread.sessionInitialState(DRDAConnThread.java:556)
	at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:212)

.
.
.

I think the problem is that EMMA is not recording coverage for network
server started by the test framework.

Thanks,
Deepa

Re: Question about EMMA code coverage tool

Posted by Daniel John Debrunner <dj...@debrunners.com>.
Deepa Remesh wrote:


> I had checked this out. The coverage for testProtocol.java did not get
> recorded in these runs too.

I thought the code coverage info only included information for classes
that shipped as part of the product jars. From the name I'm assuming
that testProtocol is a test and should not be in any of the shipped
product jars.

Dan.



Re: Question about EMMA code coverage tool

Posted by Deepa Remesh <dr...@gmail.com>.
> Is the emma.jar in you CLASSPATH  or under the  $JAVA_HOME/jre/lib/ext ?
>
> If it is in the CLASSPATH, can you please put the emma.jar under the
> jre/lib and try. I suspect
> the way the Network server is started during that test,  the
> instrumented classes used are not
> getting recorded.
>
> Maybe another option is to use the '-m fullcopy' instead of  '-m
> overwrite' during instrumenting. I will also try looking
> into any other options.

Thanks for the suggestions. I tried both the options but they did'nt
work for me.

>
> FYI - Older code coverages for v10.1 is at -
> http://people.apache.org/~fuzzylogic/

I had checked this out. The coverage for testProtocol.java did not get
recorded in these runs too.

>
> Regards,
> Rajesh
>
>
>

Re: Question about EMMA code coverage tool

Posted by Rajesh Kartha <ka...@Source-Zone.Org>.
Deepa Remesh wrote:

>I was running EMMA tool to get coverage for network server code. I
>found Raman's document at
>http://db.apache.org/derby/binaries/DerbyCodeCoverageUsingEmma.pdf
>very helpful when using EMMA.
>
>I noticed that the coverage for the test derbynet/testProtocol.java is
>not being recorded by the tool. This test sends commands which get
>executed at network server. The code which runs in the network server
>process is not getting recorded. I am looking into how this can be
>recorded in the coverage. If anyone familiar with EMMA has any
>suggestions for this, please let me know.
>
>Thanks,
>Deepa
>
>  
>
Hi Deepa,

Is the emma.jar in you CLASSPATH  or under the  $JAVA_HOME/jre/lib/ext ?

If it is in the CLASSPATH, can you please put the emma.jar under the 
jre/lib and try. I suspect
the way the Network server is started during that test,  the 
instrumented classes used are not
getting recorded.

Maybe another option is to use the '-m fullcopy' instead of  '-m 
overwrite' during instrumenting. I will also try looking
into any other options.

FYI - Older code coverages for v10.1 is at - 
http://people.apache.org/~fuzzylogic/

Regards,
Rajesh