Hi,
in your scenario the code under test is not jmeter but the code deployed
to tomcat, right? So you will need to configure tomcat to run under code
coverage not jmeter.
Here are the steps:
1) Start your tomcat configured with this agent as a VM parameter,
typically you will set the environment variable JAVA_OPTS. Use the
output=tcpserver, find all agent options and syntax here
http://www.eclemma.org/jacoco/trunk/doc/agent.html
2) After your tests have finished and before you stop tomcat you dump
execution data from the server with the dump Ant task.
3) Proceed with report generation based on the dumped *.exec file.
Best regards,
-marc
> <targetname="test"><!-- depends="compile"> -->
>
> <!-- Call target to start Tomcat (as a service) -->
> <!-- <antcall target=�tomcat-start�/> -->
>
> <!-- Wrap test execution with the JaCoCo coverage task -->
> <jacoco:coveragedestfile="${result.exec.file}">
> <!-- <java classname="org.jacoco.examples.parser.Main" fork="true">
> <classpath path="${result.classes.dir}" />
> <arg value="2 * 3 + 4"/>
> <arg value="2 + 3 * 4"/>
> <arg value="(2 + 3) * 4"/>
> <arg value="2 * 2 * 2 * 2"/>
> <arg value="1 + 2 + 3 + 4"/>
> <arg value="2 * 3 + 2 * 5"/>
> </java> -->
>
> <jmeterjmeterhome="C:\jmeter\apache-jmeter-2.7"
> testplan="C:\jmeter\apache-jmeter-2.7\tests\auto.jmx"
> resultlog="C:\jmeter\apache-jmeter-2.7\results\coverageTestResults.jtl"/>
>
> </jacoco:coverage>
>
> <!-- Create target to stop Tomcat (as a service) -->
> <!-- <antcall target=�tomcat-stop�/> -->
>
> </target>
> |
>
> When I run 'ant test' at the command line, I get an error:
>
> BUILD FAILED
> C:\...\build.xml:70: jmeter is not a valid child of the coverage task
>
> Is there some way I can do this ?
>
> Thanks,
> Colm
>
> --
>
>
--
Marc Hoffmann
hoff...@mountainminds.com
_______________________________________________
Mountainminds GmbH & Co. KG
Nussbaumstr. 4 * 80336 Muenchen * Germany
Phone/Fax
+49-700-68664637 * 0700-MTNMINDS
Registergericht Muenchen * HRA 80201
Mountainminds Verwaltungs GmbH
Registergericht Muenchen * HRB 143183
Geschaeftsfuehrer Marc Hoffmann