In case anyone is interested, this is how you can use EclEmma code coverage 
tool with GAE/J apps. The same content also available in this 
GoogleDoc<https://docs.google.com/document/d/1qqwV_cwXaLA-1ldDN8m88BmwqsX_VziDuAqy6jWSAbU/pub?embedded=true>
.

------------------------------------------------------------------------------------------------------------------

Measuring Code Coverage of Google App Engine  Apps (Java) using EclEmma

EclEmma <http://www.eclemma.org/> is a free Code Coverage tool for Java. It 
comes as an Eclipse plugin.

[image credit: eclemma.org]

Out of the box, it cannot show code coverage of the server-side code (e.g., 
Servlets) of an GAE/J application. Here’s an easy workaround you can use to 
measure code coverage of an GAE/J app running on the dev server. The 
essence of this workaround is to collect coverage data from the dev server 
as as separate session and merge it with coverage data collected from JUnit 
tests. Here are the steps.

Step 1. Create a ‘Coverage configuration’ for starting the Dev server.

Use ‘Java Application’ as the type. Configure tabs such as ‘Man’ and 
‘Arguments’ with the same parameter values you used when creating your 
normal ‘Run as web application’ configuration used to start the dev server 
normally.

Step 2: Start the dev server in the coverage mode. That is, run the 
configuration you created above.

Step 3: Run your unit tests in coverage mode. This can be done by 
right-clicking your JUnit class and choosing ‘Coverage as’ → ‘Junit test’

After this step, your ‘Coverage’ tab will show coverage results for tests 
that doesn’t involve the server.

Step 4: Retrieve coverage data for server-side. For this, you can use the 
‘dump execution data’ menu item.

Step 5: Merge coverage data. Use the ‘merge sessions’ menu item to merge 
coverage data from the server-side and JUnit tests.

Note: I found this workaround in this in a post by Richard 
Berger<http://sourceforge.net/projects/eclemma/forums/forum/614870/topic/5138797>.
 
The above is simply a detailed explanation of the same solution.

------------------------------

[Author: Damith, from the TEAMMATES 
team<https://teammatesv4.appspot.com/about.html> ] 
[Last edited: 17 Apr 2013]

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to