I'm new to use Jacoco to get restapi testing codecoverage of my java webapp project.
The way I run my webapp project:
1) use gradle to add embedded tomcat dependencies
2) create a Main function to run tomcat(version8.5) like this:
https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat#deploy-to-heroku 3) use gradle to create a jar file
4) java -jar xxx.jar in other place(wanna to deploy to aws)
now after run jar file, tomcat start runing and api response is ok
I also wrote sample test code using rest-assure
in this situation how could I use jacoco to coverage code when running the jar file?
I tried add -javaagent like this:
java -javaagent:jacocoagent.jar=classdumpdir=dump -jar xxx.jar
when I stopped run using ctrl-c, java class files dumped into dump folder and
a jacoco.exec file created but 0 bytes...
please help me..
お願いします。
帮帮忙。。