You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(66) |
Apr
(29) |
May
(85) |
Jun
(66) |
Jul
(24) |
Aug
(139) |
Sep
(72) |
Oct
(26) |
Nov
(142) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(55) |
Feb
(72) |
Mar
(43) |
Apr
(60) |
May
(95) |
Jun
(22) |
Jul
(48) |
Aug
(17) |
Sep
(54) |
Oct
(30) |
Nov
(82) |
Dec
(17) |
2007 |
Jan
(23) |
Feb
(38) |
Mar
(46) |
Apr
(12) |
May
(77) |
Jun
(77) |
Jul
(94) |
Aug
(51) |
Sep
(38) |
Oct
(57) |
Nov
(39) |
Dec
(67) |
2008 |
Jan
(38) |
Feb
(56) |
Mar
(42) |
Apr
(46) |
May
(37) |
Jun
(43) |
Jul
(52) |
Aug
(22) |
Sep
(22) |
Oct
(34) |
Nov
(37) |
Dec
(29) |
2009 |
Jan
(27) |
Feb
(35) |
Mar
(67) |
Apr
(37) |
May
(31) |
Jun
(79) |
Jul
(71) |
Aug
(59) |
Sep
(31) |
Oct
(47) |
Nov
(36) |
Dec
(7) |
2010 |
Jan
(15) |
Feb
(87) |
Mar
(38) |
Apr
(33) |
May
(24) |
Jun
(47) |
Jul
(26) |
Aug
(28) |
Sep
(33) |
Oct
(13) |
Nov
(8) |
Dec
(36) |
2011 |
Jan
(32) |
Feb
(10) |
Mar
(29) |
Apr
(29) |
May
(17) |
Jun
(14) |
Jul
(33) |
Aug
(11) |
Sep
(7) |
Oct
(7) |
Nov
(6) |
Dec
(10) |
2012 |
Jan
(19) |
Feb
(12) |
Mar
(16) |
Apr
(6) |
May
(18) |
Jun
(18) |
Jul
(31) |
Aug
(25) |
Sep
|
Oct
(31) |
Nov
(21) |
Dec
(9) |
2013 |
Jan
(8) |
Feb
(16) |
Mar
(8) |
Apr
(7) |
May
(3) |
Jun
(29) |
Jul
(29) |
Aug
|
Sep
(7) |
Oct
(9) |
Nov
(1) |
Dec
(1) |
2014 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(13) |
May
(8) |
Jun
(5) |
Jul
(2) |
Aug
(4) |
Sep
(4) |
Oct
(2) |
Nov
|
Dec
(2) |
2015 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Yekaterina K. <yek...@or...> - 2011-07-04 09:18:35
|
Hi, I have a project containing both C and Java source. I generate code coverage for Java code using the cobertura.jar and coverage for C code using gcov. I am using a python program called gcovr to produce xml reports in Cobertura format. My question is if is possible to merge xml reports? net.sourceforge.cobertura.merge.Main seems to merge only datafiles in ser-format... Best regards, Yekaterina Kantserova |
From: Steven C. <ste...@re...> - 2011-06-29 18:28:04
|
In real world situations, companies use code coverage tools like cobertura to analyze to see how much of their actual code is being executed when running a test unit. You usually want to have as much code being tested when you run your test units. Code coverage tools are used to test if you are testing several items: - Function coverage - Statement coverage - Decision coverage - Has each case in your IF/Switch statement been executed? - Condition coverage - Has ever boolean expression been executed (not always the same as decision coverage) I have worked for gov't contracts and they actually require no less than 80% code coverage when doing a release. (Basically our test code must execute at least 80% of our actual code or else we can't release an update/hotfix). Code coverage tools have 3 parts to them: 1. Instrumentation: The first step to cobertura is to instrument the code. Basically that's where it will take the compiled code(.class or .jar files), and insert it's own code to count the lines of execution. It will also at the end create a new file with the extension .ser which is a giant file containing all the locations of code that was instrumented (.class or .jar files). 2. Execution: This is the part where you execute any test units or just execute the code like normal. 3. Report: The final step is to report the results you got from cobertura. It will produce results in .xml or .html for easier viewing of lines of code being executed. You can use either Ant <http://cobertura.sourceforge.net/anttaskreference.html> or Command Line <http://cobertura.sourceforge.net/commandlinereference.html> for the first and third steps. The website provide detailed information on how to execute both of these. Hope this helps a little. On 6/29/2011 2:45 AM, gamze altan wrote: > > Hi, i am student at university yet and don't know much about coding.i > searched about cobertura and know about it on theoretical, not > practical. but i've a homework; here it is: > > How can i use cobertura on server, could you give me detailed > infirmation about this? > > Thank you. > -- > *Gamze Altan* > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > > > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel Email Disclaimer: http://www.redprairie.com/emaildisclaimer/ |
From: gamze a. <gmz...@gm...> - 2011-06-29 07:45:19
|
Hi, i am student at university yet and don't know much about coding.i searched about cobertura and know about it on theoretical, not practical. but i've a homework; here it is: How can i use cobertura on server, could you give me detailed infirmation about this? Thank you. -- *Gamze Altan* |
From: John W. L. <Joh...@sa...> - 2011-06-28 17:49:38
|
The counts in the ser file change, but the numbers take the same amount of space. So, the file does not normally change size. In the case where you see it grow from size 0, that means you are not using the file that was created with cobertura-instrument. When I suggested you be more specific with the classes you instrument, it was because I saw things like this in your log: [cobertura-instrument] WARN visitEnd, No line number information found for class org.quartz.core.QuartzScheduler_Skel. Perhaps you need to compile with debug=true? Assuming org.quartz is not your code, I was thinking you would not want to instrument it. Normally, people do not want third-party code in their coverage reports. I am assuming you have resolved all your issues, and everything is working for you. Thanks for your help, Steven. John From: Shivakumar Patil [mailto:sh...@ec...] Sent: Tuesday, June 28, 2011 12:57 PM To: 'Steven Christou'; John W. Lewis Cc: cob...@li...; sh...@ec... Subject: RE: [Cobertura-devel] e-mail Size Updated -> Need Help: instrument/deploying cobertura 1.9.4.1 with tomcat container. Steven/John The below solution worked fine and cobertura.ser file is not being created in system32 folder. Started tomcat and used the application for a while...then stopped the tomcat. The size still remained at cobertura.ser -> 48,757 KB. I was expecting it to grow with contents. ________________________________ From: Steven Christou [mailto:ste...@re...] Sent: Tuesday, June 28, 2011 12:33 PM To: John W. Lewis Cc: Shivakumar Patil; cob...@li...; sh...@ec... Subject: Re: [Cobertura-devel] e-mail Size Updated -> Need Help: instrument/deploying cobertura 1.9.4.1 with tomcat container. I ran into this issue to where the cobertura.ser file was being placed in the system32 folder and that is because Tomcat applications by default start in your system32 folder. You need to pass tomcat a jvm arg with "-Dnet.sourceforge.cobertura.datafile=C:\MyProject\build\cobertura.ser" without quotes. That way the default start location doesn't change, and you are specifying a location for the cobertura data. CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains confidential information belonging to the sender that is legally privileged and proprietary and may be subject to protection under the law, including the Health Insurance Portability and Accountability Act (HIPAA). If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them. Thank you. |
From: Shivakumar P. <sh...@ec...> - 2011-06-28 16:57:30
|
Steven/John The below solution worked fine and cobertura.ser file is not being created in system32 folder. Started tomcat and used the application for a while...then stopped the tomcat. The size still remained at cobertura.ser -> 48,757 KB. I was expecting it to grow with contents. _____ From: Steven Christou [mailto:ste...@re...] Sent: Tuesday, June 28, 2011 12:33 PM To: John W. Lewis Cc: Shivakumar Patil; cob...@li...; sh...@ec... Subject: Re: [Cobertura-devel] e-mail Size Updated -> Need Help: instrument/deploying cobertura 1.9.4.1 with tomcat container. I ran into this issue to where the cobertura.ser file was being placed in the system32 folder and that is because Tomcat applications by default start in your system32 folder. You need to pass tomcat a jvm arg with "-Dnet.sourceforge.cobertura.datafile=C:\MyProject\build\cobertura.ser" without quotes. That way the default start location doesn't change, and you are specifying a location for the cobertura data. CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains confidential information belonging to the sender that is legally privileged and proprietary and may be subject to protection under the law, including the Health Insurance Portability and Accountability Act (HIPAA). If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them. Thank you. |
From: Shivakumar P. <sh...@ec...> - 2011-06-28 16:36:00
|
John, Thanks for the reply. Below are my comments. _____ From: John W. Lewis [mailto:Joh...@sa...] Sent: Tuesday, June 28, 2011 12:00 PM To: Shivakumar Patil; cob...@li...; sh...@ec... Subject: RE: [Cobertura-devel] e-mail Size Updated -> Need Help:instrument/deploying cobertura 1.9.4.1 with tomcat container. I am not sure why the cobertura.ser file is in the windows system32 folder. Did you put it there? I put the file under tomcat6/bin directory and tested it. Now it displays following message Flushing results... Flushing results done Cobertura: Coverage data file C:\Windows\system32\cobertura.ser either does not exist or is not readable. Creating a new data file. Cobertura: Saved information on 0 classes. Also creates a cobertura.ser file under C:\Windows\system32\ Is that where your ant script is? No , the Ant script is on another system where I am instrumenting the classes. I copy the files to a deployment system to test the coverage. Is that the working directory of your application? I doubt that is the working directory of tomcat. I would be tempted to delete it. It does not seem to belong there. After you do the cobertura-instrument, you need to copy the cobertura.ser file to the working directory of your tomcat application (or use the datafile parameter to specify where the cobertura.ser file should be). That has been the tomcat/bin directory in my experience. The cobertura.ser file should not change length from what it was after cobertura-instrument, but the contents should change. When it is in system32 it changes the size from 0 -> 48,757 KB But this behaviour might change if it were to tomcat/bin dir. By the way, you have a lot of classes that are being instrumented that look like third party classes. I would be more specific with the classes you are instrumenting: <include name="my/package/**/*.class" /> we have around 5800 classes , so you recommend us to go with set of packages..? John From: Shivakumar Patil [mailto:sh...@ec...] Sent: Tuesday, June 28, 2011 11:47 AM To: cob...@li...; sh...@ec... Subject: [Cobertura-devel] e-mail Size Updated -> Need Help: instrument/deploying cobertura 1.9.4.1 with tomcat container. Hi, I am using cobertura 1.9.4.1 and happen to run into issues. Instrumentating only the class files, attached is the instrumentation.txt file. Interested in instrumentating the logging capabilities also. Following is the steps followed while instrumentating/deploying this. If you have any questions/solutions...let me know. Thanks. deployment process ================== Windows system32 folder cobertura.ser -> 48,757 KB Tomcat start ============= cobertura.ser.lock -> 0 cobertura.ser -> 0 After a while ....... ====================== cobertura.ser -> 48,757 KB Login into the application and start testing....after a while, when tomcat is stopped the the size of the Windows system32 folder cobertura.ser -> 48,757 KB file remains the same. This is supposed increase in size after testing? tomcat logs ============ Flushing results... Flushing results done Cobertura: Loaded information on 6559 classes. Cobertura: Saved information on 6559 classes. build.xml updates ================= <target name="coverage" depends="instrument,coverage-report,summary-coverage-report,alternate-covera ge-report" description="Compile, instrument ourself, run the tests and generate JUnit and coverage reports." /> commented the below tags, so that it can instrument the logging. But it's not instrumenting one of the java file with header -> package logging; <target name="instrument" depends="init"> <!-- Remove the coverage data file and any old instrumentation. --> <delete file="cobertura.ser"/> <delete dir="${instrumented.dir}" /> <!-- Instrument the application classes, writing the instrumented classes into ${build.instrumented.dir}. --> <cobertura-instrument todir="${instrumented.dir}"> <!-- The following line causes instrument to ignore any source line containing a reference to log4j, for the purposes of coverage reporting. <ignore regex="org.apache.log4j.*" /> --> <fileset dir="${classes.dir}"> <!-- Instrument all the application classes, but don't instrument the test classes. --> <include name="**/*.class" /> <exclude name="**/*Test.class" /> </fileset> </cobertura-instrument> </target> CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains confidential information belonging to the sender that is legally privileged and proprietary and may be subject to protection under the law, including the Health Insurance Portability and Accountability Act (HIPAA). If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them. Thank you. CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains confidential information belonging to the sender that is legally privileged and proprietary and may be subject to protection under the law, including the Health Insurance Portability and Accountability Act (HIPAA). If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them. Thank you. |
From: Steven C. <ste...@re...> - 2011-06-28 16:32:49
|
I ran into this issue to where the cobertura.ser file was being placed in the system32 folder and that is because Tomcat applications by default start in your system32 folder. You need to pass tomcat a jvm arg with |"-Dnet.sourceforge.cobertura.datafile=C:\MyProject\build\cobertura.ser|" without quotes. That way the default start location doesn't change, and you are specifying a location for the cobertura data. On 6/28/2011 10:59 AM, John W. Lewis wrote: > > I am not sure why the cobertura.ser file is in the windows system32 > folder. Did you put it there? Is that where your ant script is? > Is that the working directory of your application? I doubt that is > the working directory of tomcat. I would be tempted to delete it. > It does not seem to belong there. > > After you do the cobertura-instrument, you need to copy the > cobertura.ser file to the working directory of your tomcat application > (or use the datafile parameter to specify where the cobertura.ser file > should be). That has been the tomcat/bin directory in my experience. > > The cobertura.ser file should not change length from what it was after > cobertura-instrument, but the contents should change. > > By the way, you have a lot of classes that are being instrumented that > look like third party classes. I would be more specific with the > classes you are instrumenting: > > <include name="my/package/**/*.class" /> > > John > > *From:*Shivakumar Patil [mailto:sh...@ec...] > *Sent:* Tuesday, June 28, 2011 11:47 AM > *To:* cob...@li...; sh...@ec... > *Subject:* [Cobertura-devel] e-mail Size Updated -> Need Help: > instrument/deploying cobertura 1.9.4.1 with tomcat container. > > Hi, > > > I am using cobertura 1.9.4.1 and happen to run into issues. > Instrumentating only the class files, attached is the > instrumentation.txt file. > Interested in instrumentating the logging capabilities also. Following > is the steps followed while instrumentating/deploying this. If you > have any questions/solutions...let me know. Thanks. > > > deployment process > ================== > > Windows system32 folder cobertura.ser -> 48,757 KB > > Tomcat start > ============= > > cobertura.ser.lock -> 0 > > cobertura.ser -> 0 > > After a while ....... > ====================== > > cobertura.ser -> 48,757 KB > > Login into the application and start testing....after a while, when > tomcat is stopped the > the size of the Windows system32 folder cobertura.ser -> 48,757 KB > file remains the same. > > This is supposed increase in size after testing? > > > > tomcat logs > ============ > > Flushing results... > Flushing results done > Cobertura: Loaded information on 6559 classes. > Cobertura: Saved information on 6559 classes. > > build.xml updates > ================= > > <target name="coverage" > depends="instrument,coverage-report,summary-coverage-report,alternate-coverage-report" > description="Compile, instrument ourself, run the tests and generate > JUnit and coverage reports." /> > > commented the below tags, so that it can instrument the logging. But > it's not instrumenting one of the java file with header -> package > logging; > > > <target name="instrument" depends="init"> > <!-- > Remove the coverage data file and any old instrumentation. > --> > <delete file="cobertura.ser"/> > <delete dir="${instrumented.dir}" /> > > <!-- > Instrument the application classes, writing the > instrumented classes into ${build.instrumented.dir}. > --> > <cobertura-instrument todir="${instrumented.dir}"> > <!-- > The following line causes instrument to ignore any > source line containing a reference to log4j, for the > purposes of coverage reporting. > > > <ignore regex="org.apache.log4j.*" /> > > --> > > > <fileset dir="${classes.dir}"> > <!-- > Instrument all the application classes, but > don't instrument the test classes. > --> > <include name="**/*.class" /> > <exclude name="**/*Test.class" /> > </fileset> > </cobertura-instrument> > </target> > > CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains > confidential information belonging to the sender that is legally > privileged and proprietary and may be subject to protection under the > law, including the Health Insurance Portability and Accountability Act > (HIPAA). If you are not the intended recipient of this e-mail, you are > prohibited from sharing, copying, or otherwise using or disclosing its > contents. If you have received this e-mail in error, please notify the > sender immediately by reply e-mail and permanently delete this e-mail > and any attachments without reading, forwarding or saving them. Thank > you. > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > > > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel Email Disclaimer: http://www.redprairie.com/emaildisclaimer/ |
From: John W. L. <Joh...@sa...> - 2011-06-28 15:59:49
|
I am not sure why the cobertura.ser file is in the windows system32 folder. Did you put it there? Is that where your ant script is? Is that the working directory of your application? I doubt that is the working directory of tomcat. I would be tempted to delete it. It does not seem to belong there. After you do the cobertura-instrument, you need to copy the cobertura.ser file to the working directory of your tomcat application (or use the datafile parameter to specify where the cobertura.ser file should be). That has been the tomcat/bin directory in my experience. The cobertura.ser file should not change length from what it was after cobertura-instrument, but the contents should change. By the way, you have a lot of classes that are being instrumented that look like third party classes. I would be more specific with the classes you are instrumenting: <include name="my/package/**/*.class" /> John From: Shivakumar Patil [mailto:sh...@ec...] Sent: Tuesday, June 28, 2011 11:47 AM To: cob...@li...; sh...@ec... Subject: [Cobertura-devel] e-mail Size Updated -> Need Help: instrument/deploying cobertura 1.9.4.1 with tomcat container. Hi, I am using cobertura 1.9.4.1 and happen to run into issues. Instrumentating only the class files, attached is the instrumentation.txt file. Interested in instrumentating the logging capabilities also. Following is the steps followed while instrumentating/deploying this. If you have any questions/solutions...let me know. Thanks. deployment process ================== Windows system32 folder cobertura.ser -> 48,757 KB Tomcat start ============= cobertura.ser.lock -> 0 cobertura.ser -> 0 After a while ....... ====================== cobertura.ser -> 48,757 KB Login into the application and start testing....after a while, when tomcat is stopped the the size of the Windows system32 folder cobertura.ser -> 48,757 KB file remains the same. This is supposed increase in size after testing? tomcat logs ============ Flushing results... Flushing results done Cobertura: Loaded information on 6559 classes. Cobertura: Saved information on 6559 classes. build.xml updates ================= <target name="coverage" depends="instrument,coverage-report,summary-coverage-report,alternate-coverage-report" description="Compile, instrument ourself, run the tests and generate JUnit and coverage reports." /> commented the below tags, so that it can instrument the logging. But it's not instrumenting one of the java file with header -> package logging; <target name="instrument" depends="init"> <!-- Remove the coverage data file and any old instrumentation. --> <delete file="cobertura.ser"/> <delete dir="${instrumented.dir}" /> <!-- Instrument the application classes, writing the instrumented classes into ${build.instrumented.dir}. --> <cobertura-instrument todir="${instrumented.dir}"> <!-- The following line causes instrument to ignore any source line containing a reference to log4j, for the purposes of coverage reporting. <ignore regex="org.apache.log4j.*" /> --> <fileset dir="${classes.dir}"> <!-- Instrument all the application classes, but don't instrument the test classes. --> <include name="**/*.class" /> <exclude name="**/*Test.class" /> </fileset> </cobertura-instrument> </target> CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains confidential information belonging to the sender that is legally privileged and proprietary and may be subject to protection under the law, including the Health Insurance Portability and Accountability Act (HIPAA). If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them. Thank you. |
From: Shivakumar P. <sh...@ec...> - 2011-06-28 15:47:15
|
Hi, I am using cobertura 1.9.4.1 and happen to run into issues. Instrumentating only the class files, attached is the instrumentation.txt file. Interested in instrumentating the logging capabilities also. Following is the steps followed while instrumentating/deploying this. If you have any questions/solutions...let me know. Thanks. deployment process ================== Windows system32 folder cobertura.ser -> 48,757 KB Tomcat start ============= cobertura.ser.lock -> 0 cobertura.ser -> 0 After a while ...... ====================== cobertura.ser -> 48,757 KB Login into the application and start testing....after a while, when tomcat is stopped the the size of the Windows system32 folder cobertura.ser -> 48,757 KB file remains the same. This is supposed increase in size after testing? tomcat logs ============ Flushing results... Flushing results done Cobertura: Loaded information on 6559 classes. Cobertura: Saved information on 6559 classes. build.xml updates ================= <target name="coverage" depends="instrument,coverage-report,summary-coverage-report,alternate-covera ge-report" description="Compile, instrument ourself, run the tests and generate JUnit and coverage reports." /> commented the below tags, so that it can instrument the logging. But it's not instrumenting one of the java file with header -> package logging; <target name="instrument" depends="init"> <!-- Remove the coverage data file and any old instrumentation. --> <delete file="cobertura.ser"/> <delete dir="${instrumented.dir}" /> <!-- Instrument the application classes, writing the instrumented classes into ${build.instrumented.dir}. --> <cobertura-instrument todir="${instrumented.dir}"> <!-- The following line causes instrument to ignore any source line containing a reference to log4j, for the purposes of coverage reporting. <ignore regex="org.apache.log4j.*" /> --> <fileset dir="${classes.dir}"> <!-- Instrument all the application classes, but don't instrument the test classes. --> <include name="**/*.class" /> <exclude name="**/*Test.class" /> </fileset> </cobertura-instrument> </target> CONFIDENTIALITY NOTICE TO RECIPIENT: This transmission contains confidential information belonging to the sender that is legally privileged and proprietary and may be subject to protection under the law, including the Health Insurance Portability and Accountability Act (HIPAA). If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them. Thank you. |
From: John W. L. <Joh...@sa...> - 2011-06-23 16:23:30
|
That is a strange error. Your script looks pretty good, but I would try removing these lines: <path id="cobertura.classpath"> <fileset dir="${basedir}\jenkins\cobertura" includes="**/*.jar"/> <pathelement location="target/instrumented-classes"/> <pathelement location="${dir.src}"/> </path> Also, make sure the instrumented classes are first: <path id="cover-test.classpath"> <pathelement location="target/instrumented-classes"/> <pathelement location="${dir.build}"/> <fileset dir="${dir.dist}" includes="**/*.jar"/> </path> After you do these changes, try commenting out the call to <cobertura-instrument> and make sure the tests pass without the instrumentation. If they do, then let me know. John From: Ken Louie [mailto:klo...@gm...] Sent: Wednesday, June 22, 2011 7:18 PM To: cob...@li... Subject: [Cobertura-devel] Need Help With Ant Tasks Hello, I'm having trouble using the cobertura ant tasks. If someone could help me I would greatly appreciate it. When I try to run junit tests using the instrumented classes I get the following errors for each class I try to run the junit test on: Testsuite: test.classes.com.lmco.isgs.security.wamix.agentproxy.proxy.IAgentProxyFactoryTest Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec & nbsp; Caused an ERROR test/classes/com/lmco/isgs/security/wamix/agentproxy/proxy/IAgentProxyFactoryTest (wrong name: com/lmco/isgs/security/wamix/agentproxy/proxy/IAgentProxyFactoryTest) java.lang.NoClassDefFoundError: test/classes/com/lmco/isgs/security/wamix/agentproxy/proxy/IAgentProxyFactoryTest (wrong name: com/lmco/isgs/security/wamix/agentproxy/proxy/IAgentProxyFactoryTest) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58)   ; at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) Here are how my ant tasks look like: <?xml version="1.0" ?> <project name="cobert ura" default="cobertura" basedir=".."> <property name="dir.src" value="src"/> <property name="dir.build" value="build"/> <property name="dir.dist" value="dist"/> <property name="dir.lib" value="lib"/> <property name="dir.report" value="report"/> &n bsp; <path id="cobertura.classpath"> <fileset dir="${basedir}\jenkins\cobertura" includes="**/*.jar"/> <pathelement location="target/instrumented-classes"/> <pathelement location="${dir.src}"/> </path> <taskdef classpath="${basedir}\jenkins\cobertura\cobertura.jar" resource="tasks.properties" classpathref="cobertura.cla sspath"/> <!-- adds the logging code to the already compiled class files --> <target name="instrument"> <delete quiet="false" failonerror="false"> <fileset dir="target/instrumented-classes" includes="**/*.class"/> </delete> <cobertura-instrument todir="target/instrumented-classes"> <fileset dir="${dir.build}"> <include name="**/*.class"/> <exclude name="**/*Test.class"/> </fileset> </cobertura-instrument> </target> <!-- setup class path to include instrumented classes before n on-instrumented ones --> <path id="cover-test.classpath"> <fileset dir="${dir.dist}" includes="**/*.jar"/> <pathelement location="target/instrumented-classes"/> <pathelement location="${dir.build}"/> </path> <!-- run all my junit tests using the instrumented classes --> < ;target name="cover-test" depends="instrument"> <mkdir dir="${dir.report}/cobertura" /> <junit printsummary="yes" haltonerror="no" haltonfailure="no" fork="yes"> <formatter type="plain" usefile="true"/> <batchtest> <fileset dir="${dir.build}" includes="**/*Test.class" /> </bat chtest> <classpath refid="cover-test.classpath"/> </junit> </target> <!-- create the html reports --> <target name="coverage-report" depends="cover-test"> <cobertura-report srcdir="${dir.src}" destdir="${dir.report}" datafile="cobertura.ser" format="html"/> </target> </project> Again, if someone could help me out in anyway, I would greatly appreciate it. Thanks, Ken Louie |
From: Ken L. <klo...@gm...> - 2011-06-22 23:18:46
|
Hello,**** ** ** I’m having trouble using the cobertura ant tasks. If someone could help me I would greatly appreciate it.**** ** ** *When I try to run junit tests using the instrumented classes I get the following errors for each class I try to run the junit test on:* * * Testsuite: test.classes.com.lmco.isgs.security.wamix.agentproxy.proxy.IAgentProxyFactoryTest **** Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec**** ** ** & nbsp; Caused an ERROR**** test/classes/com/lmco/isgs/security/wamix/agentproxy/proxy/IAgentProxyFactoryTest (wrong name: com/lmco/isgs/security/wamix/agentproxy/proxy/IAgentProxyFactoryTest)**** java.lang.NoClassDefFoundError: test/classes/com/lmco/isgs/security/wamix/agentproxy/proxy/IAgentProxyFactoryTest (wrong name: com/lmco/isgs/security/wamix/agentproxy/proxy/IAgentProxyFactoryTest)**** at java.lang.ClassLoader.defineClass1(Native Method)**** at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)**** at java.lang.ClassLoader.defineClass(ClassLoader.java:615)** ** at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)**** at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)**** at java.net.URLClassLoader.access$000(URLClassLoader.java:58)****   ; at java.net.URLClassLoader$1.run(URLClassLoader.java:197)**** at java.security.AccessController.doPrivileged(Native Method)**** at java.net.URLClassLoader.findClass(URLClassLoader.java:190)**** at java.lang.ClassLoader.loadClass(ClassLoader.java:306)**** at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)**** at java.lang.ClassLoader.loadClass(ClassLoader.java:247)**** at java.lang.Class.forName0(Native Method)**** at java.lang.Class.forName(Class.java:169)**** ** ** ** ** *Here are how my ant tasks look like:* ** ** <?xml version="1.0" ?>**** <project name="cobert ura" default="cobertura" basedir="..">**** ** ** <property name="dir.src" value="src"/>**** <property name="dir.build" value="build"/>**** <property name="dir.dist" value="dist"/>**** <property name="dir.lib" value="lib"/>**** <property name="dir.report" value="report"/>**** ** ** &n bsp; <path id="cobertura.classpath">**** <fileset dir="${basedir}\jenkins\cobertura" includes="**/*.jar"/>**** <pathelement location="target/instrumented-classes"/>**** <pathelement location="${dir.src}"/>**** </path>**** ** ** <taskdef classpath="${basedir}\jenkins\cobertura\cobertura.jar" resource="tasks.properties"**** classpathref="cobertura.cla sspath"/>**** ** ** <!-- adds the logging code to the already compiled class files -->**** <target name="instrument">**** <delete quiet="false" failonerror="false">**** <fileset dir="target/instrumented-classes" includes="**/*.class"/>**** </delete>**** <cobertura-instrument todir="target/instrumented-classes">**** <fileset dir="${dir.build}">**** <include name="**/*.class"/>**** <exclude name="**/*Test.class"/>**** </fileset>**** </cobertura-instrument>**** </target>**** **** <!-- setup class path to include instrumented classes before n on-instrumented ones -->**** <path id="cover-test.classpath">**** <fileset dir="${dir.dist}" includes="**/*.jar"/>**** <pathelement location="target/instrumented-classes"/>**** <pathelement location="${dir.build}"/>**** </path>**** ** ** <!-- run all my junit tests using the instrumented classes -->**** < ;target name="cover-test" depends="instrument">**** <mkdir dir="${dir.report}/cobertura" />**** <junit printsummary="yes" haltonerror="no" haltonfailure="no" fork="yes">**** <formatter type="plain" usefile="true"/>**** <batchtest>**** <fileset dir="${dir.build}" includes="**/*Test.class" />**** </bat chtest>**** <classpath refid="cover-test.classpath"/>**** </junit>**** </target>**** ** ** <!-- create the html reports -->**** <target name="coverage-report" depends="cover-test">**** <cobertura-report srcdir="${dir.src}" destdir="${dir.report}" datafile="cobertura.ser" format="html"/>**** </target>**** **** </project>**** ** ** Again, if someone could help me out in anyway, I would greatly appreciate it.**** ** ** Thanks,**** Ken Louie |
From: Code C. <cc...@ya...> - 2011-06-19 17:16:09
|
Thanks Steven From: Steven Christou <ste...@re...> To: cob...@li... Sent: Friday, June 17, 2011 4:39 PM Subject: Re: [Cobertura-devel] Class and method coverage I don't believe so, but if you want, you can export the results in xml format and create a job in Hudson to view the coverage of classes, conditionals, files,lines, methods, and packages. On 6/17/2011 6:22 PM, Code Code wrote: Hi, >Is there a way in cobertura to get class and method coverage. >By default it gives line and block coverage. > >Thanks, >Sarathy > ------------------------------------------------------------------------------EditLive Enterprise is the world's most technically advanced contentauthoring tool. Experience the power of Track Changes, Inline ImageEditing and ensure content is compliant with Accessibility Checking.http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________Cobertura-devel mailing list Cob...@li... https://lists.sourceforge.net/lists/listinfo/cobertura-devel Email Disclaimer:http://www.redprairie.com/emaildisclaimer/ ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Cobertura-devel mailing list Cob...@li... https://lists.sourceforge.net/lists/listinfo/cobertura-devel |
From: Steven C. <ste...@re...> - 2011-06-17 23:39:15
|
I don't believe so, but if you want, you can export the results in xml format and create a job in Hudson to view the coverage of classes, conditionals, files,lines, methods, and packages. On 6/17/2011 6:22 PM, Code Code wrote: > Hi, > Is there a way in cobertura to get class and method coverage. > By default it gives line and block coverage. > Thanks, > Sarathy > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > > > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel Email Disclaimer: http://www.redprairie.com/emaildisclaimer/ |
From: Code C. <cc...@ya...> - 2011-06-17 23:22:38
|
Hi, Is there a way in cobertura to get class and method coverage. By default it gives line and block coverage. Thanks, Sarathy |
From: fabien b. <fab...@al...> - 2011-06-15 11:33:16
|
Any news about the release date ? On 05/13/2011 08:36 PM, John W. Lewis wrote: > Unfortunately, in February, I got pulled onto another project, and I had > to drop Cobertura work for a while. > > I now have the OK to proceed with the release. I am going to start with > deploying Piotr’s latest changes onto our test servers. > > John > > *From:*Piotr Tabor [mailto:pio...@gm...] > *Sent:* Wednesday, May 11, 2011 4:24 PM > *To:* cob...@li... > *Subject:* [Cobertura-devel] Fwd: Cobertura 2.0/ignore trivial release date? > > Don't know why it was rejected. > > I'm not aware any release-blocking issues. > John ? > > Piotr > > ---------- Forwarded message ---------- > From: *Joshua Watkins* <jos...@ga... > <mailto:jos...@ga...>> > Date: Tue, May 10, 2011 at 2:51 PM > Subject: Message Rejected - FW: [Cobertura-devel] Cobertura 2.0/ignore > trivial release date? > To: "cob...@li... > <mailto:cob...@li...>" > <cob...@li... > <mailto:cob...@li...>> > > > I think my message has been rejected in error. Below is the body of my > message: > > > John, > > Any more news on this? > > > -----Original Message----- > > I hope the next release will happen no later than a month from now. > > Piotr's branch will very likely be merged into the trunk, so I would use > his branch for any internal version you may create. His branch has been > deployed on several of the test servers I maintain, and it is holding up > very well. It is also noticeably faster. > > If there is enough interest, I can do a quick release of the trunk if a > month is too long to wait. I'm not sure that would help you though since > you will want to use the trunk after the merge. > > John > > > -----Original Message----- > From: Ximon Eighteen [mailto:ximon.eighteen@ <mailto:ximon.eighteen@>...] > Sent: Saturday, January 29, 2011 6:14 AM > To: cobertura-devel@... > Subject: [Cobertura-devel] Cobertura 2.0/ignore trivial release date? > > Good morning all, > > This is my first post to the list and so I have had a brief look through > the list archives (as far back as June last year) for mail subjects which > might relate to a new release of Cobertura but I have not found anything. > My apologies if my question is already answered or this is not the correct > place to ask it. > > I can see that the project is active, at least there are recent commits to > the source repository, but I cannot find any information on when a new > release of Cobertura might be expected. Specifically I want to use the > accepted ignore trivla patch > (http://sourceforge.net/tracker/?func=detail&aid=3010530&group_id=130558&at > id=720017 > <http://sourceforge.net/tracker/?func=detail&aid=3010530&group_id=130558&at%0Aid=720017>). > > I have made my own local version of Cobertura and am considering deploying > it to our company internal Nexus instance but with my companies groupId > instead of net.sourceforge.cobertura (to avoid confusion as mine would not > be an official release). I would also deploy a slightly modified version > of the maven cobertura plugin which depends on my modified cobertura and > passes through the ignore trivial command line flag, again with my own > groupId. > > I thought I should ask here before proceeding in case a release including > this feature is imminent or if you advise that I proceed differently. > > Any feedback would be greatly appreciated. > > Ximon > > > > > > > On 10/05/2011 13:46, "cob...@li... > <mailto:cob...@li...>" > <cob...@li... > <mailto:cob...@li...>> wrote: > > >cob...@li... > <mailto:cob...@li...> > > > > > -- > Pozdrawiam, > Piotr Tabor > |
From: John W. L. <Joh...@sa...> - 2011-05-25 18:36:17
|
There is a Java ME fork of cobertura here: http://cobertura4j2me.org/ Would that work better for you? I don't know much about Android/DVM. If it does not run class files directly, how does it run java? Non-ME cobertura works fine on linux. The procedure depends on whether you intend to use ant, maven, or the command line. John From: Binay Jena [mailto:bin...@sa...] Sent: Wednesday, May 25, 2011 4:13 AM To: cob...@li... Subject: [Cobertura-devel] Cobertua for Android Platform Dear Cobertura Development Team, First of all thank you for developing a such a great tool. I have few doubts using cobertura for Android Platforms. Whether it works for Android,because DVM doesn't run the .class files directly ? Whether we can use Cobertura on Linux Environment If Yes what is the procedure ? Thank you /Binay |
From: Binay J. <bin...@sa...> - 2011-05-25 08:12:55
|
Dear Cobertura Development Team, First of all thank you for developing a such a great tool. I have few doubts using cobertura for Android Platforms. Whether it works for Android,because DVM doesn't run the .class files directly ? Whether we can use Cobertura on Linux Environment If Yes what is the procedure ? Thank you /Binay |
From: Mike P. <mpo...@do...> - 2011-05-24 05:42:41
|
I have a build project built by ant that I can run on both windows (dev work) and linux (daily builds). When I look at the report built on linux all coverage is 100%. I can copy the ser file down and rerun the report and then I get realistic coverage numbers. So it seems to be that this is not an issue of using the wrong ser file. When I due the build completely in windows I get realistic coverage numbers as well. Has anyone encountered this before? Mike Power |
From: Steven C. <ste...@re...> - 2011-05-23 20:27:49
|
That's interesting.... would u happen to have any source code we could take a look at? what version of cobertura are you on? I'm wondering if cobertura is loading other .jar files and instrumenting those as well from command line. Did you clean the instrumented code once you ran it again? It might be instrumenting already instrumented code. On 5/23/2011 2:53 PM, Gibbo wrote: > Thanks for responsing.. > > In answer to your questions: > 1) I'm not using the command line version. What I meant that it works > when I run ant from the command line and it worked fine, but doesn't > work from within netbeans or quickbuild. > 2) I'm instrumenting the classes. > 3) There are not extra classes on the report, every has 0% coverage.. > > > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > > > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel Email Disclaimer: http://www.redprairie.com/emaildisclaimer/ |
From: Gibbo <gib...@go...> - 2011-05-23 19:53:14
|
Thanks for responsing.. In answer to your questions: 1) I'm not using the command line version. What I meant that it works when I run ant from the command line and it worked fine, but doesn't work from within netbeans or quickbuild. 2) I'm instrumenting the classes. 3) There are not extra classes on the report, every has 0% coverage.. |
From: Steven C. <ste...@re...> - 2011-05-23 15:36:43
|
Several question: 1. What version of cobertura from command line are you running? 2. Are you instrumenting a .jar or .class files from command line? 3. What does the cobertura report look like? Does it contain excess classes? What other classes do you see that are not part of your project? On 5/23/2011 9:59 AM, Gibbo wrote: > Hi, > Was wondering if anybody could help.. I've just started using > Cobertura and I think it is great :) > > But I'm having a few teething problems and was wondering if somebody > could help. I'm using netbeans and with netbeans projects it works > fine, I followed the tutorial on the Netbeans page. > But I also have freeform projects that work fine from the command > line, but not from within netbeans or when built with QuickBuild > (http://www.pmease.com/) > > From the Netbeans output window I can see this > > Flushing results... > Flushing results done > Cobertura: Loaded information on 14 classes. > Cobertura: Saved information on 14 classes. > Testsuite: com.test.test1 > Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 0.655 sec > > > From the Command line I can see this > > Flushing results... > Flushing results done > Cobertura: Loaded information on 420 classes. > Cobertura: Saved information on 420 classes. > Testsuite: com.test.test1 > Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 0.421 sec > > > So the difference is the loaded information on the classes.. Any ideas? > > > Thanks in advance > > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > > > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel Email Disclaimer: http://www.redprairie.com/emaildisclaimer/ |
From: Gibbo <gib...@go...> - 2011-05-23 14:59:41
|
Hi, Was wondering if anybody could help.. I've just started using Cobertura and I think it is great :) But I'm having a few teething problems and was wondering if somebody could help. I'm using netbeans and with netbeans projects it works fine, I followed the tutorial on the Netbeans page. But I also have freeform projects that work fine from the command line, but not from within netbeans or when built with QuickBuild ( http://www.pmease.com/) >From the Netbeans output window I can see this > Flushing results... > Flushing results done > Cobertura: Loaded information on 14 classes. > Cobertura: Saved information on 14 classes. > Testsuite: com.test.test1 > Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 0.655 sec > > >From the Command line I can see this Flushing results... > Flushing results done > Cobertura: Loaded information on 420 classes. > Cobertura: Saved information on 420 classes. > Testsuite: com.test.test1 > Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 0.421 sec > So the difference is the loaded information on the classes.. Any ideas? Thanks in advance |
From: Soula, W. <ws...@po...> - 2011-05-17 20:20:42
|
Thanks for the quick reply. I think I figured out the issue, I have two targets a cobertura-setup and test-cobertura and test-cobertura is calling cobertura-setup with an antcall and I'm pretty certain once that ant call is done ant forgets about everything done in that call, hence my taskdef getting lost. But, I would probably have emailed in with the next question you answered for me. Thanks a lot, Will ________________________________ I would take cobertura.jar out of the ext directory. The bits you have shown look right except for the cobertura-instrument call. If you want to use emma.classpath, you will need to use this: <includeClasses regex="my.package.*" /> <instrumentationClasspath> <path refid="emma.classpath" /> </instrumentationClasspath> Please verify the cobertura.jar and the lib directory are under the cobertura-1.9.4.1 directory that is under your basedir. I can’t see how you are defining your basedir. Try using a full path: <property name="cobertura.dir" value="/full/path/to/cobertura-1.9.4.1"/> John From: Soula, William [mailto:ws...@po...] Sent: Tuesday, May 17, 2011 3:19 PM To: 'cob...@li...' Subject: [Cobertura-devel] Create cobertura tasks in ant I have started using cobertura and everything was going fine till I got to the section about creating the ant tasks. Below is my code to try and create the task: <property name="cobertura.out.instr" value="${basedir}/outinstr"/> <mkdir dir="${cobertura.out.instr}"/> <property name="coverage.dir" value="${basedir}/coverage"/> <property name="cobertura.dir" value="${basedir}/cobertura-1.9.4.1"/> <echo message="${cobertura.dir}/cobertura.jar"/> <path id="cobertura.lib"> <fileset dir="${cobertura.dir}"> <include name="cobertura.jar"/> <include name="lib/**/*.jar"/> </fileset> </path> <taskdef resource="tasks.properties" classpathref="cobertura.lib"/> Then I create/delete some directories, setup the path to my classes and call cobertura-instrument like below: <cobertura-instrument todir="${cobertura.out.instr}"> <path refid="emma.classpath"/> </cobertura-instrument> And then ant fails with: build.xml:305: 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. I have used emma in the past and got that setup recently and I had to add the emma.jar to my java install in java-1.6.0_20/jre/lib/ext so I thought cobertura might be the same so I put the cobertura.jar in that folder. This got me further but now the error is: build.xml:290: taskdef A class needed by class net.sourceforge.cobertura.ant.InstrumentTask cannot be found: org/apache/tools/ant/taskdefs/MatchingTask I am currently using ant 1.7.1, if I use ant 1.8.2 then it tells you what jars were in the class load path and it just listed the cobertura jars, but the class it is complaining about is in ant.jar. So I tried adding all of ant's lib folder to cobertura and that didn't work. I tried putting ant.jar into java/jre/lib/ext but that caused even more problems. Every example I have been able to find online says to put cobertura.jar and its corresponding jars in the lib folder into a pathref and then hand that off to cobertura when creating the ant tasks and everything works, but that is not what I am experiencing. Does anyone have any idea what I am doing wrong? Thanks, Will |
From: John W. L. <Joh...@sa...> - 2011-05-17 19:58:10
|
I would take cobertura.jar out of the ext directory. The bits you have shown look right except for the cobertura-instrument call. If you want to use emma.classpath, you will need to use this: <includeClasses regex="my.package.*" /> <instrumentationClasspath> <path refid="emma.classpath" /> </instrumentationClasspath> Please verify the cobertura.jar and the lib directory are under the cobertura-1.9.4.1 directory that is under your basedir. I can't see how you are defining your basedir. Try using a full path: <property name="cobertura.dir" value="/full/path/to/cobertura-1.9.4.1"/> John From: Soula, William [mailto:ws...@po...] Sent: Tuesday, May 17, 2011 3:19 PM To: 'cob...@li...' Subject: [Cobertura-devel] Create cobertura tasks in ant I have started using cobertura and everything was going fine till I got to the section about creating the ant tasks. Below is my code to try and create the task: <property name="cobertura.out.instr" value="${basedir}/outinstr"/> <mkdir dir="${cobertura.out.instr}"/> <property name="coverage.dir" value="${basedir}/coverage"/> <property name="cobertura.dir" value="${basedir}/cobertura-1.9.4.1"/> <echo message="${cobertura.dir}/cobertura.jar"/> <path id="cobertura.lib"> <fileset dir="${cobertura.dir}"> <include name="cobertura.jar"/> <include name="lib/**/*.jar"/> </fileset> </path> <taskdef resource="tasks.properties" classpathref="cobertura.lib"/> Then I create/delete some directories, setup the path to my classes and call cobertura-instrument like below: <cobertura-instrument todir="${cobertura.out.instr}"> <path refid="emma.classpath"/> </cobertura-instrument> And then ant fails with: build.xml:305: 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. I have used emma in the past and got that setup recently and I had to add the emma.jar to my java install in java-1.6.0_20/jre/lib/ext so I thought cobertura might be the same so I put the cobertura.jar in that folder. This got me further but now the error is: build.xml:290: taskdef A class needed by class net.sourceforge.cobertura.ant.InstrumentTask cannot be found: org/apache/tools/ant/taskdefs/MatchingTask I am currently using ant 1.7.1, if I use ant 1.8.2 then it tells you what jars were in the class load path and it just listed the cobertura jars, but the class it is complaining about is in ant.jar. So I tried adding all of ant's lib folder to cobertura and that didn't work. I tried putting ant.jar into java/jre/lib/ext but that caused even more problems. Every example I have been able to find online says to put cobertura.jar and its corresponding jars in the lib folder into a pathref and then hand that off to cobertura when creating the ant tasks and everything works, but that is not what I am experiencing. Does anyone have any idea what I am doing wrong? Thanks, Will |
From: Soula, W. <ws...@po...> - 2011-05-17 19:45:43
|
I have started using cobertura and everything was going fine till I got to the section about creating the ant tasks. Below is my code to try and create the task: <property name="cobertura.out.instr" value="${basedir}/outinstr"/> <mkdir dir="${cobertura.out.instr}"/> <property name="coverage.dir" value="${basedir}/coverage"/> <property name="cobertura.dir" value="${basedir}/cobertura-1.9.4.1"/> <echo message="${cobertura.dir}/cobertura.jar"/> <path id="cobertura.lib"> <fileset dir="${cobertura.dir}"> <include name="cobertura.jar"/> <include name="lib/**/*.jar"/> </fileset> </path> <taskdef resource="tasks.properties" classpathref="cobertura.lib"/> Then I create/delete some directories, setup the path to my classes and call cobertura-instrument like below: <cobertura-instrument todir="${cobertura.out.instr}"> <path refid="emma.classpath"/> </cobertura-instrument> And then ant fails with: build.xml:305: 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. I have used emma in the past and got that setup recently and I had to add the emma.jar to my java install in java-1.6.0_20/jre/lib/ext so I thought cobertura might be the same so I put the cobertura.jar in that folder. This got me further but now the error is: build.xml:290: taskdef A class needed by class net.sourceforge.cobertura.ant.InstrumentTask cannot be found: org/apache/tools/ant/taskdefs/MatchingTask I am currently using ant 1.7.1, if I use ant 1.8.2 then it tells you what jars were in the class load path and it just listed the cobertura jars, but the class it is complaining about is in ant.jar. So I tried adding all of ant's lib folder to cobertura and that didn't work. I tried putting ant.jar into java/jre/lib/ext but that caused even more problems. Every example I have been able to find online says to put cobertura.jar and its corresponding jars in the lib folder into a pathref and then hand that off to cobertura when creating the ant tasks and everything works, but that is not what I am experiencing. Does anyone have any idea what I am doing wrong? Thanks, Will |