Hi ,
I m supposed to evaluate JCoverage
I m using Joverage-plus, and ANT-1.6 j2sdk1.4.1_02..
I m able to compile my test classes & source classes , execute my test classes, display my test reports .. however my coverage reports display 0 % hit rate for my source files thought it is quite obvious that my test cases have been executed... AM i correct in displaying the coverage report for my source instrumented classes though it is the tests cases that are being executed........
my build file is as follows :-
<?xml version="1.0" encoding="UTF-8"?>
<project name="MyProject" default="main" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="src" location="C:\apache-ant-1.6.2\bin"/>
<property name="build" location="C:\apache-ant-1.6.2\bin\MyProject"/>
<target name="main" depends="compile,instrument,test,coverage"/>
<path id="jcoverage">
<fileset dir="C:\jcoverage-plus-1.2.9">
<include name="jcoverage-plus.jar"/>
</fileset>
</path>
<path id="jtestrun-log4j-appender">
<fileset dir="C:\jcoverage-plus-1.2.9">
<include name="jtestrun-log4j-appender.jar"/>
</fileset>
</path>
<path id="servlet">
<fileset dir="C:\jcoverage-plus-1.2.9\examples_OLD\lib">
<include name="servlet/2.3-fcs/servlet.jar"/>
</fileset>
</path>
<path id="ejb">
<fileset dir="C:\jcoverage-plus-1.2.9\examples_OLD\lib">
<include name="ejb/2.0-fr/ejb.jar"/>
</fileset>
</path>
<path id="jdbc">
<fileset dir="C:\jcoverage-plus-1.2.9\examples_OLD\lib">
<include name="jdbc/2.0/jdbc2_0-stdext.jar"/>
</fileset>
</path>
<path id="log4j">
<fileset dir="C:\jcoverage-plus-1.2.9\examples_OLD\lib">
<include name="log4j/1.2.8/log4j.jar"/>
</fileset>
</path>
<taskdef classpath="C:\jcoverage-plus-1.2.9\jcoverage-plus.jar" resource="tasks.properties"/>
<target name="compile" description="compile the source " >
<!--Compile the java code from ${src} into ${build}-->
<javac srcdir="C:\apache-ant-1.6.2\bin\MyProject\src" destdir="C:\apache-ant-1.6.2\bin\MyProject\class" failonerror="yes" debug="yes">
<classpath refid="jcoverage"/>
<classpath refid="servlet"/>
<classpath refid="ejb"/>
<classpath refid="jdbc"/>
<classpath refid="log4j"/>
</javac>
<rmic base="C:\apache-ant-1.6.2\bin\MyProject\class">
<include name="com/example/rmi/compute/ComputeImpl.class"/>
</rmic>
<permission>
<fileset dir="C:\apache-ant-1.6.2\bin\MyProject\class">
<include name="**/*.class"/>
<exclude name="**/*Test.class"/>
</fileset>
</permission>
<javac srcdir="C:\apache-ant-1.6.2\bin\MyProject\test" destdir="C:\apache-ant-1.6.2\bin\MyProject\testClass" failonerror="yes" debug="yes">
<classpath location="C:\apache-ant-1.6.2\bin\MyProject\class"/>
<classpath refid="jcoverage"/>
<classpath refid="servlet"/>
<classpath refid="ejb"/>
<classpath refid="jdbc"/>
<classpath refid="log4j"/>
</javac>
</target>
<target name="instrument" description="Add jcoverage instrumentation">
<instrument todir="C:\apache-ant-1.6.2\bin\MyProject\instrumented-classes">
<fileset dir="C:\apache-ant-1.6.2\bin\MyProject\class">
<include name="**/*.class"/>
</fileset>
</instrument>
</target>
<!--
<target name="test" >
<junit printsummary="yes" showoutput="yes" haltonfailure="yes">
<classpath location="C:\apache-ant-1.6.2\bin\MyProject\instrumented-classes"/>
<classpath location="C:\apache-ant-1.6.2\bin\MyProject\class"/>
<formatter type="plain"/>
<batchtest fork="yes" todir="C:\apache-ant-1.6.2\bin\MyProject\reports">
<fileset dir="C:\apache-ant-1.6.2\bin\MyProject\src">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
-->
<target name="test">
<jtestrun todir="C:\apache-ant-1.6.2\bin\MyProject\reports" >
<classpath>
<path location="C:\apache-ant-1.6.2\bin\MyProject\instrumented-classses"/>
<path location="C:\apache-ant-1.6.2\bin\MyProject\class"/>
<path location="C:\apache-ant-1.6.2\bin\MyProject\testClass"/>
<path refid="jtestrun-log4j-appender"/>
<path refid="servlet"/>
<path refid="ejb"/>
<path refid="jdbc"/>
<path refid="log4j"/>
</classpath>
<fileset dir="C:\apache-ant-1.6.2\bin\MyProject\test">
<include name="**/*Test.java"/>
</fileset>
</jtestrun>
</target>
<target name="coverage" description="HTML and XML coverage reports can be found in build/coverage" >
<report destdir="C:\apache-ant-1.6.2\bin\MyProject\CoverageReport">
<!--
source path is being used here to demonstrate a coverage
report being generated from multiple source directories
-->
<sourcepath>
<path location="C:\apache-ant-1.6.2\bin\MyProject\src"/>
<path location="C:\apache-ant-1.6.2\bin\MyProject\test"/>
</sourcepath>
</report>
<report srcdir="C:\apache-ant-1.6.2\bin\MyProject\src" destdir="C:\apache-ant-1.6.2\bin\MyProject\CoverageReport" format="html"/>
<echo>
jcoverage reports have been generated.
The HTML report is index.html
The XML report is coverage.xml
</echo>
</target>
<!--
<target name="coverage">
<report format="html" srcdir="C:\apache-ant-1.6.2\bin\MyProject\src" destdir="C:\apache-ant-1.6.2\bin\MyProject\CoverageReport"/>
</target>
-->
</project>
Is there any issue of JVM here????Please reply ..
Thanking in advance.......
Regards..
Akash
---------------------------------
ALL-NEW Yahoo! Messenger - all new features - even more fun!
[Non-text portions of this message have been removed]
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/junit/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
