ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mohamed, Haneef" <>
Subject jpcoverage/junit intergration: how do I capture junit coverage wi th with JProbe?
Date Tue, 16 Apr 2002 17:35:40 GMT
Hello everyone!

Here is the problem I am encountering:

To run junit tests and capture code coverage metrics with jprobe as part of
the build process [pre-deployment] 
via ant

What I have tried
1. tried to run junit as a nested element within jpcoverage -- failed

2. tried to do an 'antcall' to run junit -- failed

3. The only thing that worked [this is my fallback position] is to pass
one arg at a time, each TestClass, passing one arg is shown below:

  <target name="hm">
            <jpcoverage home="${jpcoveragehome}"
	     	recordfromstart="coverage" snapshotdir="${build}/coverage"
			<classpath refid="c1p.test.classpath"/>
                		<filters defaultexclude="false">
                    			<include class="*Test*" method="*"/>

1. Our junit testclasses do not have a main(...), that would have made my
life a lot easier
2. I am appending the junit target at the end as well

Any suggestions would be greatly appreciated.


Haneef Mohamed

junit target
<target name="test" depends="jar-test, jar-server"
		description="Execute Unit Tests">

		<mkdir dir="${build}/reports"/>
		<junit failureProperty="junit.failed">
			<classpath refid="c1p.test.classpath"/>
			<formatter type="xml" />
			<batchtest todir="${test.reports}">
				    <fileset dir="${test.classes}">
      					<include name="**/Test*.class" />
      					<exclude name="**/TestAll.class" />
      					<exclude name="**/Test*$$*.class" />
		<junitreport todir="${test.reports}">
			<fileset dir="${test.reports}">
				<include name="TEST-*.xml"/>
			<report format="noframes" todir="${test.reports}"/>

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