Skip to content

Commit 7bc9fef

Browse files
authoredNov 13, 2017
Added emma service for on demand coverage dump
1 parent 7f0747d commit 7bc9fef

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
 

‎EmmaController.java

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package rnd.web;
2+
3+
import java.io.File;
4+
5+
import javax.ws.rs.GET;
6+
import javax.ws.rs.POST;
7+
import javax.ws.rs.Path;
8+
import javax.ws.rs.Produces;
9+
import javax.ws.rs.core.MediaType;
10+
11+
import com.vladium.emma.rt.RT;
12+
import com.vladium.util.IProperties;
13+
14+
@Path("/emma")
15+
public class EmmaController {
16+
17+
public EmmaController() {
18+
}
19+
20+
@GET
21+
@Produces(MediaType.TEXT_PLAIN)
22+
@Path("/props")
23+
public String getAppProperties() {
24+
IProperties appProperties = RT.getAppProperties();
25+
return appProperties.toProperties().toString();
26+
}
27+
28+
@POST
29+
@Produces(MediaType.TEXT_PLAIN)
30+
@Path("/dump")
31+
public String dumpCoverage() {
32+
String coverageOutFile = RT.getAppProperties().getProperty("coverage.out.file");
33+
RT.dumpCoverageData(new File(coverageOutFile), false);
34+
return coverageOutFile;
35+
}
36+
37+
}

0 commit comments

Comments
 (0)
Please sign in to comment.