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: Bill H. <han...@mc...> - 2010-06-25 15:43:36
|
Jake, I’ve tried it both ways. Classpath for test exec: … /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/test: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test/instrumented: If the if the instrumented version is first or second, cobertura runs and all test coverage shows 0%. Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 From: jak...@gm... [mailto:jak...@gm...] On Behalf Of Jake Cobb Sent: Friday, June 25, 2010 10:04 AM To: Bill Hansley Cc: cob...@li... Subject: Re: [Cobertura-devel] Instrument task misses classes, tests die as a result When you included both directories on the classpath, did you have the non-instrumented folder come first? If so, try putting the instrumented dir first so any classes present in both will load the instrumented version. -Jake 2010/6/25 Bill Hansley <han...@mc...<mailto:han...@mc...>> Hi, I’m a newbie to Cobertura, and am having trouble getting it to work completely from start to finish. Starting from the end, here’s the error I’m getting: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) The class it can’t find (PersistenceBroker$PerformWithHibernateSession) is in my classes directory, but when instrument runs via ant, using this task: <target name="cobertura-tag-classes"> <delete file="cobertura.ser" /> <cobertura-instrument todir="${classes.instrumented}"> <ignore regex="org.apache.log4j.*" /> <fileset dir="${classes}"> <include name="**/*.class" /> </fileset> </cobertura-instrument> </target> The log file says it runs successfully: cobertura-tag-classes: [delete] Deleting: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/cobertura.ser [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-instrument] Instrumenting 187 files to /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test/instrumented [cobertura-instrument] Cobertura: Saved information on 187 classes. [cobertura-instrument] Instrument time: 1982ms Yet, when I go to execute my tests, I get this: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) PersistenceBroker$PerformWithHibernateSession is in my original classes directory, but not in the instrumented classes directory. I can get Cobertura to run to completion by including my non-instrumented classes in the test run path, but everything comes up 0%. If I remove my non-instrumented classes, it dies trying to run the test with the exception above. Setup: Java: 1.6.0_14-b08 Cobertura: 1.9.4.1 Ant: 1.7.1 Hudson: 1.363 Any advice? Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Cobertura-devel mailing list Cob...@li...<mailto:Cob...@li...> https://lists.sourceforge.net/lists/listinfo/cobertura-devel |
From: Bill H. <han...@mc...> - 2010-06-25 14:39:25
|
I think I got it figured out. I changed the ant task to copy all classes to the instrumented dir, then instrumented in-place. That gives me a valid .ser file. Now I need to figure out why Hudson is still showing me all 0's. Thanks for your help! Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 From: John W. Lewis [mailto:Joh...@sa...] Sent: Friday, June 25, 2010 10:11 AM To: Bill Hansley; cob...@li... Subject: RE: [Cobertura-devel] Instrument task misses classes, tests die as a result Right. They are not copied to the instrumented classes directory. So, you can either remove the todir attribute from <cobertura-instrument> to instrument in place, or make sure both class directories are on the classpath. John From: Bill Hansley [mailto:han...@mc...] Sent: Friday, June 25, 2010 10:08 AM To: John W. Lewis; cob...@li... Subject: RE: [Cobertura-devel] Instrument task misses classes, tests die as a result Yes, it is. I'm guessing that interfaces (being declarations rather than implementations) can't be instrumented? ... public interface PerformWithHibernateSession { Object performAction(Session session) throws Exception; } private class FindByIDCommand implements PerformWithHibernateSession { private Persistent obj; public FindByIDCommand(Persistent obj) { this.obj = obj; } ... Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 From: John W. Lewis [mailto:Joh...@sa...] Sent: Friday, June 25, 2010 10:01 AM To: Bill Hansley; cob...@li... Subject: RE: [Cobertura-devel] Instrument task misses classes, tests die as a result Is the missing class an interface? From: Bill Hansley [mailto:han...@mc...] Sent: Friday, June 25, 2010 9:55 AM To: cob...@li... Subject: [Cobertura-devel] Instrument task misses classes, tests die as a result Hi, I'm a newbie to Cobertura, and am having trouble getting it to work completely from start to finish. Starting from the end, here's the error I'm getting: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) The class it can't find (PersistenceBroker$PerformWithHibernateSession) is in my classes directory, but when instrument runs via ant, using this task: <target name="cobertura-tag-classes"> <delete file="cobertura.ser" /> <cobertura-instrument todir="${classes.instrumented}"> <ignore regex="org.apache.log4j.*" /> <fileset dir="${classes}"> <include name="**/*.class" /> </fileset> </cobertura-instrument> </target> The log file says it runs successfully: cobertura-tag-classes: [delete] Deleting: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/cobertura.ser [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-instrument] Instrumenting 187 files to /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test/instrumented [cobertura-instrument] Cobertura: Saved information on 187 classes. [cobertura-instrument] Instrument time: 1982ms Yet, when I go to execute my tests, I get this: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) PersistenceBroker$PerformWithHibernateSession is in my original classes directory, but not in the instrumented classes directory. I can get Cobertura to run to completion by including my non-instrumented classes in the test run path, but everything comes up 0%. If I remove my non-instrumented classes, it dies trying to run the test with the exception above. Setup: Java: 1.6.0_14-b08 Cobertura: 1.9.4.1 Ant: 1.7.1 Hudson: 1.363 Any advice? Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 |
From: John W. L. <Joh...@sa...> - 2010-06-25 14:11:34
|
Right. They are not copied to the instrumented classes directory. So, you can either remove the todir attribute from <cobertura-instrument> to instrument in place, or make sure both class directories are on the classpath. John From: Bill Hansley [mailto:han...@mc...] Sent: Friday, June 25, 2010 10:08 AM To: John W. Lewis; cob...@li... Subject: RE: [Cobertura-devel] Instrument task misses classes, tests die as a result Yes, it is. I'm guessing that interfaces (being declarations rather than implementations) can't be instrumented? ... public interface PerformWithHibernateSession { Object performAction(Session session) throws Exception; } private class FindByIDCommand implements PerformWithHibernateSession { private Persistent obj; public FindByIDCommand(Persistent obj) { this.obj = obj; } ... Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 From: John W. Lewis [mailto:Joh...@sa...] Sent: Friday, June 25, 2010 10:01 AM To: Bill Hansley; cob...@li... Subject: RE: [Cobertura-devel] Instrument task misses classes, tests die as a result Is the missing class an interface? From: Bill Hansley [mailto:han...@mc...] Sent: Friday, June 25, 2010 9:55 AM To: cob...@li... Subject: [Cobertura-devel] Instrument task misses classes, tests die as a result Hi, I'm a newbie to Cobertura, and am having trouble getting it to work completely from start to finish. Starting from the end, here's the error I'm getting: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) The class it can't find (PersistenceBroker$PerformWithHibernateSession) is in my classes directory, but when instrument runs via ant, using this task: <target name="cobertura-tag-classes"> <delete file="cobertura.ser" /> <cobertura-instrument todir="${classes.instrumented}"> <ignore regex="org.apache.log4j.*" /> <fileset dir="${classes}"> <include name="**/*.class" /> </fileset> </cobertura-instrument> </target> The log file says it runs successfully: cobertura-tag-classes: [delete] Deleting: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/cobertura.ser [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-instrument] Instrumenting 187 files to /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test/instrumented [cobertura-instrument] Cobertura: Saved information on 187 classes. [cobertura-instrument] Instrument time: 1982ms Yet, when I go to execute my tests, I get this: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) PersistenceBroker$PerformWithHibernateSession is in my original classes directory, but not in the instrumented classes directory. I can get Cobertura to run to completion by including my non-instrumented classes in the test run path, but everything comes up 0%. If I remove my non-instrumented classes, it dies trying to run the test with the exception above. Setup: Java: 1.6.0_14-b08 Cobertura: 1.9.4.1 Ant: 1.7.1 Hudson: 1.363 Any advice? Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 |
From: Bill H. <han...@mc...> - 2010-06-25 14:08:35
|
Yes, it is. I'm guessing that interfaces (being declarations rather than implementations) can't be instrumented? ... public interface PerformWithHibernateSession { Object performAction(Session session) throws Exception; } private class FindByIDCommand implements PerformWithHibernateSession { private Persistent obj; public FindByIDCommand(Persistent obj) { this.obj = obj; } ... Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 From: John W. Lewis [mailto:Joh...@sa...] Sent: Friday, June 25, 2010 10:01 AM To: Bill Hansley; cob...@li... Subject: RE: [Cobertura-devel] Instrument task misses classes, tests die as a result Is the missing class an interface? From: Bill Hansley [mailto:han...@mc...] Sent: Friday, June 25, 2010 9:55 AM To: cob...@li... Subject: [Cobertura-devel] Instrument task misses classes, tests die as a result Hi, I'm a newbie to Cobertura, and am having trouble getting it to work completely from start to finish. Starting from the end, here's the error I'm getting: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) The class it can't find (PersistenceBroker$PerformWithHibernateSession) is in my classes directory, but when instrument runs via ant, using this task: <target name="cobertura-tag-classes"> <delete file="cobertura.ser" /> <cobertura-instrument todir="${classes.instrumented}"> <ignore regex="org.apache.log4j.*" /> <fileset dir="${classes}"> <include name="**/*.class" /> </fileset> </cobertura-instrument> </target> The log file says it runs successfully: cobertura-tag-classes: [delete] Deleting: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/cobertura.ser [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-instrument] Instrumenting 187 files to /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test/instrumented [cobertura-instrument] Cobertura: Saved information on 187 classes. [cobertura-instrument] Instrument time: 1982ms Yet, when I go to execute my tests, I get this: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) PersistenceBroker$PerformWithHibernateSession is in my original classes directory, but not in the instrumented classes directory. I can get Cobertura to run to completion by including my non-instrumented classes in the test run path, but everything comes up 0%. If I remove my non-instrumented classes, it dies trying to run the test with the exception above. Setup: Java: 1.6.0_14-b08 Cobertura: 1.9.4.1 Ant: 1.7.1 Hudson: 1.363 Any advice? Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 |
From: Jake C. <jak...@ga...> - 2010-06-25 14:03:46
|
When you included both directories on the classpath, did you have the non-instrumented folder come first? If so, try putting the instrumented dir first so any classes present in both will load the instrumented version. -Jake 2010/6/25 Bill Hansley <han...@mc...> > Hi, > > > > I’m a newbie to Cobertura, and am having trouble getting it to work > completely from start to finish. > > > > Starting from the end, here’s the error I’m getting: > > > > > > java.lang.reflect.InvocationTargetException > > Caused by: java.lang.NoClassDefFoundError: > edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession > > at java.lang.ClassLoader.defineClass1(Native Method) > > at java.lang.ClassLoader.defineClass(ClassLoader.java:621) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:252) > > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) > > at > suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) > > at > suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) > > Caused by: java.lang.ClassNotFoundException: > edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession > > at java.lang.ClassLoader.loadClass(ClassLoader.java:252) > > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) > > > > > > The class it can’t find (PersistenceBroker$PerformWithHibernateSession) is > in my classes directory, but when instrument runs via ant, using this task: > > > > > > <target name="cobertura-tag-classes"> > > <delete file="cobertura.ser" /> > > <cobertura-instrument > todir="${classes.instrumented}"> > > <ignore > regex="org.apache.log4j.*" /> > > <fileset dir="${classes}"> > > <include > name="**/*.class" /> > > </fileset> > > </cobertura-instrument> > > </target> > > > > The log file says it runs successfully: > > > > cobertura-tag-classes: > > [delete] Deleting: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/cobertura.ser > > [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file > > [cobertura-instrument] Instrumenting 187 files to /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test/instrumented > > [cobertura-instrument] Cobertura: Saved information on 187 classes. > > [cobertura-instrument] Instrument time: 1982ms > > > > > > Yet, when I go to execute my tests, I get this: > > > > java.lang.reflect.InvocationTargetException > > Caused by: java.lang.NoClassDefFoundError: > edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession > > at java.lang.ClassLoader.defineClass1(Native Method) > > at java.lang.ClassLoader.defineClass(ClassLoader.java:621) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:252) > > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) > > at > suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) > > at > suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) > > Caused by: java.lang.ClassNotFoundException: > edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession > > at java.lang.ClassLoader.loadClass(ClassLoader.java:252) > > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) > > > > > > PersistenceBroker$PerformWithHibernateSession is in my original classes > directory, but not in the instrumented classes directory. > > > > I can get Cobertura to run to completion by including my non-instrumented > classes in the test run path, but everything comes up 0%. If I remove my > non-instrumented classes, it dies trying to run the test with the exception > above. > > > > Setup: > > Java: 1.6.0_14-b08 > > Cobertura: 1.9.4.1 > > Ant: 1.7.1 > > Hudson: 1.363 > > > > Any advice? > > > > Thanks, > > Bill Hansley > > > > ____________________________ > > Duke University Health System > DHTS Perioperative Services > Manager, Development Team > 10018 Hock Plaza > w) 919.668.1388 > f) 919.668.5568 > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > > |
From: John W. L. <Joh...@sa...> - 2010-06-25 14:01:02
|
Is the missing class an interface? From: Bill Hansley [mailto:han...@mc...] Sent: Friday, June 25, 2010 9:55 AM To: cob...@li... Subject: [Cobertura-devel] Instrument task misses classes, tests die as a result Hi, I'm a newbie to Cobertura, and am having trouble getting it to work completely from start to finish. Starting from the end, here's the error I'm getting: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) The class it can't find (PersistenceBroker$PerformWithHibernateSession) is in my classes directory, but when instrument runs via ant, using this task: <target name="cobertura-tag-classes"> <delete file="cobertura.ser" /> <cobertura-instrument todir="${classes.instrumented}"> <ignore regex="org.apache.log4j.*" /> <fileset dir="${classes}"> <include name="**/*.class" /> </fileset> </cobertura-instrument> </target> The log file says it runs successfully: cobertura-tag-classes: [delete] Deleting: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/cobertura.ser [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-instrument] Instrumenting 187 files to /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test/instrumented [cobertura-instrument] Cobertura: Saved information on 187 classes. [cobertura-instrument] Instrument time: 1982ms Yet, when I go to execute my tests, I get this: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) PersistenceBroker$PerformWithHibernateSession is in my original classes directory, but not in the instrumented classes directory. I can get Cobertura to run to completion by including my non-instrumented classes in the test run path, but everything comes up 0%. If I remove my non-instrumented classes, it dies trying to run the test with the exception above. Setup: Java: 1.6.0_14-b08 Cobertura: 1.9.4.1 Ant: 1.7.1 Hudson: 1.363 Any advice? Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 |
From: Bill H. <han...@mc...> - 2010-06-25 13:55:29
|
Hi, I'm a newbie to Cobertura, and am having trouble getting it to work completely from start to finish. Starting from the end, here's the error I'm getting: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) The class it can't find (PersistenceBroker$PerformWithHibernateSession) is in my classes directory, but when instrument runs via ant, using this task: <target name="cobertura-tag-classes"> <delete file="cobertura.ser" /> <cobertura-instrument todir="${classes.instrumented}"> <ignore regex="org.apache.log4j.*" /> <fileset dir="${classes}"> <include name="**/*.class" /> </fileset> </cobertura-instrument> </target> The log file says it runs successfully: cobertura-tag-classes: [delete] Deleting: /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/cobertura.ser [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-instrument] Instrumenting 187 files to /var/cruise/hudson/home/jobs/requestor-trunk/workspace/trunk/work/test/instrumented [cobertura-instrument] Cobertura: Saved information on 187 classes. [cobertura-instrument] Instrument time: 1982ms Yet, when I go to execute my tests, I get this: java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: edu/duke/dhts/periop/requestOR/persistence/broker/PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at suite.edu.duke.dhts.periop.requestOR.AllHibernateTests.suite(AllHibernateTests.java:32) at suite.edu.duke.dhts.periop.requestOR.AllTests.suite(AllTests.java:19) Caused by: java.lang.ClassNotFoundException: edu.duke.dhts.periop.requestOR.persistence.broker.PersistenceBroker$PerformWithHibernateSession at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) PersistenceBroker$PerformWithHibernateSession is in my original classes directory, but not in the instrumented classes directory. I can get Cobertura to run to completion by including my non-instrumented classes in the test run path, but everything comes up 0%. If I remove my non-instrumented classes, it dies trying to run the test with the exception above. Setup: Java: 1.6.0_14-b08 Cobertura: 1.9.4.1 Ant: 1.7.1 Hudson: 1.363 Any advice? Thanks, Bill Hansley ____________________________ Duke University Health System DHTS Perioperative Services Manager, Development Team 10018 Hock Plaza w) 919.668.1388 f) 919.668.5568 |
From: 孙玉新 <dra...@gm...> - 2010-06-24 06:01:34
|
Hi, I'm working with cobertura to genenrate some coverage report of Japanese project. It reports the following error: [cobertura] WARN [main] net.sourceforge.cobertura.reporting.ComplexityCalculator - JavaNCSS got an error while parsing the java file After going through the source codes of cobertura 1.9.4.1, it seems the Javancss and ComplexityCalculator does not work with UTF-8. Related source: ComplexityCalculator.java L102 Javancss.java L413 Pls have a confirm it and it would be kind if you fix it in next release. Thx. Joey. |
From: John W. L. <Joh...@sa...> - 2010-06-22 03:31:59
|
I am glad you got it working. If you send me the original ant script, I might be able to see what the problem may have been. John From: Amos [mailto:joe...@ya...] Sent: Monday, June 21, 2010 11:26 PM To: John W. Lewis; cob...@li... Subject: Re: [Cobertura-devel] Problem with Report Hi John, Thank you very much for such a quick response time. I am using in my ANT file a property for the location of the data file (${cobertura.data.file}) and so I'm sure all references are correct. I changed the value of the property to be the same as the working directory and the reports now work. Perhaps there is a bug in the report task if the data file is not in the same directory. Thank you very much for your help. Amos ________________________________ From: John W. Lewis <Joh...@sa...> To: Amos <joe...@ya...>; "cob...@li..." <cob...@li...> Sent: Mon, June 21, 2010 10:13:20 PM Subject: RE: [Cobertura-devel] Problem with Report By the way, make sure you delete the cobertura.ser file and any instrumented classes before running the instrumentation. From: Amos [mailto:joe...@ya...] Sent: Monday, June 21, 2010 9:59 PM To: cob...@li... Subject: [Cobertura-devel] Problem with Report Hi, I recently downloaded and installed Cobertura and I am facing some issues. Perhaps someone on this list can help. I am having the following problem: - The report only shows classes that have unit tests for them. Classes with no unit tests are omitted from the report - All classes show 100% line coverage - All classes show N/A for branch coverage I have noticed the following: - Clicking on a class, I could see that 50% of the code was covered using line highlighting (nice job). However, the summary for the class says 100% - Instrumentation, Compilation, unit tests, and cobertura report worked without a problem (no reported errors) - If I delete the data file (cobertura.ser) then all the classes show up in the report (although with 0% coverage) Let me know if I can provide more information. Thanks, Amos |
From: Amos <joe...@ya...> - 2010-06-22 03:26:20
|
Hi John, Thank you very much for such a quick response time. I am using in my ANT file a property for the location of the data file (${cobertura.data.file}) and so I'm sure all references are correct. I changed the value of the property to be the same as the working directory and the reports now work. Perhaps there is a bug in the report task if the data file is not in the same directory. Thank you very much for your help. Amos ________________________________ From: John W. Lewis <Joh...@sa...> To: Amos <joe...@ya...>; "cob...@li..." <cob...@li...> Sent: Mon, June 21, 2010 10:13:20 PM Subject: RE: [Cobertura-devel] Problem with Report By the way, make sure you delete the cobertura.ser file and any instrumented classes before running the instrumentation. From:Amos [mailto:joe...@ya...] Sent: Monday, June 21, 2010 9:59 PM To: cob...@li... Subject: [Cobertura-devel] Problem with Report Hi, I recently downloaded and installed Cobertura and I am facing some issues. Perhaps someone on this list can help. I am having the following problem: - The report only shows classes that have unit tests for them. Classes with no unit tests are omitted from the report - All classes show 100% line coverage - All classes show N/A for branch coverage I have noticed the following: - Clicking on a class, I could see that 50% of the code was covered using line highlighting (nice job). However, the summary for the class says 100% - Instrumentation, Compilation, unit tests, and cobertura report worked without a problem (no reported errors) - If I delete the data file (cobertura.ser) then all the classes show up in the report (although with 0% coverage) Let me know if I can provide more information. Thanks, Amos |
From: John W. L. <Joh...@sa...> - 2010-06-22 02:42:15
|
This almost certainly means that the process running the tests is not using the cobertura.ser file that is created by the instrumentation. Either copy the cobertura.ser file to the working directory of the process, or pass the net.sourceforge.cobertura.datafile system property to the test process with the location of the cobertura.ser file. John From: Amos [mailto:joe...@ya...] Sent: Monday, June 21, 2010 9:59 PM To: cob...@li... Subject: [Cobertura-devel] Problem with Report Hi, I recently downloaded and installed Cobertura and I am facing some issues. Perhaps someone on this list can help. I am having the following problem: - The report only shows classes that have unit tests for them. Classes with no unit tests are omitted from the report - All classes show 100% line coverage - All classes show N/A for branch coverage I have noticed the following: - Clicking on a class, I could see that 50% of the code was covered using line highlighting (nice job). However, the summary for the class says 100% - Instrumentation, Compilation, unit tests, and cobertura report worked without a problem (no reported errors) - If I delete the data file (cobertura.ser) then all the classes show up in the report (although with 0% coverage) Let me know if I can provide more information. Thanks, Amos |
From: John W. L. <Joh...@sa...> - 2010-06-22 02:13:32
|
By the way, make sure you delete the cobertura.ser file and any instrumented classes before running the instrumentation. From: Amos [mailto:joe...@ya...] Sent: Monday, June 21, 2010 9:59 PM To: cob...@li... Subject: [Cobertura-devel] Problem with Report Hi, I recently downloaded and installed Cobertura and I am facing some issues. Perhaps someone on this list can help. I am having the following problem: - The report only shows classes that have unit tests for them. Classes with no unit tests are omitted from the report - All classes show 100% line coverage - All classes show N/A for branch coverage I have noticed the following: - Clicking on a class, I could see that 50% of the code was covered using line highlighting (nice job). However, the summary for the class says 100% - Instrumentation, Compilation, unit tests, and cobertura report worked without a problem (no reported errors) - If I delete the data file (cobertura.ser) then all the classes show up in the report (although with 0% coverage) Let me know if I can provide more information. Thanks, Amos |
From: Amos <joe...@ya...> - 2010-06-22 02:05:17
|
Hi, I recently downloaded and installed Cobertura and I am facing some issues. Perhaps someone on this list can help. I am having the following problem: - The report only shows classes that have unit tests for them. Classes with no unit tests are omitted from the report - All classes show 100% line coverage - All classes show N/A for branch coverage I have noticed the following: - Clicking on a class, I could see that 50% of the code was covered using line highlighting (nice job). However, the summary for the class says 100% - Instrumentation, Compilation, unit tests, and cobertura report worked without a problem (no reported errors) - If I delete the data file (cobertura.ser) then all the classes show up in the report (although with 0% coverage) Let me know if I can provide more information. Thanks, Amos |
From: Gautam S. -X (g. - A. S. I. at Cisco) <gsh...@ci...> - 2010-06-14 22:32:03
|
Hi Jon, Firstly Thank you very much for the reply. J So this is what I did to get the ser file to be updated, I changed the permissions to 666 for the ser file & then it started writing/updating the ser file. So everyone out there can also use/try this as a solution. Thank you... From: John W. Lewis [mailto:Joh...@sa...] Sent: Monday, June 14, 2010 12:47 PM To: Gautam Shivnani -X (gshivnan - Apex Systems, Inc. at Cisco); cob...@li... Subject: RE: Ser files not getting updated by the Jobs I was out of vacation most of last week. Recently I worked with a tester that was trying to get this working on JBoss. We found that the cobertura.ser file in the bin directory was not being updated. It seemed the JBoss start script would set the current directory of the server to whatever the current directory was when you ran the script. So, if you were not in the bin directory when you ran the JBoss start script, it would not expect the cobertura.ser file to be there. So, try cd'ing to the bin directory before you run the JBoss start script. It may also be informative to do a `find / -name cobertura.ser`. It may show an extra cobertura.ser file on your hard drive. That would probably be the one that was updated. If none of this helps, let me know. There are other things that can be tried. John From: Gautam Shivnani -X (gshivnan - Apex Systems, Inc. at Cisco) [mailto:gsh...@ci...] Sent: Wednesday, June 09, 2010 1:45 PM To: cob...@li... Subject: [Cobertura-devel] FW: Ser files not getting updated by the Jobs Hi, I am trying to run cobertura on my application which has JBoss as the server. After I stop the JBoss server the ser file is not getting updated. Steps Performed by me: 1) Stopped the JBoss server 2) Instrumented the war file & transferred it to the corresponding directory along with the cobertura.jar. 3) The ser file which was created "cobertura.ser" was transferred to the bin directory of JBoss. 4) Now restarted the JBoss server 5) Performed a couple of clicks on my application & updated about 10 values in the Database. 6) Now stopped the JBoss server 7) Copied the ser file & ran the report command 8) The ser file didn't get overwritten by the updated values & the report had 0% all throughout. Version of Cobertura: 1.9.4.1 Version of JBoss: 4.3 Version of Linux: Linux version 2.6.9-78.ELsmp (bre...@hs...) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Wed Jul 9 15:39:47 EDT 2008 Please help me out with this issue, I need the code coverage report. Thanks in Adavnce Gautam Shivnani QA Engineer, TXBU Cisco Systems Inc. |
From: John W. L. <Joh...@sa...> - 2010-06-14 19:49:56
|
I was out most of last week. I am catching up on email. Yes, if you exclude the test classes during instrumentation, they should not end up in the report. You have an couple of extra spaces in the name attribute of <exclude> by the way. John From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Wednesday, June 09, 2010 11:47 AM To: cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: [Cobertura-devel] Report in Cobertura Hi, Is there any relationship of cobertura-instrument task exclude rule and cobertura-report task? Like: <cobertura-instrument todir="${dir.build}/cobertura.ser"> <fileset dir="${dir.build.class}"> <include name="org/jaxen/javabean/${package.name}/**/*.class"/> <exclude name=" org/jaxen/javabean/Test/**/*.class " /> </fileset> </cobertura-instrument> Is the Test package will be excluded from the report. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si...<mailto:ash...@si...> www.siemens.co.in<BLOCKED::http://www.siemens.co.in> ________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. |
From: John W. L. <Joh...@sa...> - 2010-06-14 19:47:33
|
I was out of vacation most of last week. Recently I worked with a tester that was trying to get this working on JBoss. We found that the cobertura.ser file in the bin directory was not being updated. It seemed the JBoss start script would set the current directory of the server to whatever the current directory was when you ran the script. So, if you were not in the bin directory when you ran the JBoss start script, it would not expect the cobertura.ser file to be there. So, try cd'ing to the bin directory before you run the JBoss start script. It may also be informative to do a `find / -name cobertura.ser`. It may show an extra cobertura.ser file on your hard drive. That would probably be the one that was updated. If none of this helps, let me know. There are other things that can be tried. John From: Gautam Shivnani -X (gshivnan - Apex Systems, Inc. at Cisco) [mailto:gsh...@ci...] Sent: Wednesday, June 09, 2010 1:45 PM To: cob...@li... Subject: [Cobertura-devel] FW: Ser files not getting updated by the Jobs Hi, I am trying to run cobertura on my application which has JBoss as the server. After I stop the JBoss server the ser file is not getting updated. Steps Performed by me: 1) Stopped the JBoss server 2) Instrumented the war file & transferred it to the corresponding directory along with the cobertura.jar. 3) The ser file which was created "cobertura.ser" was transferred to the bin directory of JBoss. 4) Now restarted the JBoss server 5) Performed a couple of clicks on my application & updated about 10 values in the Database. 6) Now stopped the JBoss server 7) Copied the ser file & ran the report command 8) The ser file didn't get overwritten by the updated values & the report had 0% all throughout. Version of Cobertura: 1.9.4.1 Version of JBoss: 4.3 Version of Linux: Linux version 2.6.9-78.ELsmp (bre...@hs...) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Wed Jul 9 15:39:47 EDT 2008 Please help me out with this issue, I need the code coverage report. Thanks in Adavnce Gautam Shivnani QA Engineer, TXBU Cisco Systems Inc. |
From: Gautam S. -X (g. - A. S. I. at Cisco) <gsh...@ci...> - 2010-06-09 17:44:57
|
Hi, I am trying to run cobertura on my application which has JBoss as the server. After I stop the JBoss server the ser file is not getting updated. Steps Performed by me: 1) Stopped the JBoss server 2) Instrumented the war file & transferred it to the corresponding directory along with the cobertura.jar. 3) The ser file which was created "cobertura.ser" was transferred to the bin directory of JBoss. 4) Now restarted the JBoss server 5) Performed a couple of clicks on my application & updated about 10 values in the Database. 6) Now stopped the JBoss server 7) Copied the ser file & ran the report command 8) The ser file didn't get overwritten by the updated values & the report had 0% all throughout. Version of Cobertura: 1.9.4.1 Version of JBoss: 4.3 Version of Linux: Linux version 2.6.9-78.ELsmp (bre...@hs...) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Wed Jul 9 15:39:47 EDT 2008 Please help me out with this issue, I need the code coverage report. Thanks in Adavnce Gautam Shivnani QA Engineer, TXBU Cisco Systems Inc. |
From: Soni, A. IN B. S. <ash...@si...> - 2010-06-09 16:07:50
|
Hi, Is there any relationship of cobertura-instrument task exclude rule and cobertura-report task? Like: <cobertura-instrument todir="${dir.build}/cobertura.ser"> <fileset dir="${dir.build.class}"> <include name="org/jaxen/javabean/${package.name}/**/*.class"/> <exclude name=" org/jaxen/javabean/Test/**/*.class " /> </fileset> </cobertura-instrument> Is the Test package will be excluded from the report. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si...<mailto:ash...@si...> www.siemens.co.in<BLOCKED::http://www.siemens.co.in> ________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. |
From: John W. L. <Joh...@sa...> - 2010-06-04 17:05:15
|
I am assuming that ImsMessageIds is in a package. If it is not, then you should not use the "\.". Just specify: <excludeClasses regex=".*ImsMessageIds.*" /> Or just: <excludeClasses regex="ImsMessageIds" /> Try making sure only jars are included in the fileset for the cobertura-instrument. Maybe Cobertura is seeing the ImsMessageIds.class file and including it (I thought the <excludeClasses> would cause it to ignore it, but maybe I am wrong). This is a bit minor, but you could just reuse the same cobertura.ser file without creating one for each test package. Cobertura will take care of adding the additional counts for each test run to the same cobertura.ser file. Feel free to attach your ant script or post the relevant portions. I could take a look at the details. John -----Original Message----- From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 11:22 PM To: John W. Lewis; cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: RE: Uses of Cobertura-instrument task Yes I have so many PackageTestSuite for different packages and unittest will run for all packages one by one. So during the instrumentation I am using single Cobertura.ser datafile and during the unit test execution I am creating the Cobertura.ser datafile for each test package later I am doing a merge of all Cobertura.ser into the one file and using it for Cobertura-report task. As I discussed with you I have a regular expression for to exclude a class called ImsMessageIds, use ".*ImsMessageIds" but in report section it's creating a report for a class called ImsMessageIds with coverage 0% for line and branch. <excludeClasses regex=".*\.ImsMessageIds.*" /> Source Classes are distributed in gen\jars\lin and gen\classes\lin. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in -----Original Message----- From: John W. Lewis [mailto:Joh...@sa...] Sent: Friday, June 04, 2010 2:19 AM To: John W. Lewis; Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task 1) Yes 2) I'm not sure what you are asking. The regular expression for "anything" is ".*". 3) Cobertura.ser contains the line and branch information of the classes. After junit execution, the file contains the number of times each line/branch was hit. 4) Usually the same cobertura.ser file that is created during the instrumentation is used during junit and used for the report generation - one file is all that is needed. One report is usually created. Are you trying to create multiple reports? From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 3:14 PM To: John W. Lewis; cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: RE: Uses of Cobertura-instrument task I have some more questions: 1) As per the previous statement I understand that includeClasses and excludeClasses with regex's will work with the classes in jars and also if classes is available in directory location like gen\classes\lin. Is it right? 2) What's a right way to understand a regular expression to exclude\include anything from anything? 3) What's information Cobertura-instrument will write in Cobertura.ser datafile. What information further appended into the Cobertura.ser during the junit execution task. 4) Is it correct to write all Cobertura-instrument task information for each package in common Cobertura.ser datafile into the one location and during the junit execution write the other information into the testcase package Cobertura.ser datafile. Then later append all Cobertura.ser into the one file that we can use during Cobertura-check and Cobertura-report task. -------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 11:19 PM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task If you are trying to instrument class files, then it is convenient to use <include> and <exclude> with a <fileset>, but if you are trying to instrument a jar file, it will not work. You have to specify regex's for fully qualified classnames. To exclude any class that has "Test" in it, use ".*Test.*". To exclude any class starts with "contrib", use "contrib.*". To exclude a class called ImsMessageIds, use ".*ImsMessageIds". To exclude all classes in package a.b.c, use "a.b.c.*" From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 2:38 AM To: cob...@li...; John W. Lewis Subject: RE: Uses of Cobertura-instrument task But if I want to exclude some file and folder with specific name then I have to include them in excludeClasses? Like: <excludeClasses regex="*.*Test*" /> <excludeClasses regex="*.contrib.*" /> <excludeClasses regex="*.ImsMessageIds*" /> <excludeClasses regex="*Mock*" /> <excludeClasses regex="PackageTestSuite*" /> <excludeClasses regex="*Base64*" /> <excludeClasses regex="*TransformerUI*" /> But when I am using this I am getting the error like: [cobertura-instrument] WARN addRegex, The regular expression *.*Test* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.contrib.* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.ImsMessageIds is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Mock* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Base64* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *TransformerUI* is invalid: ?+* follows nothing in expression Same rule is working fine in Emma Code coverage. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 1:20 AM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task You will probably want to use something more like (from http://cobertura.sourceforge.net/anttaskreference.html): <cobertura-instrument todir="${instrumented.dir}"> <includeClasses regex=".*" /> <excludeClasses regex=".*\.Test.*" /> <instrumentationClasspath> <path refid="test.classpath" /> <pathelement location="${test.build}" /> </instrumentationClasspath> </cobertura-instrument> The regular expressions would be ".*Test.*", ".*\.contrib\..*", etc. John From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Wednesday, June 02, 2010 4:47 AM To: cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: [Cobertura-devel] Uses of Cobertura-instrument task Hello All, Can please help me for following scenario: I want to do the Cobertura instrumentation on more than 1 jar and one gen\classes folder but I want to do for some specific package. Like: <!--include/exclude package pattern set --> <patternset id="filter.instrument"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> </patternset> <cobertura-instrument todir="${dir.build}/cobertura.ser"> <fileset dir="${ dir.build.jars}"> <include name="A1.jar" /> <include name="A2.jar" /> <include name="A3.jar" /> <include name="A4.jar" /> <include name="A5.jar" /> <include name="A6.jar" /> <include name="A7.jar" /> <include name="A8.jar" /> <patternset refid="filter.instrument"/> </fileset> <fileset dir="${dir.build.class}"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> <patternset refid="filter.instrument"/> </fileset> </cobertura-instrument> Please help me for the above example is that will work or I have to write it in different way. In Advance Thanks for the help. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. |
From: Soni, A. IN B. S. <ash...@si...> - 2010-06-04 03:37:29
|
Yes I have so many PackageTestSuite for different packages and unittest will run for all packages one by one. So during the instrumentation I am using single Cobertura.ser datafile and during the unit test execution I am creating the Cobertura.ser datafile for each test package later I am doing a merge of all Cobertura.ser into the one file and using it for Cobertura-report task. As I discussed with you I have a regular expression for to exclude a class called ImsMessageIds, use ".*ImsMessageIds" but in report section it's creating a report for a class called ImsMessageIds with coverage 0% for line and branch. <excludeClasses regex=".*\.ImsMessageIds.*" /> Source Classes are distributed in gen\jars\lin and gen\classes\lin. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in -----Original Message----- From: John W. Lewis [mailto:Joh...@sa...] Sent: Friday, June 04, 2010 2:19 AM To: John W. Lewis; Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task 1) Yes 2) I'm not sure what you are asking. The regular expression for "anything" is ".*". 3) Cobertura.ser contains the line and branch information of the classes. After junit execution, the file contains the number of times each line/branch was hit. 4) Usually the same cobertura.ser file that is created during the instrumentation is used during junit and used for the report generation - one file is all that is needed. One report is usually created. Are you trying to create multiple reports? From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 3:14 PM To: John W. Lewis; cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: RE: Uses of Cobertura-instrument task I have some more questions: 1) As per the previous statement I understand that includeClasses and excludeClasses with regex's will work with the classes in jars and also if classes is available in directory location like gen\classes\lin. Is it right? 2) What's a right way to understand a regular expression to exclude\include anything from anything? 3) What's information Cobertura-instrument will write in Cobertura.ser datafile. What information further appended into the Cobertura.ser during the junit execution task. 4) Is it correct to write all Cobertura-instrument task information for each package in common Cobertura.ser datafile into the one location and during the junit execution write the other information into the testcase package Cobertura.ser datafile. Then later append all Cobertura.ser into the one file that we can use during Cobertura-check and Cobertura-report task. -------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 11:19 PM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task If you are trying to instrument class files, then it is convenient to use <include> and <exclude> with a <fileset>, but if you are trying to instrument a jar file, it will not work. You have to specify regex's for fully qualified classnames. To exclude any class that has "Test" in it, use ".*Test.*". To exclude any class starts with "contrib", use "contrib.*". To exclude a class called ImsMessageIds, use ".*ImsMessageIds". To exclude all classes in package a.b.c, use "a.b.c.*" From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 2:38 AM To: cob...@li...; John W. Lewis Subject: RE: Uses of Cobertura-instrument task But if I want to exclude some file and folder with specific name then I have to include them in excludeClasses? Like: <excludeClasses regex="*.*Test*" /> <excludeClasses regex="*.contrib.*" /> <excludeClasses regex="*.ImsMessageIds*" /> <excludeClasses regex="*Mock*" /> <excludeClasses regex="PackageTestSuite*" /> <excludeClasses regex="*Base64*" /> <excludeClasses regex="*TransformerUI*" /> But when I am using this I am getting the error like: [cobertura-instrument] WARN addRegex, The regular expression *.*Test* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.contrib.* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.ImsMessageIds is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Mock* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Base64* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *TransformerUI* is invalid: ?+* follows nothing in expression Same rule is working fine in Emma Code coverage. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 1:20 AM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task You will probably want to use something more like (from http://cobertura.sourceforge.net/anttaskreference.html): <cobertura-instrument todir="${instrumented.dir}"> <includeClasses regex=".*" /> <excludeClasses regex=".*\.Test.*" /> <instrumentationClasspath> <path refid="test.classpath" /> <pathelement location="${test.build}" /> </instrumentationClasspath> </cobertura-instrument> The regular expressions would be ".*Test.*", ".*\.contrib\..*", etc. John From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Wednesday, June 02, 2010 4:47 AM To: cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: [Cobertura-devel] Uses of Cobertura-instrument task Hello All, Can please help me for following scenario: I want to do the Cobertura instrumentation on more than 1 jar and one gen\classes folder but I want to do for some specific package. Like: <!--include/exclude package pattern set --> <patternset id="filter.instrument"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> </patternset> <cobertura-instrument todir="${dir.build}/cobertura.ser"> <fileset dir="${ dir.build.jars}"> <include name="A1.jar" /> <include name="A2.jar" /> <include name="A3.jar" /> <include name="A4.jar" /> <include name="A5.jar" /> <include name="A6.jar" /> <include name="A7.jar" /> <include name="A8.jar" /> <patternset refid="filter.instrument"/> </fileset> <fileset dir="${dir.build.class}"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> <patternset refid="filter.instrument"/> </fileset> </cobertura-instrument> Please help me for the above example is that will work or I have to write it in different way. In Advance Thanks for the help. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. |
From: John W. L. <Joh...@sa...> - 2010-06-03 22:27:31
|
No. The closest thing available would be to use a regex to exclude all the packages in the jar. From: Patrick Struhs [mailto:Str...@fa...] Sent: Thursday, June 03, 2010 5:59 PM To: cob...@li... Subject: [Cobertura-devel] Instrumenting war but ignoring a jar file in the war Is there a way to instrument a war file, but ignore a specific jar inside the war? I am instrumenting a war using an ant file. But if I specify this exclude .ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {margin-bottom:.0001pt;font-size:11.0pt;font-family:'Calibri','sans-serif';} .ExternalClass p.ecxMsoPlainText, .ExternalClass li.ecxMsoPlainText, .ExternalClass div.ecxMsoPlainText {margin-bottom:.0001pt;font-size:10.5pt;font-family:Consolas;} .ExternalClass span.ecxPlainTextChar {font-family:Consolas;} .ExternalClass .ecxMsoChpDefault {;} @page Section1 {size:8.5in 11.0in;} .ExternalClass div.ecxSection1 {page:Section1;} <fileset dir="${war.dir}"> <include name="**/*.war" /> <exclude name="**/*-client.jar" /> </fileset> it does not work. It's because the *-client.jar file is inside the war. So what I do is extract the war and then instrument the exploded war directory with this fileset <fileset dir="${explodedwar.dir}"> <include name="**/*.class" /> <include name="**/*.jar" /> <exclude name="**/*-client.jar" /> </fileset> Which works, but makes the scripting much more difficult since I must do this for each war. The reason I need to do this is our wars use enunciate (http://enunciate.codehaus.org/). This creates a *-client.jar file that is inside the war, ,but the source code may have been modified by enunciate if there are annotations. So a class file that is in the *-client.jar may not have the same line numbers that a class file in the war itself has. So when we look at coverage reports, we see strange things like comments being counted as lines. If anyone has any suggestions besides exploding the war and repackaging, let me know. Also please be aware of this if your team is using enunciate. thanks, Patrick NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. |
From: Patrick S. <Str...@fa...> - 2010-06-03 22:22:38
|
Is there a way to instrument a war file, but ignore a specific jar inside the war? I am instrumenting a war using an ant file. But if I specify this exclude .ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {margin-bottom:.0001pt;font-size:11.0pt;font-family:'Calibri','sans-serif';} .ExternalClass p.ecxMsoPlainText, .ExternalClass li.ecxMsoPlainText, .ExternalClass div.ecxMsoPlainText {margin-bottom:.0001pt;font-size:10.5pt;font-family:Consolas;} .ExternalClass span.ecxPlainTextChar {font-family:Consolas;} .ExternalClass .ecxMsoChpDefault {;} @page Section1 {size:8.5in 11.0in;} .ExternalClass div.ecxSection1 {page:Section1;} <fileset dir="${war.dir}"> <include name="**/*.war" /> <exclude name="**/*-client.jar" /> </fileset> it does not work. It's because the *-client.jar file is inside the war. So what I do is extract the war and then instrument the exploded war directory with this fileset <fileset dir="${explodedwar.dir}"> <include name="**/*.class" /> <include name="**/*.jar" /> <exclude name="**/*-client.jar" /> </fileset> Which works, but makes the scripting much more difficult since I must do this for each war. The reason I need to do this is our wars use enunciate (http://enunciate.codehaus.org/). This creates a *-client.jar file that is inside the war, ,but the source code may have been modified by enunciate if there are annotations. So a class file that is in the *-client.jar may not have the same line numbers that a class file in the war itself has. So when we look at coverage reports, we see strange things like comments being counted as lines. If anyone has any suggestions besides exploding the war and repackaging, let me know. Also please be aware of this if your team is using enunciate. thanks, Patrick NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. |
From: John W. L. <Joh...@sa...> - 2010-06-03 20:49:40
|
1) Yes 2) I'm not sure what you are asking. The regular expression for "anything" is ".*". 3) Cobertura.ser contains the line and branch information of the classes. After junit execution, the file contains the number of times each line/branch was hit. 4) Usually the same cobertura.ser file that is created during the instrumentation is used during junit and used for the report generation - one file is all that is needed. One report is usually created. Are you trying to create multiple reports? From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 3:14 PM To: John W. Lewis; cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: RE: Uses of Cobertura-instrument task I have some more questions: 1) As per the previous statement I understand that includeClasses and excludeClasses with regex's will work with the classes in jars and also if classes is available in directory location like gen\classes\lin. Is it right? 2) What's a right way to understand a regular expression to exclude\include anything from anything? 3) What's information Cobertura-instrument will write in Cobertura.ser datafile. What information further appended into the Cobertura.ser during the junit execution task. 4) Is it correct to write all Cobertura-instrument task information for each package in common Cobertura.ser datafile into the one location and during the junit execution write the other information into the testcase package Cobertura.ser datafile. Then later append all Cobertura.ser into the one file that we can use during Cobertura-check and Cobertura-report task. -------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 11:19 PM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task If you are trying to instrument class files, then it is convenient to use <include> and <exclude> with a <fileset>, but if you are trying to instrument a jar file, it will not work. You have to specify regex's for fully qualified classnames. To exclude any class that has "Test" in it, use ".*Test.*". To exclude any class starts with "contrib", use "contrib.*". To exclude a class called ImsMessageIds, use ".*ImsMessageIds". To exclude all classes in package a.b.c, use "a.b.c.*" From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 2:38 AM To: cob...@li...; John W. Lewis Subject: RE: Uses of Cobertura-instrument task But if I want to exclude some file and folder with specific name then I have to include them in excludeClasses? Like: <excludeClasses regex="*.*Test*" /> <excludeClasses regex="*.contrib.*" /> <excludeClasses regex="*.ImsMessageIds*" /> <excludeClasses regex="*Mock*" /> <excludeClasses regex="PackageTestSuite*" /> <excludeClasses regex="*Base64*" /> <excludeClasses regex="*TransformerUI*" /> But when I am using this I am getting the error like: [cobertura-instrument] WARN addRegex, The regular expression *.*Test* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.contrib.* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.ImsMessageIds is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Mock* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Base64* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *TransformerUI* is invalid: ?+* follows nothing in expression Same rule is working fine in Emma Code coverage. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 1:20 AM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task You will probably want to use something more like (from http://cobertura.sourceforge.net/anttaskreference.html): <cobertura-instrument todir="${instrumented.dir}"> <includeClasses regex=".*" /> <excludeClasses regex=".*\.Test.*" /> <instrumentationClasspath> <path refid="test.classpath" /> <pathelement location="${test.build}" /> </instrumentationClasspath> </cobertura-instrument> The regular expressions would be ".*Test.*", ".*\.contrib\..*", etc. John From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Wednesday, June 02, 2010 4:47 AM To: cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: [Cobertura-devel] Uses of Cobertura-instrument task Hello All, Can please help me for following scenario: I want to do the Cobertura instrumentation on more than 1 jar and one gen\classes folder but I want to do for some specific package. Like: <!--include/exclude package pattern set --> <patternset id="filter.instrument"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> </patternset> <cobertura-instrument todir="${dir.build}/cobertura.ser"> <fileset dir="${ dir.build.jars}"> <include name="A1.jar" /> <include name="A2.jar" /> <include name="A3.jar" /> <include name="A4.jar" /> <include name="A5.jar" /> <include name="A6.jar" /> <include name="A7.jar" /> <include name="A8.jar" /> <patternset refid="filter.instrument"/> </fileset> <fileset dir="${dir.build.class}"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> <patternset refid="filter.instrument"/> </fileset> </cobertura-instrument> Please help me for the above example is that will work or I have to write it in different way. In Advance Thanks for the help. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si... www.siemens.co.in ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. |
From: Soni, A. IN B. S. <ash...@si...> - 2010-06-03 19:24:50
|
I have some more questions: 1) As per the previous statement I understand that includeClasses and excludeClasses with regex's will work with the classes in jars and also if classes is available in directory location like gen\classes\lin. Is it right? 2) What's a right way to understand a regular expression to exclude\include anything from anything? 3) What's information Cobertura-instrument will write in Cobertura.ser datafile. What information further appended into the Cobertura.ser during the junit execution task. 4) Is it correct to write all Cobertura-instrument task information for each package in common Cobertura.ser datafile into the one location and during the junit execution write the other information into the testcase package Cobertura.ser datafile. Then later append all Cobertura.ser into the one file that we can use during Cobertura-check and Cobertura-report task. -------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si...<mailto:ash...@si...> www.siemens.co.in<BLOCKED::http://www.siemens.co.in> ________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 11:19 PM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task If you are trying to instrument class files, then it is convenient to use <include> and <exclude> with a <fileset>, but if you are trying to instrument a jar file, it will not work. You have to specify regex's for fully qualified classnames. To exclude any class that has "Test" in it, use ".*Test.*". To exclude any class starts with "contrib", use "contrib.*". To exclude a class called ImsMessageIds, use ".*ImsMessageIds". To exclude all classes in package a.b.c, use "a.b.c.*" From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 2:38 AM To: cob...@li...; John W. Lewis Subject: RE: Uses of Cobertura-instrument task But if I want to exclude some file and folder with specific name then I have to include them in excludeClasses? Like: <excludeClasses regex="*.*Test*" /> <excludeClasses regex="*.contrib.*" /> <excludeClasses regex="*.ImsMessageIds*" /> <excludeClasses regex="*Mock*" /> <excludeClasses regex="PackageTestSuite*" /> <excludeClasses regex="*Base64*" /> <excludeClasses regex="*TransformerUI*" /> But when I am using this I am getting the error like: [cobertura-instrument] WARN addRegex, The regular expression *.*Test* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.contrib.* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.ImsMessageIds is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Mock* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Base64* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *TransformerUI* is invalid: ?+* follows nothing in expression Same rule is working fine in Emma Code coverage. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si...<mailto:ash...@si...> www.siemens.co.in<BLOCKED::http://www.siemens.co.in> ________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 1:20 AM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task You will probably want to use something more like (from http://cobertura.sourceforge.net/anttaskreference.html): <cobertura-instrument todir="${instrumented.dir}"> <includeClasses regex=".*" /> <excludeClasses regex=".*\.Test.*" /> <instrumentationClasspath> <path refid="test.classpath" /> <pathelement location="${test.build}" /> </instrumentationClasspath> </cobertura-instrument> The regular expressions would be ".*Test.*", ".*\.contrib\..*", etc. John From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Wednesday, June 02, 2010 4:47 AM To: cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: [Cobertura-devel] Uses of Cobertura-instrument task Hello All, Can please help me for following scenario: I want to do the Cobertura instrumentation on more than 1 jar and one gen\classes folder but I want to do for some specific package. Like: <!--include/exclude package pattern set --> <patternset id="filter.instrument"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> </patternset> <cobertura-instrument todir="${dir.build}/cobertura.ser"> <fileset dir="${ dir.build.jars}"> <include name="A1.jar" /> <include name="A2.jar" /> <include name="A3.jar" /> <include name="A4.jar" /> <include name="A5.jar" /> <include name="A6.jar" /> <include name="A7.jar" /> <include name="A8.jar" /> <patternset refid="filter.instrument"/> </fileset> <fileset dir="${dir.build.class}"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> <patternset refid="filter.instrument"/> </fileset> </cobertura-instrument> Please help me for the above example is that will work or I have to write it in different way. In Advance Thanks for the help. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si...<mailto:ash...@si...> www.siemens.co.in<BLOCKED::http://www.siemens.co.in> ________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. |
From: John W. L. <Joh...@sa...> - 2010-06-03 17:49:03
|
If you are trying to instrument class files, then it is convenient to use <include> and <exclude> with a <fileset>, but if you are trying to instrument a jar file, it will not work. You have to specify regex's for fully qualified classnames. To exclude any class that has "Test" in it, use ".*Test.*". To exclude any class starts with "contrib", use "contrib.*". To exclude a class called ImsMessageIds, use ".*ImsMessageIds". To exclude all classes in package a.b.c, use "a.b.c.*" From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Thursday, June 03, 2010 2:38 AM To: cob...@li...; John W. Lewis Subject: RE: Uses of Cobertura-instrument task But if I want to exclude some file and folder with specific name then I have to include them in excludeClasses? Like: <excludeClasses regex="*.*Test*" /> <excludeClasses regex="*.contrib.*" /> <excludeClasses regex="*.ImsMessageIds*" /> <excludeClasses regex="*Mock*" /> <excludeClasses regex="PackageTestSuite*" /> <excludeClasses regex="*Base64*" /> <excludeClasses regex="*TransformerUI*" /> But when I am using this I am getting the error like: [cobertura-instrument] WARN addRegex, The regular expression *.*Test* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.contrib.* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *.ImsMessageIds is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Mock* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *Base64* is invalid: ?+* follows nothing in expression [cobertura-instrument] WARN addRegex, The regular expression *TransformerUI* is invalid: ?+* follows nothing in expression Same rule is working fine in Emma Code coverage. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si...<mailto:ash...@si...> www.siemens.co.in<BLOCKED::http://www.siemens.co.in> ________________________________ From: John W. Lewis [mailto:Joh...@sa...] Sent: Thursday, June 03, 2010 1:20 AM To: Soni, Ashish IN BLR SISL; cob...@li... Subject: RE: Uses of Cobertura-instrument task You will probably want to use something more like (from http://cobertura.sourceforge.net/anttaskreference.html): <cobertura-instrument todir="${instrumented.dir}"> <includeClasses regex=".*" /> <excludeClasses regex=".*\.Test.*" /> <instrumentationClasspath> <path refid="test.classpath" /> <pathelement location="${test.build}" /> </instrumentationClasspath> </cobertura-instrument> The regular expressions would be ".*Test.*", ".*\.contrib\..*", etc. John From: Soni, Ashish IN BLR SISL [mailto:ash...@si...] Sent: Wednesday, June 02, 2010 4:47 AM To: cob...@li... Cc: Soni, Ashish IN BLR SISL Subject: [Cobertura-devel] Uses of Cobertura-instrument task Hello All, Can please help me for following scenario: I want to do the Cobertura instrumentation on more than 1 jar and one gen\classes folder but I want to do for some specific package. Like: <!--include/exclude package pattern set --> <patternset id="filter.instrument"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> </patternset> <cobertura-instrument todir="${dir.build}/cobertura.ser"> <fileset dir="${ dir.build.jars}"> <include name="A1.jar" /> <include name="A2.jar" /> <include name="A3.jar" /> <include name="A4.jar" /> <include name="A5.jar" /> <include name="A6.jar" /> <include name="A7.jar" /> <include name="A8.jar" /> <patternset refid="filter.instrument"/> </fileset> <fileset dir="${dir.build.class}"> <include name="org/jaxen/javabean/${package.name}/*"/> <exclude name="*/*Test*" /> <exclude name="*/contrib.*" /> <exclude name="*/ImsMessageIds" /> <exclude name="*Mock*" /> <exclude name="PackageTestSuite*" /> <exclude name="*Base64*" /> <exclude name="*TransformerUI*" /> <patternset refid="filter.instrument"/> </fileset> </cobertura-instrument> Please help me for the above example is that will work or I have to write it in different way. In Advance Thanks for the help. ---------------------------------------------------------------- With best regards, Ashish Soni Siemens Information Systems Ltd. SWP-HC3 No 84, Keonics Electronics City, Hosur Road, Bangalore 560100 Tel.: +91 80 2511 3353 mailto.: ash...@si...<mailto:ash...@si...> www.siemens.co.in<BLOCKED::http://www.siemens.co.in> ________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. ________________________________ Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. |