The report shows zero test coverage and in session tab I'm getting list of classes from remote web service. So, classes being tested are enlisted in report.
As, I am new to JACOCO, I have few basic questions to ask.
1. Logically its impossible to get source attached to remote classes enlisted in session. But still, is there such provision?
2. Why I'm getting zero test coverage? jacoco.exec seems fine at server end. I read few posts earlier, as I was facing issue of linking source to class and at that time too I was getting zero test coverage. Is this a similar issue.
Please guide me to resolve these issue. If anyone want more explanation, plz let me know. Thanks in advance :-)
So, requirement is to get integration test coverage of remote web service in local client. Problem is I don't have access to source and classes of web service. Following are the things I have accomplished till now.
1. Created standalone application(local client) consisting test cases, which are hitting web service APIs for test purpose. I update its maven configuration to add jacoco maven plugin and failsafe plugin. Assigned path for jacoco.exec and data directory.
2. I followed, tcpserver approach. Modified catalina.sh file of tomcat which is hosting web service. Inserted following line
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:jacocoagent.jar=output=tcpserver,address=xyz,port=xyz,classdumpdir=temp,dumponexit=false,includes=xyz*"
3. And after this change, at client side application, I added 'dump' goal to receive test execution dump from server. Thats all.
Everything is working fine at client side as well as server side. Execution dump is getting transferred from server to client, which I can see in Jacoco report at client app.
But I'm only getting list of classes(names) of web services in session of report. As, I don't have access to remote classes. Report is unable to link classes to its sources.
Also, at server side, due to tcpserver output type, jacoco.exec is not getting created. Also no report in html form found at server side.
I'm new to testing domain. And all above things I have achieved in last 2 days. Considering my requirement, I might have opted wrong approach.
So, it will be helpful, if somebody corrects me and guide me for right approach towards the requirement. Also, in coming future I want to integrate this report in SONAR as well.
Thanks for help and patience. :-)