Hi ,
I am trying to configure jacoco for getting test coverage report
1> Not able to add jacoco agent jar file to tomcat
Added java agent in catalina java_opts as per given document. [ Ref Link :
http://www.eclemma.org/jacoco/trunk/doc/agent.html ]
When i was trying to shut down tomcat , it is giving me below error :
Failed to find Premain-Class manifest attribute in /root/justransform/apache-tomcat-7.0.34/lib/jacocoagent.jar
Error occurred during initialization of VM
agent library failed to init: instrument
2> I was trying to configure maven plugin for my integration test suit.
My current setup is my application is up on one remote server and i am running my selenium tests from my machine.
Below is changes made in pom.xml for same to work :
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5-SNAPSHOT</version>
<executions>
<execution>
<id>prepare-unit-test-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>generate-unit-test-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>prepare-integration-test-agent</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>generate-integration-test-report</id>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<executions>
<execution>
<id>run-unit-tests</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>${skipUnitTests}</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe.plugin.version}</version>
<executions>
<execution>
<id>run-integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<skip>${skipIntegrationTests}</skip>
</configuration>
</execution>
</executions>
</plugin>
What should be ideal approach for this ? Can anybody guide me with right steps for second task. I am unable to find way from available documentation.