0
votes

I have code running on a separate virtual machine with separate JVM. I want to setup JaCoCo agent in tcpserver mode on this virtual machine to collect coverage data. Then I will setup JaCoCo agent in my maven project in tcpclient mode to connect to the VM mentioned above and fetch the coverage data.

The problem is that the agent does not collect any coverage data. In creates the coverage data file, but the file is empty.

Here is the agent options: -javaagent:/usr/xx/plugins/org.jacoco.agent.jar=destfile=/usr/xx/jacoco.exec,output=file,append=true,dumponexit=false,classdumpdir=/usr/xx/dump/

Note: my code runs in OSGi container.

Regards, Rashid

1

1 Answers

0
votes

It turned out that everything from JaCoCo side is OK. The problem is the way we shutdown OSGi framework. We use OS kill command to shutdown the Java process. That's why the coverage data file is not populated. If we shutdown the OSGi framework gracefully, the coverage data file is populated with all the coverage information.