3

I'm using the eclEmma plugin to test code coverage for my gwt application. I've written jUnit test classes for client code, such as testing get/set methods etc. as well as jUnit tests for rpc services. I used "syncproxy" to test my equivalent GreetService, GreetServiceAsync and GreetServiceImpl rpc services. For example I have a location service that gets a users location and this is part of my test class:

public class LocationServiceTest {

private static LocationService rpcService =
        (LocationService) SyncProxy.newProxyInstance(LocationService.class,
      "http://localhost:...", "location");

@Test
public void testAdministrativeAreaLevel2LocationService() {
    String result = rpcService.getAddress("49.28839970000001,-123.1259316");
    assertTrue((result != null) && (result.startsWith("Vancouver")));

}

The jUnit tests all pass, but when I run eclEmma on my project (I right click the project, select "Coverage as" then "jUnit test") I only get coverage results for client code, and 0% coverage for all my server code.

Any suggestions for how to get eclEmma to cover server code? Or for what I might be doing wrong?

1 Answers1

0

EclEmma tracks coverage on code launched at the test jvm (the vm you launch when you run the test). You seem to be running your server before, so eclEmma "can't see" its coverage. You could try running the server inside your tests, with Cargo, for example.

juanignaciosl
  • 3,435
  • 2
  • 28
  • 28