From: Zac H. <zac...@gm...> - 2011-12-21 19:15:18
|
I am brand new to Cobertura and am getting what looks like a fairly common error. The only problem is that the solutions I'm seeing posted online don't seem to be helping me! Here is my *cobertura.class.path*: <path id="cobertura.class.path"> <fileset dir="lib/test"> <include name="**/*.jar"/> </fileset> </path> And here is my *code-coverage-setup* Ant target which defines * cobertura-instrument*: <target name="code-coverage-setup"> <taskdef classpathref="cobertura.class.path" resource="tasks.properties" /> <cobertura-instrument todir="generated/instrumented-bin/cobertura" datafile="generated/data/cobertura/cobertura.ser"> <fileset dir="bin/main"> <include name="**/*.class"/> </fileset> </cobertura-instrument> </target> Then inside my primary *test* Ant target, I call *code-coverage-setup* as the first item (prior to confiruing the *junit* element): <target name="test" depends="test-compile"> <antcall target="code-coverage-setup"/> <junit printsummary="yes" haltonfailure="no" failureproperty="tests.failed"> ... </target> In the Ant build output I am getting the following printout when I run *test *: test: code-coverage-setup: [taskdef] Could not load definitions from resource tasks.properties. It could not be found. BUILD FAILED C:\Users\me\Desktop\workspace\MyProject\build.xml:190: The following error occurred while executing this line: C:\Users\meDesktop\workspace\MyProjectbuild.xml:272: Problem: failed to create task or type cobertura-instrument Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any <presetdef>/<macrodef> declarations have taken place. Line 190 is the antcall to the *code-coverage-setup* target, and Line 272 is the line inside the *cobertura-instrument* element where the *datafile*attribute is being set to "generated/data/cobertura/cobertura.ser". Relevant online searches seem to indicate that I am simply missing this * tasks.properties* file. My question: where is this file?!?! How do I find/download it? Where should I place this file so that Ant/Cobertura can pick it up and use it? I downloaded the latest Cobertura distrib and did not see this properties file anywhere inside of it. Please advise! And thanks in advance! Zac |