Доброго времени суток, возникла следущая проблема, сгенерированый emma файл репорта не отображает код класа который тестируется JUnit. Вот код build.xml файла:
Код | <?xml version="1.0" encoding="UTF-8"?> <project default="all"> <property file="build.properties" /> <path id="classpath.test"> <pathelement location="${tst-dir}" /> <fileset dir="${lib}"> <include name="*.jar"/> </fileset> </path> <!-- Load <emma> and <emmajava> custom tasks so that they can be used in ANT --> <taskdef resource="emma_ant.properties" classpathref="classpath.test" /> <target name="compile-test"> <javac srcdir="${tst-dir}" verbose="true" > <classpath refid="classpath.test"/> </javac> </target> <!-- Define which classes will be reported in the coverage reports (by default, we will include all classes and assume --> <!-- that your project's output folder is target/classes --> <path id="emma.coverage.classes" > <pathelement location="${tst-dir}" /> </path> <target name="emmaOn" depends="compile-test" > <mkdir dir="${coverage.dir}"/> <!-- EMMA instr class output directory (it is important to create this property only when EMMA is enabled) --> <mkdir dir="${instr.dir}" /> <!-- EMMA INSTRUMENTATION --> <!-- ======================================================================= --> <!-- Instrument the classes, this takes the normal classes, and makes instrumented classes instead --> <!-- Note that EMMA takes regular ANT path elements as instrumentation input, which is exceedingly convenient --> <emma enabled="true"> <instr instrpathref="emma.coverage.classes" verbosity="info" destdir="${instr.dir}" metadatafile="${coverage.dir}/metadata.emma" merge="true" > <!-- this property, if overriden via -Demma.filter=<list of filter specs> on ANT's command line, will set the coverage filter; by default, all classes found in 'emma.coverage.classes' pathref will be instrumented: --> <filter value="" /> </instr> </emma> </target> <target name="clean-compile-test" depends="emmaOn"> <delete verbose="true"> <fileset dir="${tst-dir}" includes="**/*.class" /> </delete> </target> <target name="test" depends="clean-compile-test"> <junit fork="true" haltonfailure="false"> <classpath refid="classpath.test" /> <classpath> <path location="${instr.dir}"/> </classpath> <formatter type="xml" usefile="true"/> <jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" /> <jvmarg value="-Demma.coverage.out.merge=true" /> <test name="mgub.softservecom.training.ParseByDOMTest" todir="${tst-dir}"/> <test name="mgub.softservecom.training.AddDataByDOMTest" todir="${tst-dir}"/> </junit> <!-- if enabled, generate coverage report(s): --> <emma enabled="true"> <report sourcepath="src" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100" > <!-- collect all EMMA data dumps (metadata and runtime) [this can be done via nested <fileset> fileset elements or <file> elements pointing to a single file]: --> <fileset dir="${coverage.dir}" > <include name="*.emma" /> </fileset> <!-- for every type of report desired, configure a nested element; various report parameters can be inherited from the parent <report> and individually overridden for each report type: --> <txt outfile="${coverage.dir}/coverage.txt" depth="package" columns="class,method,block,line,name" /> <xml outfile="${coverage.dir}/coverage.xml" depth="package" /> <html outfile="${coverage.dir}/coverage.html" depth="method" columns="name,class,method,block,line" sort="+line, +name" metrics="line:80" /> </report> </emma> </target> <target name="all" depends="test" /> </project>
|
Подскажите пожайлуста что нужно добавить чтоб отображало строки кода в репорт файле? |