ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mohamed, Haneef" <>
Subject RE: jpcoverage/junit intergration: how do I capture junit coverag e with with JProbe?
Date Tue, 16 Apr 2002 18:43:34 GMT
Thanks for the quick respons Gordon. I'll get busy with .reflection and post
my findings.


-----Original Message-----
From: Gordon Tyler []
Sent: Tuesday, April 16, 2002 2:29 PM
To: Ant Users List
Subject: Re: jpcoverage/junit intergration: how do I capture junit
coverage with with JProbe?

First, a disclaimer: I work at Sitraka (who produces JProbe) but I do not
work on JProbe itself. I am part of another team at Sitraka which merely
uses JProbe Coverage with JUnit tests. So I can't give support on JProbe.

We don't use the jpcoverage or junit tasks because of the limitations that
you've pointed out but rather we execute jplauncher.exe using an <exec> task
and pass all the appropriate command-line arguments. Also, we don't execute
TestRunner directly, but rather a class which we wrote that automatically
"discovers" all the test classes in our packages and builds a TestSuite
which it then runs using TestRunner.

Here's the <exec> task that we use:

<property name="coverage.home" value="${env.COVERAGE_HOME}"/>

<exec executable="${coverage.home}/jplauncher.exe">
        <arg value="-classpath"/>
        <arg value="YOUR_CLASSPATH_HERE"/>
        <arg value="-jp_function=coverage"/>
        <arg value="-jp_java_home=${java.home}"/>
        <arg value="-jp_java_exe=${java.home}/bin/java.exe"/>
        <arg value="-jp_vm=java2"/>
        <arg value="-jp_final_snapshot=coverage"/>
        <arg value="-jp_ignore_abstract=true"/>
        <arg value="-jp_record_from_start=coverage"/>
        <arg value="-jp_output_file=YOUR_OUTPUT_FILENAME_HERE"/>
        <arg value="-jp_snapshot_dir=YOUR_SNAPSHOT_DIRECTORY_HERE"/>
        <arg value="-jp_working_dir=YOUR_BUILD_WORKING_DIRECTORY_HERE"/>
        <arg value="com.acme.product.AutoTest"/>
        <arg value="-o"/>
        <arg value="YOUR_LOG_FILENAME_HERE"/>

The jp_working_dir option should point to a directory where your tests would
expect to be running from, so that they can find data files, etc. if
necessary. So in our case that would be our build/dist directory which
contains the jars and data files of our application.

The jp_filter option should be changed to use the correct includes and
excludes for your code.

com.acme.product.AutoTest is the fictional name of the "test discovery and
execution" class that I described earlier.

I don't actually use this myself, it's used by the QA guys on the team, so
I'm not 100% sure of how it all works ;) It's used in the context of a
nightly build where there isn't a human to observe it, so I don't think it
displays the Coverage UI.


----- Original Message -----
From: "Mohamed, Haneef" <>
To: <>
Sent: Tuesday, April 16, 2002 1:35 PM
Subject: jpcoverage/junit intergration: how do I capture junit coverage with
with JProbe?

> Hello everyone!
> Here is the problem I am encountering:
> Aim
> To run junit tests and capture code coverage metrics with jprobe as part
> the build process [pre-deployment]
> via ant

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message