Menu

EclEmma with Google App Engine apps?

Help
Anonymous
2012-03-23
2013-04-24
  • Anonymous

    Anonymous - 2012-03-23

    First, I am very impressed with how easy EclEmma is to install and use.  Within 5 minutes I went from knowing nothing to having code coverage results (and trust me, this is due to EclEmma, not me :) ).

    I did notice something a little odd in the results - it seemed like all my "server side" code was showing up as 0%.  Then I figured that I probably needed to run the server side "with Coverage".  Since my app gets deployed using Google App Engine, when I am testing locally, I start the Server side with a Run configuration that seems to be a "Web Application" type of Run configuration that is specific to Google App Engine apps.  In particular,  it has a Server tab and an App Engine tab.  Note: this is NOT a GWT application - so I can't use the GWT/EclEmma solution that is out there (or at least I think I can't).

    So, has anyone used EclEmma with a GAE app (when testing locally of course).

    Thanks!
    RB

     
  • Anonymous

    Anonymous - 2012-03-23

    Some additional information….
    I had created a standard Run Configuration (not a special Web Application style Run Configuration that I normally use with my GAE app), thinking that if I had a standard Run Configuration for the "server side", I would be able to use that Run Configuration for my "Coverage Configuration".  But that standard Run Configuration failed with an error about not finding a war file - "Usage: <dev-appserver>  <war directory>".  By modifying the information on the Arguments tab, I as able to start the server side using the standard Java Run configuration and then I was able to run the server side "with coverage".

    I thought this might solve the problem.  But then, with the server side running, I started my JUnit test (under Coverage) and when the tests were complete, the code coverage results were unchanged.  Specifically my server side classes were at 0% - and clearly that code is actually being called since the tests are passing. 

    Any ideas?  Am I missing something obvious or trying to do something impossible?

    Thanks!
    RB

     
  • Marc R. Hoffmann

    Hi,

    in the context menu of EclEmma's coverage view you find an entry "Open Execution Data" which will open a new editor listing all classes loaded by the JVM during the test.

    Can you please check whether your server side classes are listed here?

    Thx,
    -marc

     
  • Anonymous

    Anonymous - 2012-03-25

    Thank you for the suggestion.  The short answer is "yes", the server side classes are listed.  But first, it seems that I may have stumbled upon a very simple solution by adding one more step to what I was doing above.

    1. I start the server (using Run As Java app with the configuration "CommitAPI-Coverage")
    2. I run the Junit tests from the "Coverage" menu
    3. On the coverage tab, I see the "disappointing" results of:
    server - 0.0%
    shared - 42.1%
    domain - 75.0%
    test - 100.0%
    4. Now I press the Dump Execution data button and choose "CommitAPI-Coverage"
    Now I see much more "pleasing" results:
    server - 74.1%
    shared - 94.7%
    domain - 70.8%
    test - 0.0%
    5. Finally, I press the Merge button and merge "Basic Commitment Tests" (client) and "CommitAPI-Coverage" (server) and get:
    server - 74.1%
    shared - 94.7%
    domain - 70.8%
    test - 100.0%

    So, it seems that the Dump Execution Data button does everything I need.  Could it be this simple??

    Back to the details on your original question…
    1. When the active EclEmma session is the "client" side, I do NOT see the server side classes
    2. When the active EclEmma session is the "server" side, I DO see the server side classes

    Thanks so much - and EclEmma is a pretty awesome tool!
    RB

     
  • Anonymous

    Anonymous - 2012-03-25

    PS - Sorry for the slow response - looks like the Monitoring function isn't quite working for me.  I will try to manually remember to check back.