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: Jake C. <jak...@ga...> - 2010-04-23 16:13:34
|
Alan, You're seeing the default constructor (equivalent to public JPAHelper() {}) that is automatically generated when no constructors exist in the source. Cobertura operates on the byte-code and when a default constructor is generated this way it maps to the class declaration in the source. -Jake On Fri, Apr 23, 2010 at 11:58 AM, Alan Chaney <al...@me...> wrote: > Hi > > I'm new to cobertura, but increasingly impressed with how useful having > an understanding of coverage can be. I'm spending some time > trying to understand some odd cases in my coverage reports where I think > I should have tested everything but I'm still getting some indications > that coverage is not 100% complete. > > My question concerns a simple static class that I have. I've written > some Junit tests for it, and the report shows 100% branch coverage, but > the line coverage shows 7/8 because the class statement line appears in > red. I can't think of any test that I can write that would exercise this > becauset the class has only one method (as below.) > > Why is it failing? What should I do to make it green? Does it matter? > and is there anywhere I find more information about how the coverage > report is generated (apart from reading the source, of course!) I've > read all the referenced articles on the FAQ and Googled for > > Thanks in advance > > Alan > > package com.mycompany.project > > import java.lang.reflect.Field; > > import javax.persistence.ManyToMany; > import javax.persistence.OneToMany; > import javax.persistence.OneToOne; > > public class JPAHelper { <<=== THIS LINE APPEARS IN RED, everything > else is green or gray > /** > * The parent of the field should be an @Entity. It should have > either a OneToOne, > * ManyToOne, or ManyToMany annotation > * @param f > * @return The implementation class > */ > public static Class<?> findImplementationClass(Field f) { > if (f.isAnnotationPresent(OneToMany.class)) { > return f.getAnnotation(OneToMany.class).targetEntity(); > } else if (f.isAnnotationPresent(ManyToMany.class)) { > return f.getAnnotation(ManyToMany.class).targetEntity(); > } else if (f.isAnnotationPresent(OneToOne.class)) { > return f.getAnnotation(OneToOne.class).targetEntity(); > } > return null; > } > } > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > |
From: Alan C. <al...@me...> - 2010-04-23 15:58:41
|
Hi I'm new to cobertura, but increasingly impressed with how useful having an understanding of coverage can be. I'm spending some time trying to understand some odd cases in my coverage reports where I think I should have tested everything but I'm still getting some indications that coverage is not 100% complete. My question concerns a simple static class that I have. I've written some Junit tests for it, and the report shows 100% branch coverage, but the line coverage shows 7/8 because the class statement line appears in red. I can't think of any test that I can write that would exercise this becauset the class has only one method (as below.) Why is it failing? What should I do to make it green? Does it matter? and is there anywhere I find more information about how the coverage report is generated (apart from reading the source, of course!) I've read all the referenced articles on the FAQ and Googled for Thanks in advance Alan package com.mycompany.project import java.lang.reflect.Field; import javax.persistence.ManyToMany; import javax.persistence.OneToMany; import javax.persistence.OneToOne; public class JPAHelper { <<=== THIS LINE APPEARS IN RED, everything else is green or gray /** * The parent of the field should be an @Entity. It should have either a OneToOne, * ManyToOne, or ManyToMany annotation * @param f * @return The implementation class */ public static Class<?> findImplementationClass(Field f) { if (f.isAnnotationPresent(OneToMany.class)) { return f.getAnnotation(OneToMany.class).targetEntity(); } else if (f.isAnnotationPresent(ManyToMany.class)) { return f.getAnnotation(ManyToMany.class).targetEntity(); } else if (f.isAnnotationPresent(OneToOne.class)) { return f.getAnnotation(OneToOne.class).targetEntity(); } return null; } } |
From: Alan C. <al...@me...> - 2010-04-21 18:44:22
|
Never mind - fixed it - classpath issue. Sorry to bother everybody. Alan Alan Chaney wrote: > Hi > > I've just started to use cobertura. I'm using cobertura 1.9.3 to test > some classes which are part of a JPA persistence mechanism. I'm using > hibernate as the entity manager. I've excluded the 'asm' used by > cobertura from the classpath of the junit tests. > > When I use cobertura I'm getting a number of identical failures: > > instrumented-classes/com/mechnicality/libcore/entity/BasicEntity (wrong > name: com/mechnicality/libcore/entity/BasicEntity) > > (The stack trace is at the end) > > These all refer to one abstract class which is annotated with the > @MappedSuperclass annotation > > @MappedSuperclass > public abstract class BasicEntity { > > public static EntityManager em; > protected static final Logger logger = > Logger.getLogger(BasicEntity.class); > > public BasicEntity() {} > > @Id > @GeneratedValue(strategy=GenerationType.AUTO) > private Long id; > > public Long getId(){ > return this.id; > } > > @Temporal(TemporalType.TIMESTAMP) > @Column(name="D_CREATED") > protected Date created; > > public Date getCreated() { > return this.created; > } > > public void setId(Long id) { > this.id = id; > } > } > > Does anyone have any suggestions as to what might be causing this problem? > > Regards > > Alan Chaney > > > > > |java.lang.NoClassDefFoundError: > instrumented-classes/com/mechnicality/libcore/entity/BasicEntity (wrong > name: com/mechnicality/libcore/entity/BasicEntity) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClassCond(Unknown Source) > at java.lang.ClassLoader.defineClass(Unknown Source) > at java.security.SecureClassLoader.defineClass(Unknown Source) > at java.net.URLClassLoader.defineClass(Unknown Source) > at java.net.URLClassLoader.access$000(Unknown Source) > at java.net.URLClassLoader$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Unknown Source) > at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192) > at > org.hibernate.ejb.packaging.NativeScanner.getClassesInJar(NativeScanner.java:136) > at > org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:467) > at > org.hibernate.ejb.Ejb3Configuration.addMetadataFromScan(Ejb3Configuration.java:457) > at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:347) > at > org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55) > at > javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48) > at > javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32) > at > com.mechnicality.libcore.jpa.PersistenceContext.init(PersistenceContext.java:54) > at > com.mechnicality.libcore.jpa.PersistenceContext.init(PersistenceContext.java:29) > at com.mechnicality.libcore.testutil.MyFixture.init(MyFixture.java:62) > > > > > | > > ------------------------------------------------------------------------------ > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > > > !DSPAM:4bcf2f1f226211804284693! > > |
From: Kautz, D. <Don...@ni...> - 2010-04-21 17:01:00
|
Be sure that you delete the merged .ser file from the previous run before merging. The symptoms you describe are slightly different than mine but could be caused by the same issue. The merged .ser file is in the base directory of the ant task. -----Original Message----- From: tte5 [mailto:jt...@em...] Sent: Wednesday, April 21, 2010 3:24 AM To: cob...@li... Subject: [Cobertura-devel] Cobertura in maven multi-module project - problem with merge I have a project with more maven modules and I am using cobertura maven plugin. The reports in single modules are ok. But when I am trying to merge resulting *.ser files and make a single report the results are wrong. When more maven modules have java sources in the same java package the merged report does not show all classes. I am using ant task to merge the *.ser files from the maven modules. Is there something wrong? -- View this message in context: http://old.nabble.com/Cobertura-in-maven-multi-module-project---problem- with-merge-tp28287958p28287958.html Sent from the cobertura-devel mailing list archive at Nabble.com. ------------------------------------------------------------------------ ------ _______________________________________________ Cobertura-devel mailing list Cob...@li... https://lists.sourceforge.net/lists/listinfo/cobertura-devel |
From: Alan C. <al...@me...> - 2010-04-21 16:56:09
|
Hi I've just started to use cobertura. I'm using cobertura 1.9.3 to test some classes which are part of a JPA persistence mechanism. I'm using hibernate as the entity manager. I've excluded the 'asm' used by cobertura from the classpath of the junit tests. When I use cobertura I'm getting a number of identical failures: instrumented-classes/com/mechnicality/libcore/entity/BasicEntity (wrong name: com/mechnicality/libcore/entity/BasicEntity) (The stack trace is at the end) These all refer to one abstract class which is annotated with the @MappedSuperclass annotation @MappedSuperclass public abstract class BasicEntity { public static EntityManager em; protected static final Logger logger = Logger.getLogger(BasicEntity.class); public BasicEntity() {} @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; public Long getId(){ return this.id; } @Temporal(TemporalType.TIMESTAMP) @Column(name="D_CREATED") protected Date created; public Date getCreated() { return this.created; } public void setId(Long id) { this.id = id; } } Does anyone have any suggestions as to what might be causing this problem? Regards Alan Chaney |java.lang.NoClassDefFoundError: instrumented-classes/com/mechnicality/libcore/entity/BasicEntity (wrong name: com/mechnicality/libcore/entity/BasicEntity) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192) at org.hibernate.ejb.packaging.NativeScanner.getClassesInJar(NativeScanner.java:136) at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:467) at org.hibernate.ejb.Ejb3Configuration.addMetadataFromScan(Ejb3Configuration.java:457) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:347) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32) at com.mechnicality.libcore.jpa.PersistenceContext.init(PersistenceContext.java:54) at com.mechnicality.libcore.jpa.PersistenceContext.init(PersistenceContext.java:29) at com.mechnicality.libcore.testutil.MyFixture.init(MyFixture.java:62) | |
From: tte5 <jt...@em...> - 2010-04-21 07:24:34
|
I have a project with more maven modules and I am using cobertura maven plugin. The reports in single modules are ok. But when I am trying to merge resulting *.ser files and make a single report the results are wrong. When more maven modules have java sources in the same java package the merged report does not show all classes. I am using ant task to merge the *.ser files from the maven modules. Is there something wrong? -- View this message in context: http://old.nabble.com/Cobertura-in-maven-multi-module-project---problem-with-merge-tp28287958p28287958.html Sent from the cobertura-devel mailing list archive at Nabble.com. |
From: Kautz, D. <Don...@ni...> - 2010-04-20 13:51:39
|
The detail data seems to have no relation to reality. This occurs all over our code. Below is a simple example. 1. There are not 9 executable lines. 2. It reports 6 covered but only 5 are highlighted. 3. How can line 8 have no hits while line 9 has 57? What gives? Don Kautz Coverage Report - com.spectramarketing.util.NamingConfigNoNamespace Classes in this File Line Coverage <http://zlanadvdevl/reports/Infinet/MavenProjects/cobertura/cobertura-ht ml/help.html> Branch Coverage <http://zlanadvdevl/reports/Infinet/MavenProjects/cobertura/cobertura-ht ml/help.html> Complexity <http://zlanadvdevl/reports/Infinet/MavenProjects/cobertura/cobertura-ht ml/help.html> NamingConfigNoNamespace <http://zlanadvdevl/reports/Infinet/MavenProjects/cobertura/cobertura-ht ml/com.spectramarketing.util.NamingConfigNoNamespace.html> 66% 6/9 N/A <http://zlanadvdevl/reports/Infinet/MavenProjects/cobertura/cobertura-ht ml/help.html> N/A <http://zlanadvdevl/reports/Infinet/MavenProjects/cobertura/cobertura-ht ml/help.html> 1.0;1 1 package com.spectramarketing.util; 2 3 public final class NamingConfigNoNamespace extends NamingConfig 4 { 5 57 6 protected NamingConfigNoNamespace() 7 0 { 8 0 initContextNoNamespace(); 9 57 initAllNameBinding(); 10 0 } 11 12 } Report generated by Cobertura <http://cobertura.sourceforge.net/> 1.9.4.1 on 4/20/10 4:25 AM. Donald Kautz Senior Director of Software Architecture Consumer Insights, Spectra The Nielsen Company 717.239.7837 Nets +259-7837 |
From: Iouri G. <i....@gm...> - 2010-04-12 01:47:39
|
Hello, Right now test report shows executed statements, but is it possible to get the information on which tests actually tested a given class? -- +45° 29' 13.47", -73° 38' 4.98" |
From: Rahul <ra...@gm...> - 2010-04-08 18:03:38
|
Hi Viv, Thats the right plugin and the version. repo url is http://snapshots.repository.codehaus.org/org/codehaus/mojo/cobertura-maven-plugin/2.4-SNAPSHOT/ Cheers, Rahul On Thu, Apr 8, 2010 at 10:05 PM, Viv Kapadekar <vi...@pe...>wrote: > Thanks Rahul. What is the exact version and repo url to specify? I tried > this > > > <plugin> > <groupId>org.codehaus.mojo</groupId> > > <artifactId>cobertura-maven-plugin</artifactId> > <version>2.4-SNAPSHOT</version> > </plugin> > > > and got this error > > Project ID: org.codehaus.mojo:cobertura-maven-plugin > > Reason: POM 'org.codehaus.mojo:cobertura-maven-plugin' not found in > repository: Unable to download the artifact from any repository > > org.codehaus.mojo:cobertura-maven-plugin:pom:2.4-SNAPSHOT > > > --Viv > > On Apr 8, 2010, at 12:36 AM, ra...@gm... wrote: > > Try the snapshot jar. 2.4 version. It works well.. I tried it a few days >> back, and it rocks!!! >> >> Sent from my Nokia phone >> -----Original Message----- >> From: Viv Kapadekar >> Sent: 08/04/2010 12:24:23 >> To: Viv Kapadekar >> Cc: Rahul Jain; cob...@li... >> Subject: Re: [Cobertura-devel] mvn cobertura:cobertua target fails to >> instrument the code >> >> Any update on this? >> >> Thx, >> >> >> >> On Mar 31, 2010, at 10:06 PM, Viv Kapadekar <vi...@pe...> >> wrote: >> >> I have exactly the same issue. >>> >>> Thx, >>> Viv >>> >>> PS:Sent from my mobile. >>> >>> >>> On Mar 31, 2010, at 7:49 PM, Rahul Jain <ra...@gm...> wrote: >>> >>> >>>> Hi, >>>> >>>> When i run the target mvn cobertura:cobertura, i get the following >>>> exception: >>>> >>>> Unable to get lock on >>>> C:\p4\dev\rkm\appliance\maven-projects\appliance-core-ext\target >>>> \cobertura\cobertura.ser.lock: >>>> null >>>> This is known to happen on Linux kernel 2.6.20. >>>> Make sure cobertura.jar is in the root classpath of the jvm >>>> process running the instrumented code. If the instrumented code >>>> is running in a web server, this means cobertura.jar should be in >>>> the web server's lib directory. >>>> Don't put multiple copies of cobertura.jar in different WEB-INF/lib >>>> directories. >>>> Only one classloader should load cobertura. It should be the root >>>> classloader. >>>> --------------------------------------- >>>> lock file could not be deleted >>>> --------------------------------------- >>>> java.lang.reflect.InvocationTargetException >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke >>>> (NativeMethodAccessorImpl.java:39) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke >>>> (DelegatingMethodAccessorImpl.java:25) >>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>> at >>>> net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) >>>> at >>>> >>>> net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData( >>>> ProjectData.java:331) >>>> at >>>> net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java: >>>> 31) >>>> at java.lang.Thread.run(Thread.java:619) >>>> Caused by: java.nio.channels.OverlappingFileLockException >>>> at >>>> sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList >>>> (FileChannelImpl.java:1176) >>>> at >>>> sun.nio.ch.FileChannelImpl$SharedFileLockTable.add >>>> (FileChannelImpl.java:1078) >>>> at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:834) >>>> at java.nio.channels.FileChannel.lock(FileChannel.java:860) >>>> ... 8 more >>>> --------------------------------------- >>>> Unable to get lock on C:\<Path>\target\cobertura >>>> \cobertura.ser.lock: null >>>> This is known to happen on Linux kernel 2.6.20. >>>> Make sure cobertura.jar is in the root classpath of the jvm >>>> process running the instrumented code. If the instrumented code >>>> is running in a web server, this means cobertura.jar should be in >>>> lock file could not be deleted >>>> the web server's lib directory. >>>> Don't put multiple copies of cobertura.jar in different WEB-INF/lib >>>> directories. >>>> Only one classloader should load cobertura. It should be the root >>>> classloader. >>>> >>>> >>>> Fragment from my pom.xml >>>> <!-- --> >>>> <!-- Build Settings --> >>>> <!-- --> >>>> <build> >>>> <!-- --> >>>> <!-- This allows you to just type mvn [-P<profile>] without a >>>> goal --> >>>> <!-- --> >>>> <defaultGoal>install</defaultGoal> >>>> <pluginManagement> >>>> >>>> <plugins> >>>> <!-- --> >>>> <!-- Ensure we compile and generate for JDK 1.6 --> >>>> <!-- --> >>>> <plugin> >>>> <artifactId>maven-compiler-plugin</artifactId> >>>> <configuration> >>>> <showDeprecation>true</showDeprecation> >>>> <showWarnings>true</showWarnings> >>>> <source>1.6</source> >>>> <target>1.6</target> >>>> </configuration> >>>> </plugin> >>>> >>>> <!-- --> >>>> <!-- Eclipse configuration --> >>>> <!-- --> >>>> <plugin> >>>> <groupId>org.apache.maven.plugins</groupId> >>>> <artifactId>maven-eclipse-plugin</artifactId> >>>> <version>2.5.1</version> >>>> <configuration> >>>> <downloadSources>true</downloadSources> >>>> <downloadJavadocs>true</downloadJavadocs> >>>> </configuration> >>>> </plugin> >>>> <!-- Cobertura intergation for code coverage --> >>>> <plugin> >>>> <groupId>org.codehaus.mojo</groupId> >>>> <artifactId>cobertura-maven-plugin</artifactId> >>>> <executions> >>>> <execution> >>>> <goals> >>>> <goal>clean</goal> >>>> </goals> >>>> </execution> >>>> </executions> >>>> </plugin> >>>> </plugins> >>>> </pluginManagement> >>>> >>>> <plugins> >>>> <plugin> >>>> <groupId>org.apache.maven.plugins</groupId> >>>> <artifactId>maven-checkstyle-plugin</artifactId> >>>> </plugin> >>>> <plugin> >>>> <groupId>org.apache.maven.plugins</groupId> >>>> <artifactId>maven-pmd-plugin</artifactId> >>>> </plugin> >>>> </plugins> >>>> </build> >>>> <reporting> >>>> <plugins> >>>> <plugin> >>>> <groupId>org.codehaus.mojo</groupId> >>>> <artifactId>cobertura-maven-plugin</artifactId> >>>> <configuration> >>>> <formats> >>>> <format>html</format> >>>> <format>xml</format> >>>> </formats> >>>> </configuration> >>>> </plugin> >>>> </plugins> >>>> </reporting> >>>> >>>> >>>> >>>> <reporting> >>>> <plugins> >>>> <plugin> >>>> <groupId>org.codehaus.mojo</groupId> >>>> <artifactId>cobertura-maven-plugin</artifactId> >>>> <configuration> >>>> <formats> >>>> <format>html</format> >>>> <format>xml</format> >>>> </formats> >>>> </configuration> >>>> </plugin> >>>> </plugins> >>>> </reporting> >>>> >>>> >>>> I'm using maven 2.2.1 version and rest are default. Java version is >>>> 1.6 >>>> >>>> Please assist on the same. Also any sample pom.xml would be helpful >>>> if the >>>> above configuration is wrong. >>>> >>>> Thanks, >>>> Rahul >>>> -- >>>> View this message in context: >>>> http://old.nabble.com/mvn-cobertura%3Acobertua-target-fails-to-instrument-the-code-tp28074099p28074099.html >>>> Sent from the cobertura-devel mailing list archive at Nabble.com. >>>> >>>> >>>> --- >>>> --- >>>> --- >>>> --------------------------------------------------------------------- >>>> Download Intel® Parallel Studio Eval >>>> Try the new software tools for yourself. Speed compiling, find bugs >>>> proactively, and fine-tune applications for parallel performance. >>>> See why Intel Parallel Studio got high marks during beta. >>>> http://p.sf.net/sfu/intel-sw-dev >>>> _______________________________________________ >>>> Cobertura-devel mailing list >>>> Cob...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cobertura-devel >>>> >>> >> > --------------------------------------------------------------- > > Viv Kapadekar > vi...@pe... > > -- Always Spread smiles! |
From: Viv K. <vi...@pe...> - 2010-04-08 16:35:20
|
Thanks Rahul. What is the exact version and repo url to specify? I tried this <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</ artifactId> <version>2.4-SNAPSHOT</version> </plugin> and got this error Project ID: org.codehaus.mojo:cobertura-maven-plugin Reason: POM 'org.codehaus.mojo:cobertura-maven-plugin' not found in repository: Unable to download the artifact from any repository org.codehaus.mojo:cobertura-maven-plugin:pom:2.4-SNAPSHOT --Viv On Apr 8, 2010, at 12:36 AM, ra...@gm... wrote: > Try the snapshot jar. 2.4 version. It works well.. I tried it a few > days back, and it rocks!!! > > Sent from my Nokia phone > -----Original Message----- > From: Viv Kapadekar > Sent: 08/04/2010 12:24:23 > To: Viv Kapadekar > Cc: Rahul Jain; cob...@li... > Subject: Re: [Cobertura-devel] mvn cobertura:cobertua target fails > to instrument the code > > Any update on this? > > Thx, > > > > On Mar 31, 2010, at 10:06 PM, Viv Kapadekar <vi...@pe...> > wrote: > >> I have exactly the same issue. >> >> Thx, >> Viv >> >> PS:Sent from my mobile. >> >> >> On Mar 31, 2010, at 7:49 PM, Rahul Jain <ra...@gm...> wrote: >> >>> >>> Hi, >>> >>> When i run the target mvn cobertura:cobertura, i get the following >>> exception: >>> >>> Unable to get lock on >>> C:\p4\dev\rkm\appliance\maven-projects\appliance-core-ext\target >>> \cobertura\cobertura.ser.lock: >>> null >>> This is known to happen on Linux kernel 2.6.20. >>> Make sure cobertura.jar is in the root classpath of the jvm >>> process running the instrumented code. If the instrumented code >>> is running in a web server, this means cobertura.jar should be in >>> the web server's lib directory. >>> Don't put multiple copies of cobertura.jar in different WEB-INF/lib >>> directories. >>> Only one classloader should load cobertura. It should be the root >>> classloader. >>> --------------------------------------- >>> lock file could not be deleted >>> --------------------------------------- >>> java.lang.reflect.InvocationTargetException >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke >>> (NativeMethodAccessorImpl.java:39) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke >>> (DelegatingMethodAccessorImpl.java:25) >>> at java.lang.reflect.Method.invoke(Method.java:597) >>> at >>> net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) >>> at >>> net >>> .sourceforge >>> .cobertura.coveragedata.ProjectData.saveGlobalProjectData( >>> ProjectData.java:331) >>> at >>> net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java: >>> 31) >>> at java.lang.Thread.run(Thread.java:619) >>> Caused by: java.nio.channels.OverlappingFileLockException >>> at >>> sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList >>> (FileChannelImpl.java:1176) >>> at >>> sun.nio.ch.FileChannelImpl$SharedFileLockTable.add >>> (FileChannelImpl.java:1078) >>> at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:834) >>> at java.nio.channels.FileChannel.lock(FileChannel.java:860) >>> ... 8 more >>> --------------------------------------- >>> Unable to get lock on C:\<Path>\target\cobertura >>> \cobertura.ser.lock: null >>> This is known to happen on Linux kernel 2.6.20. >>> Make sure cobertura.jar is in the root classpath of the jvm >>> process running the instrumented code. If the instrumented code >>> is running in a web server, this means cobertura.jar should be in >>> lock file could not be deleted >>> the web server's lib directory. >>> Don't put multiple copies of cobertura.jar in different WEB-INF/lib >>> directories. >>> Only one classloader should load cobertura. It should be the root >>> classloader. >>> >>> >>> Fragment from my pom.xml >>> <!-- --> >>> <!-- Build Settings --> >>> <!-- --> >>> <build> >>> <!-- --> >>> <!-- This allows you to just type mvn [-P<profile>] without a >>> goal --> >>> <!-- --> >>> <defaultGoal>install</defaultGoal> >>> <pluginManagement> >>> >>> <plugins> >>> <!-- --> >>> <!-- Ensure we compile and generate for JDK 1.6 --> >>> <!-- --> >>> <plugin> >>> <artifactId>maven-compiler-plugin</artifactId> >>> <configuration> >>> <showDeprecation>true</showDeprecation> >>> <showWarnings>true</showWarnings> >>> <source>1.6</source> >>> <target>1.6</target> >>> </configuration> >>> </plugin> >>> >>> <!-- --> >>> <!-- Eclipse configuration --> >>> <!-- --> >>> <plugin> >>> <groupId>org.apache.maven.plugins</groupId> >>> <artifactId>maven-eclipse-plugin</artifactId> >>> <version>2.5.1</version> >>> <configuration> >>> <downloadSources>true</downloadSources> >>> <downloadJavadocs>true</downloadJavadocs> >>> </configuration> >>> </plugin> >>> <!-- Cobertura intergation for code coverage --> >>> <plugin> >>> <groupId>org.codehaus.mojo</groupId> >>> <artifactId>cobertura-maven-plugin</artifactId> >>> <executions> >>> <execution> >>> <goals> >>> <goal>clean</goal> >>> </goals> >>> </execution> >>> </executions> >>> </plugin> >>> </plugins> >>> </pluginManagement> >>> >>> <plugins> >>> <plugin> >>> <groupId>org.apache.maven.plugins</groupId> >>> <artifactId>maven-checkstyle-plugin</artifactId> >>> </plugin> >>> <plugin> >>> <groupId>org.apache.maven.plugins</groupId> >>> <artifactId>maven-pmd-plugin</artifactId> >>> </plugin> >>> </plugins> >>> </build> >>> <reporting> >>> <plugins> >>> <plugin> >>> <groupId>org.codehaus.mojo</groupId> >>> <artifactId>cobertura-maven-plugin</artifactId> >>> <configuration> >>> <formats> >>> <format>html</format> >>> <format>xml</format> >>> </formats> >>> </configuration> >>> </plugin> >>> </plugins> >>> </reporting> >>> >>> >>> >>> <reporting> >>> <plugins> >>> <plugin> >>> <groupId>org.codehaus.mojo</groupId> >>> <artifactId>cobertura-maven-plugin</artifactId> >>> <configuration> >>> <formats> >>> <format>html</format> >>> <format>xml</format> >>> </formats> >>> </configuration> >>> </plugin> >>> </plugins> >>> </reporting> >>> >>> >>> I'm using maven 2.2.1 version and rest are default. Java version is >>> 1.6 >>> >>> Please assist on the same. Also any sample pom.xml would be helpful >>> if the >>> above configuration is wrong. >>> >>> Thanks, >>> Rahul >>> -- >>> View this message in context: http://old.nabble.com/mvn-cobertura%3Acobertua-target-fails-to-instrument-the-code-tp28074099p28074099.html >>> Sent from the cobertura-devel mailing list archive at Nabble.com. >>> >>> >>> --- >>> --- >>> --- >>> --------------------------------------------------------------------- >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> Cobertura-devel mailing list >>> Cob...@li... >>> https://lists.sourceforge.net/lists/listinfo/cobertura-devel > --------------------------------------------------------------- Viv Kapadekar vi...@pe... |
From: Remijan, M. <Mic...@Su...> - 2010-04-08 15:15:21
|
Has the excludes functionality of the maven plugin been fixed? I tried exluding classes from the reports but no matter what I did the maven plugin did not exclude the classes I specified. I dug through the code a bit but was not able to find anywhere the excludes configuration was even read from the maven plugin config. |
From: <ra...@gm...> - 2010-04-08 07:45:22
|
Try the snapshot jar. 2.4 version. It works well.. I tried it a few days back, and it rocks!!! Sent from my Nokia phone -----Original Message----- From: Viv Kapadekar Sent: 08/04/2010 12:24:23 To: Viv Kapadekar Cc: Rahul Jain; cob...@li... Subject: Re: [Cobertura-devel] mvn cobertura:cobertua target fails to instrument the code Any update on this? Thx, On Mar 31, 2010, at 10:06 PM, Viv Kapadekar <vi...@pe...> wrote: > I have exactly the same issue. > > Thx, > Viv > > PS:Sent from my mobile. > > > On Mar 31, 2010, at 7:49 PM, Rahul Jain <ra...@gm...> wrote: > >> >> Hi, >> >> When i run the target mvn cobertura:cobertura, i get the following >> exception: >> >> Unable to get lock on >> C:\p4\dev\rkm\appliance\maven-projects\appliance-core-ext\target >> \cobertura\cobertura.ser.lock: >> null >> This is known to happen on Linux kernel 2.6.20. >> Make sure cobertura.jar is in the root classpath of the jvm >> process running the instrumented code. If the instrumented code >> is running in a web server, this means cobertura.jar should be in >> the web server's lib directory. >> Don't put multiple copies of cobertura.jar in different WEB-INF/lib >> directories. >> Only one classloader should load cobertura. It should be the root >> classloader. >> --------------------------------------- >> lock file could not be deleted >> --------------------------------------- >> java.lang.reflect.InvocationTargetException >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke >> (NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke >> (DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) >> at >> net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData( >> ProjectData.java:331) >> at >> net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java: >> 31) >> at java.lang.Thread.run(Thread.java:619) >> Caused by: java.nio.channels.OverlappingFileLockException >> at >> sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList >> (FileChannelImpl.java:1176) >> at >> sun.nio.ch.FileChannelImpl$SharedFileLockTable.add >> (FileChannelImpl.java:1078) >> at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:834) >> at java.nio.channels.FileChannel.lock(FileChannel.java:860) >> ... 8 more >> --------------------------------------- >> Unable to get lock on C:\<Path>\target\cobertura >> \cobertura.ser.lock: null >> This is known to happen on Linux kernel 2.6.20. >> Make sure cobertura.jar is in the root classpath of the jvm >> process running the instrumented code. If the instrumented code >> is running in a web server, this means cobertura.jar should be in >> lock file could not be deleted >> the web server's lib directory. >> Don't put multiple copies of cobertura.jar in different WEB-INF/lib >> directories. >> Only one classloader should load cobertura. It should be the root >> classloader. >> >> >> Fragment from my pom.xml >> <!-- --> >> <!-- Build Settings --> >> <!-- --> >> <build> >> <!-- --> >> <!-- This allows you to just type mvn [-P<profile>] without a >> goal --> >> <!-- --> >> <defaultGoal>install</defaultGoal> >> <pluginManagement> >> >> <plugins> >> <!-- --> >> <!-- Ensure we compile and generate for JDK 1.6 --> >> <!-- --> >> <plugin> >> <artifactId>maven-compiler-plugin</artifactId> >> <configuration> >> <showDeprecation>true</showDeprecation> >> <showWarnings>true</showWarnings> >> <source>1.6</source> >> <target>1.6</target> >> </configuration> >> </plugin> >> >> <!-- --> >> <!-- Eclipse configuration --> >> <!-- --> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-eclipse-plugin</artifactId> >> <version>2.5.1</version> >> <configuration> >> <downloadSources>true</downloadSources> >> <downloadJavadocs>true</downloadJavadocs> >> </configuration> >> </plugin> >> <!-- Cobertura intergation for code coverage --> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>cobertura-maven-plugin</artifactId> >> <executions> >> <execution> >> <goals> >> <goal>clean</goal> >> </goals> >> </execution> >> </executions> >> </plugin> >> </plugins> >> </pluginManagement> >> >> <plugins> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-checkstyle-plugin</artifactId> >> </plugin> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-pmd-plugin</artifactId> >> </plugin> >> </plugins> >> </build> >> <reporting> >> <plugins> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>cobertura-maven-plugin</artifactId> >> <configuration> >> <formats> >> <format>html</format> >> <format>xml</format> >> </formats> >> </configuration> >> </plugin> >> </plugins> >> </reporting> >> >> >> >> <reporting> >> <plugins> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>cobertura-maven-plugin</artifactId> >> <configuration> >> <formats> >> <format>html</format> >> <format>xml</format> >> </formats> >> </configuration> >> </plugin> >> </plugins> >> </reporting> >> >> >> I'm using maven 2.2.1 version and rest are default. Java version is >> 1.6 >> >> Please assist on the same. Also any sample pom.xml would be helpful >> if the >> above configuration is wrong. >> >> Thanks, >> Rahul >> -- >> View this message in context: http://old.nabble.com/mvn-cobertura%3Acobertua-target-fails-to-instrument-the-code-tp28074099p28074099.html >> Sent from the cobertura-devel mailing list archive at Nabble.com. >> >> >> --- >> --- >> --- >> --------------------------------------------------------------------- >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Cobertura-devel mailing list >> Cob...@li... >> https://lists.sourceforge.net/lists/listinfo/cobertura-devel |
From: Viv K. <vi...@pe...> - 2010-04-08 06:54:47
|
Any update on this? Thx, On Mar 31, 2010, at 10:06 PM, Viv Kapadekar <vi...@pe...> wrote: > I have exactly the same issue. > > Thx, > Viv > > PS:Sent from my mobile. > > > On Mar 31, 2010, at 7:49 PM, Rahul Jain <ra...@gm...> wrote: > >> >> Hi, >> >> When i run the target mvn cobertura:cobertura, i get the following >> exception: >> >> Unable to get lock on >> C:\p4\dev\rkm\appliance\maven-projects\appliance-core-ext\target >> \cobertura\cobertura.ser.lock: >> null >> This is known to happen on Linux kernel 2.6.20. >> Make sure cobertura.jar is in the root classpath of the jvm >> process running the instrumented code. If the instrumented code >> is running in a web server, this means cobertura.jar should be in >> the web server's lib directory. >> Don't put multiple copies of cobertura.jar in different WEB-INF/lib >> directories. >> Only one classloader should load cobertura. It should be the root >> classloader. >> --------------------------------------- >> lock file could not be deleted >> --------------------------------------- >> java.lang.reflect.InvocationTargetException >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke >> (NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke >> (DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) >> at >> net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData( >> ProjectData.java:331) >> at >> net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java: >> 31) >> at java.lang.Thread.run(Thread.java:619) >> Caused by: java.nio.channels.OverlappingFileLockException >> at >> sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList >> (FileChannelImpl.java:1176) >> at >> sun.nio.ch.FileChannelImpl$SharedFileLockTable.add >> (FileChannelImpl.java:1078) >> at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:834) >> at java.nio.channels.FileChannel.lock(FileChannel.java:860) >> ... 8 more >> --------------------------------------- >> Unable to get lock on C:\<Path>\target\cobertura >> \cobertura.ser.lock: null >> This is known to happen on Linux kernel 2.6.20. >> Make sure cobertura.jar is in the root classpath of the jvm >> process running the instrumented code. If the instrumented code >> is running in a web server, this means cobertura.jar should be in >> lock file could not be deleted >> the web server's lib directory. >> Don't put multiple copies of cobertura.jar in different WEB-INF/lib >> directories. >> Only one classloader should load cobertura. It should be the root >> classloader. >> >> >> Fragment from my pom.xml >> <!-- --> >> <!-- Build Settings --> >> <!-- --> >> <build> >> <!-- --> >> <!-- This allows you to just type mvn [-P<profile>] without a >> goal --> >> <!-- --> >> <defaultGoal>install</defaultGoal> >> <pluginManagement> >> >> <plugins> >> <!-- --> >> <!-- Ensure we compile and generate for JDK 1.6 --> >> <!-- --> >> <plugin> >> <artifactId>maven-compiler-plugin</artifactId> >> <configuration> >> <showDeprecation>true</showDeprecation> >> <showWarnings>true</showWarnings> >> <source>1.6</source> >> <target>1.6</target> >> </configuration> >> </plugin> >> >> <!-- --> >> <!-- Eclipse configuration --> >> <!-- --> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-eclipse-plugin</artifactId> >> <version>2.5.1</version> >> <configuration> >> <downloadSources>true</downloadSources> >> <downloadJavadocs>true</downloadJavadocs> >> </configuration> >> </plugin> >> <!-- Cobertura intergation for code coverage --> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>cobertura-maven-plugin</artifactId> >> <executions> >> <execution> >> <goals> >> <goal>clean</goal> >> </goals> >> </execution> >> </executions> >> </plugin> >> </plugins> >> </pluginManagement> >> >> <plugins> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-checkstyle-plugin</artifactId> >> </plugin> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-pmd-plugin</artifactId> >> </plugin> >> </plugins> >> </build> >> <reporting> >> <plugins> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>cobertura-maven-plugin</artifactId> >> <configuration> >> <formats> >> <format>html</format> >> <format>xml</format> >> </formats> >> </configuration> >> </plugin> >> </plugins> >> </reporting> >> >> >> >> <reporting> >> <plugins> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>cobertura-maven-plugin</artifactId> >> <configuration> >> <formats> >> <format>html</format> >> <format>xml</format> >> </formats> >> </configuration> >> </plugin> >> </plugins> >> </reporting> >> >> >> I'm using maven 2.2.1 version and rest are default. Java version is >> 1.6 >> >> Please assist on the same. Also any sample pom.xml would be helpful >> if the >> above configuration is wrong. >> >> Thanks, >> Rahul >> -- >> View this message in context: http://old.nabble.com/mvn-cobertura%3Acobertua-target-fails-to-instrument-the-code-tp28074099p28074099.html >> Sent from the cobertura-devel mailing list archive at Nabble.com. >> >> >> --- >> --- >> --- >> --------------------------------------------------------------------- >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Cobertura-devel mailing list >> Cob...@li... >> https://lists.sourceforge.net/lists/listinfo/cobertura-devel |
From: <dun...@bt...> - 2010-04-06 10:27:32
|
The use of junit is no particularly relevant. The steps are the same however you run your code. The steps are (1) Instrument your classes under test with cobertura; (2) Execute the tests as before but adding cobertura.jar to the BEGINNING of the classpath; (3) Generate a coverage report. Step (1) will create a file called "cobertura.ser" containing information about what statements exist in your classes. Step (2) will update the same file with data about which parts were run. Step (3) will use the file to create a coverage report which looks like javadoc but with a source listing annotated with counts of times each line was executed etc. You can do steps 1, 2 and 3 using command line utilities http://cobertura.sourceforge.net/commandlinereference.html or using ant tasks http://cobertura.sourceforge.net/anttaskreference.html. Cobertura is an exceptionally good tool and it is well worth persevering with this. Duncan. ________________________________ From: Visalatchi Muthuraman [mailto:vmu...@oa...] Sent: 05 April 2010 14:41 To: cob...@li... Subject: [Cobertura-devel] Query Hello, I am a Master's student and I am using Cobertura for a project. My project is to find the source code coverage for a java source code and the junit test has to be executed for finding the coverage. I am not clear on the steps for finding the coverage using junit on cobertura. Any points on this issue would be of great help. My email address is: vmu...@oa.... Thanks. |
From: Visalatchi M. <vmu...@oa...> - 2010-04-05 14:08:57
|
Hello, I am a Master's student and I am using Cobertura for a project. My project is to find the source code coverage for a java source code and the junit test has to be executed for finding the coverage. I am not clear on the steps for finding the coverage using junit on cobertura. Any points on this issue would be of great help. My email address is: vmu...@oa.... Thanks. |
From: Viv K. <vi...@pe...> - 2010-04-01 05:07:36
|
I have exactly the same issue. Thx, Viv PS:Sent from my mobile. On Mar 31, 2010, at 7:49 PM, Rahul Jain <ra...@gm...> wrote: > > Hi, > > When i run the target mvn cobertura:cobertura, i get the following > exception: > > Unable to get lock on > C:\p4\dev\rkm\appliance\maven-projects\appliance-core-ext\target > \cobertura\cobertura.ser.lock: > null > This is known to happen on Linux kernel 2.6.20. > Make sure cobertura.jar is in the root classpath of the jvm > process running the instrumented code. If the instrumented code > is running in a web server, this means cobertura.jar should be in > the web server's lib directory. > Don't put multiple copies of cobertura.jar in different WEB-INF/lib > directories. > Only one classloader should load cobertura. It should be the root > classloader. > --------------------------------------- > lock file could not be deleted > --------------------------------------- > java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) > at > net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData( > ProjectData.java:331) > at > net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java: > 31) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.nio.channels.OverlappingFileLockException > at > sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList > (FileChannelImpl.java:1176) > at > sun.nio.ch.FileChannelImpl$SharedFileLockTable.add > (FileChannelImpl.java:1078) > at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:834) > at java.nio.channels.FileChannel.lock(FileChannel.java:860) > ... 8 more > --------------------------------------- > Unable to get lock on C:\<Path>\target\cobertura\cobertura.ser.lock: > null > This is known to happen on Linux kernel 2.6.20. > Make sure cobertura.jar is in the root classpath of the jvm > process running the instrumented code. If the instrumented code > is running in a web server, this means cobertura.jar should be in > lock file could not be deleted > the web server's lib directory. > Don't put multiple copies of cobertura.jar in different WEB-INF/lib > directories. > Only one classloader should load cobertura. It should be the root > classloader. > > > Fragment from my pom.xml > <!-- --> > <!-- Build Settings --> > <!-- --> > <build> > <!-- --> > <!-- This allows you to just type mvn [-P<profile>] without a > goal --> > <!-- --> > <defaultGoal>install</defaultGoal> > <pluginManagement> > > <plugins> > <!-- --> > <!-- Ensure we compile and generate for JDK 1.6 --> > <!-- --> > <plugin> > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > <showDeprecation>true</showDeprecation> > <showWarnings>true</showWarnings> > <source>1.6</source> > <target>1.6</target> > </configuration> > </plugin> > > <!-- --> > <!-- Eclipse configuration --> > <!-- --> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-eclipse-plugin</artifactId> > <version>2.5.1</version> > <configuration> > <downloadSources>true</downloadSources> > <downloadJavadocs>true</downloadJavadocs> > </configuration> > </plugin> > <!-- Cobertura intergation for code coverage --> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>cobertura-maven-plugin</artifactId> > <executions> > <execution> > <goals> > <goal>clean</goal> > </goals> > </execution> > </executions> > </plugin> > </plugins> > </pluginManagement> > > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-checkstyle-plugin</artifactId> > </plugin> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-pmd-plugin</artifactId> > </plugin> > </plugins> > </build> > <reporting> > <plugins> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>cobertura-maven-plugin</artifactId> > <configuration> > <formats> > <format>html</format> > <format>xml</format> > </formats> > </configuration> > </plugin> > </plugins> > </reporting> > > > > <reporting> > <plugins> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>cobertura-maven-plugin</artifactId> > <configuration> > <formats> > <format>html</format> > <format>xml</format> > </formats> > </configuration> > </plugin> > </plugins> > </reporting> > > > I'm using maven 2.2.1 version and rest are default. Java version is > 1.6 > > Please assist on the same. Also any sample pom.xml would be helpful > if the > above configuration is wrong. > > Thanks, > Rahul > -- > View this message in context: http://old.nabble.com/mvn-cobertura%3Acobertua-target-fails-to-instrument-the-code-tp28074099p28074099.html > Sent from the cobertura-devel mailing list archive at Nabble.com. > > > --- > --- > --- > --------------------------------------------------------------------- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel |
From: Rahul J. <ra...@gm...> - 2010-04-01 02:49:15
|
Hi, When i run the target mvn cobertura:cobertura, i get the following exception: Unable to get lock on C:\p4\dev\rkm\appliance\maven-projects\appliance-core-ext\target\cobertura\cobertura.ser.lock: null This is known to happen on Linux kernel 2.6.20. Make sure cobertura.jar is in the root classpath of the jvm process running the instrumented code. If the instrumented code is running in a web server, this means cobertura.jar should be in the web server's lib directory. Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories. Only one classloader should load cobertura. It should be the root classloader. --------------------------------------- lock file could not be deleted --------------------------------------- java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:331) at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:31) at java.lang.Thread.run(Thread.java:619) Caused by: java.nio.channels.OverlappingFileLockException at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1176) at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1078) at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:834) at java.nio.channels.FileChannel.lock(FileChannel.java:860) ... 8 more --------------------------------------- Unable to get lock on C:\<Path>\target\cobertura\cobertura.ser.lock: null This is known to happen on Linux kernel 2.6.20. Make sure cobertura.jar is in the root classpath of the jvm process running the instrumented code. If the instrumented code is running in a web server, this means cobertura.jar should be in lock file could not be deleted the web server's lib directory. Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories. Only one classloader should load cobertura. It should be the root classloader. Fragment from my pom.xml <!-- --> <!-- Build Settings --> <!-- --> <build> <!-- --> <!-- This allows you to just type mvn [-P<profile>] without a goal --> <!-- --> <defaultGoal>install</defaultGoal> <pluginManagement> <plugins> <!-- --> <!-- Ensure we compile and generate for JDK 1.6 --> <!-- --> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <showDeprecation>true</showDeprecation> <showWarnings>true</showWarnings> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- --> <!-- Eclipse configuration --> <!-- --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.5.1</version> <configuration> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </configuration> </plugin> <!-- Cobertura intergation for code coverage --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <executions> <execution> <goals> <goal>clean</goal> </goals> </execution> </executions> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> </plugin> </plugins> </reporting> <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> </plugin> </plugins> </reporting> I'm using maven 2.2.1 version and rest are default. Java version is 1.6 Please assist on the same. Also any sample pom.xml would be helpful if the above configuration is wrong. Thanks, Rahul -- View this message in context: http://old.nabble.com/mvn-cobertura%3Acobertua-target-fails-to-instrument-the-code-tp28074099p28074099.html Sent from the cobertura-devel mailing list archive at Nabble.com. |
From: Viv K. <vi...@pe...> - 2010-03-30 22:37:30
|
Hi This is how my pom.xml is <reporting> : <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.3</version> </plugin> </plugins> </reporting> and <builds> : <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.3</version> </plugin> </plugins> </build> I am facing two issues 1) If I run mvn cobertura:cobertura for the first time, the resulting report shows 0 % everywhere. If I run it for the second time, then it should correct non-zero values for coverage 2) When I run from parent pom, for the last module it throws this error below ( Although if I run it individually for that module, it works fine) Unable to get lock on /Users/homedir/workspace/trunk/GreenXServer/ restful/target/cobertura/cobertura.ser.lock: null This is known to happen on Linux kernel 2.6.20. Make sure cobertura.jar is in the root classpath of the jvm process running the instrumented code. If the instrumented code is running in a web server, this means cobertura.jar should be in the web server's lib directory. Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories. Only one classloader should load cobertura. It should be the root classloader. --------------------------------------- --------------------------------------- java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun .reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod --------------------------------------------------------------- Thanks Viv vi...@pe... |
From: Rahul <ra...@gm...> - 2010-03-29 19:39:50
|
Hi, When i run the target mvn cobertura:cobertura, i get the following exception: Unable to get lock on C:\p4\dev\rkm\appliance\maven-projects\appliance-core-ext\target\cobertura\cobertura.ser.lock: null This is known to happen on Linux kernel 2.6.20. Make sure cobertura.jar is in the root classpath of the jvm process running the instrumented code. If the instrumented code is running in a web server, this means cobertura.jar should be in the web server's lib directory. Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories. Only one classloader should load cobertura. It should be the root classloader. --------------------------------------- lock file could not be deleted --------------------------------------- java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:331) at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:31) at java.lang.Thread.run(Thread.java:619) Caused by: java.nio.channels.OverlappingFileLockException at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1176) at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1078) at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:834) at java.nio.channels.FileChannel.lock(FileChannel.java:860) ... 8 more --------------------------------------- Unable to get lock on C:\<Path>\target\cobertura\cobertura.ser.lock: null This is known to happen on Linux kernel 2.6.20. Make sure cobertura.jar is in the root classpath of the jvm process running the instrumented code. If the instrumented code is running in a web server, this means cobertura.jar should be in lock file could not be deleted the web server's lib directory. Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories. Only one classloader should load cobertura. It should be the root classloader. <b>Fragment from my pom.xml</b> <!-- --> <!-- Build Settings --> <!-- --> <build> <!-- --> <!-- This allows you to just type mvn [-P<profile>] without a goal --> <!-- --> <defaultGoal>install</defaultGoal> <pluginManagement> <plugins> <!-- --> <!-- Ensure we compile and generate for JDK 1.6 --> <!-- --> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <showDeprecation>true</showDeprecation> <showWarnings>true</showWarnings> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- --> <!-- Eclipse configuration --> <!-- --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.5.1</version> <configuration> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </configuration> </plugin> <!-- Cobertura intergation for code coverage --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <executions> <execution> <goals> <goal>clean</goal> </goals> </execution> </executions> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> </plugin> </plugins> </reporting> <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> </plugin> </plugins> </reporting> I'm using maven 2.2.1 version and rest are default. Java version is 1.6 Please assist on the same. Also any sample pom.xml would be helpful if the above configuration is wrong. Thanks, Rahul |
From: boardtc <bo...@gm...> - 2010-03-25 23:57:26
|
If I comment out the lines: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "file:src/test/resources/test-applicationContext.xml") before my test and run the tests via mvn cobertura:cobertura at the command line they run fine, so I am trying to figure out how Cobertura run my JUnit tests? Without these annotations, how does it know which ones are tests and to inject datasource (details in test-applicationContext.xml) To run my tests within Eclipse they fail without the @RunWith & @ContextConfiguration before each test. My pom read: <plugin> <groupId>org.codehaus.mojo</groupId><artifactId>cobertura-maven-plugin</artifactId><version>2.3</version> <configuration> <instrumentation> </instrumentation> <check> <branchRate>85</branchRate> <lineRate>85</lineRate> <haltOnFailure>true</haltOnFailure> <totalBranchRate>85</totalBranchRate> <totalLineRate>85</totalLineRate> <packageLineRate>85</packageLineRate> <packageBranchRate>85</packageBranchRate> <regexes> <regex> </regex> </regexes> </check> </configuration> <executions> <execution> <goals> <goal>clean</goal> <goal>check</goal> </goals> </execution> </executions> </plugin> |
From: Tamás K. <ken...@gm...> - 2010-03-22 10:03:35
|
Hi, Thank you for you answer! I'm afraid it won't help. I've never used Jikes, and I could not find how to set up the jsp sources, and I think it wont generate a new web xml like jspc-maven-plugin does. (It creates servlet from jsp) I need these to start up the application in jetty, and run integration tests against it... I will try to use jetty-jspc-maven-plugin, I hope you are are right and another compiler will solve the issue. Thanks!! Tamas Hi, > > I don?t have an explanation, but I do have a workaround that worked for me. > Basically the idea it to try another compiler. I set tomcat to use Jikes to > compile JSP files and it worked perfectly (as far as I can tell). In > Tomcat6 I set that in "/etc/default/tomcat" file. No idea for other > versions. > > I actually had much worse problem when using the stardard tomcat compiler. > In my case, the instrumentation failed miserably, with several > NullPointExceptions and at a certain point a jvm segmentation fault during > instrumentation. But jikes just worked. > > I hope I could help. > > Best regards, > Afonso Araujo Neto > > > > > 2010/3/18 Tam?s Kende <ken...@gm...> > > > Hi all! > > > > I hope someone can help me. I tried to get jsp coverage report. I > could > > instrument the precompiled jsp, but I have an issue in the report. When I > > load the package report everything seems fine, I see the index_jsp, > > info_jsp... classes in it with valid coverage... But when I want to load > the > > class report, I can only see one class (it generates all, but overwrites > the > > file), what it calls jsp.jsp (jsp package, jsp class) > > > > I've found out, that the problem is somewhere during the > > instrumentation. The jspc generates the jsp classes with the following > > pattern: jspname_jsp.class (and java) and during the report cobertura > > searches them as: jsp.jspname (without class or java, only the > > packagename.classname), I debugged into it but it's clear without > debugging, > > during the reporting it founds the jspname as a extension (it looks for > the > > last dot) and the jsp as the classname (that's why the overwrite)... So I > > tried to found out, why is the extension missing. I've looked into the > ser > > file (what I don't really understand) but I found one thing. The normal > > classes has a reference in it as: FooBarServlet*.java*xq (and > > .FooBarServletsq, com.package.proto.recover.FooBarServlett) but the jsp > > classes have: .index_jspsq, .jsp.index_jspt, .jsp.index_jspt. (no .java ) > or > > the other one has: info_jspsr, jsp.info_jspt, jsp.info_jspt and the last > > one: cbflush_jspsq, jsp.cbflush_jspt, jsp.cbflush_jspxq > > I cant really find exactly where and why the application does these > > things. Does someone has any idea? > > > > Thank you for your help > > > > Regards > > Tamas |
From: Afonso A. N. <afo...@gm...> - 2010-03-18 16:52:47
|
Hi, I don´t have an explanation, but I do have a workaround that worked for me. Basically the idea it to try another compiler. I set tomcat to use Jikes to compile JSP files and it worked perfectly (as far as I can tell). In Tomcat6 I set that in "/etc/default/tomcat" file. No idea for other versions. I actually had much worse problem when using the stardard tomcat compiler. In my case, the instrumentation failed miserably, with several NullPointExceptions and at a certain point a jvm segmentation fault during instrumentation. But jikes just worked. I hope I could help. Best regards, Afonso Araujo Neto 2010/3/18 Tamás Kende <ken...@gm...> > Hi all! > > I hope someone can help me. I tried to get jsp coverage report. I could > instrument the precompiled jsp, but I have an issue in the report. When I > load the package report everything seems fine, I see the index_jsp, > info_jsp... classes in it with valid coverage... But when I want to load the > class report, I can only see one class (it generates all, but overwrites the > file), what it calls jsp.jsp (jsp package, jsp class) > > I've found out, that the problem is somewhere during the > instrumentation. The jspc generates the jsp classes with the following > pattern: jspname_jsp.class (and java) and during the report cobertura > searches them as: jsp.jspname (without class or java, only the > packagename.classname), I debugged into it but it's clear without debugging, > during the reporting it founds the jspname as a extension (it looks for the > last dot) and the jsp as the classname (that's why the overwrite)... So I > tried to found out, why is the extension missing. I've looked into the ser > file (what I don't really understand) but I found one thing. The normal > classes has a reference in it as: FooBarServlet*.java*xq (and > .FooBarServletsq, com.package.proto.recover.FooBarServlett) but the jsp > classes have: .index_jspsq, .jsp.index_jspt, .jsp.index_jspt. (no .java ) or > the other one has: info_jspsr, jsp.info_jspt, jsp.info_jspt and the last > one: cbflush_jspsq, jsp.cbflush_jspt, jsp.cbflush_jspxq > I cant really find exactly where and why the application does these > things. Does someone has any idea? > > Thank you for your help > > Regards > Tamas > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > > |
From: Tamás K. <ken...@gm...> - 2010-03-18 13:03:32
|
Hi all! I hope someone can help me. I tried to get jsp coverage report. I could instrument the precompiled jsp, but I have an issue in the report. When I load the package report everything seems fine, I see the index_jsp, info_jsp... classes in it with valid coverage... But when I want to load the class report, I can only see one class (it generates all, but overwrites the file), what it calls jsp.jsp (jsp package, jsp class) I've found out, that the problem is somewhere during the instrumentation. The jspc generates the jsp classes with the following pattern: jspname_jsp.class (and java) and during the report cobertura searches them as: jsp.jspname (without class or java, only the packagename.classname), I debugged into it but it's clear without debugging, during the reporting it founds the jspname as a extension (it looks for the last dot) and the jsp as the classname (that's why the overwrite)... So I tried to found out, why is the extension missing. I've looked into the ser file (what I don't really understand) but I found one thing. The normal classes has a reference in it as: FooBarServlet*.java*xq (and .FooBarServletsq, com.package.proto.recover.FooBarServlett) but the jsp classes have: .index_jspsq, .jsp.index_jspt, .jsp.index_jspt. (no .java ) or the other one has: info_jspsr, jsp.info_jspt, jsp.info_jspt and the last one: cbflush_jspsq, jsp.cbflush_jspt, jsp.cbflush_jspxq I cant really find exactly where and why the application does these things. Does someone has any idea? Thank you for your help Regards Tamas |
From: Christian J. <chr...@bw...> - 2010-03-17 14:27:03
|
Thanks, I just observed the little "M" I missed in the maxmemory attribute. Br Christian On 17 mar 2010, at 13.59, John W. Lewis wrote: > > Try setting maxmemory. > > http://cobertura.sourceforge.net/anttaskreference.html > > > -----Original Message----- > From: Christian Jendeberg [mailto:chr...@bw...] > Sent: Wednesday, March 17, 2010 5:06 AM > To: cob...@li... > Subject: [Cobertura-devel] cobertura-report bails out with java.lang.OutOfMemoryError > > Hi > I'm having trouble generating HTML reports with the Ant task cobertura-report with Ant 1.8.0, JDK 1.6.0_17 and Cobertura-1.9.4.1 (also tried 1.9.3) > > My code looks like this > > <macrodef name="m_cobertura-init"> > <sequential> > <taskdef resource="tasks.properties" classpathref="buildenv.lib.classpath" /> > </sequential> > </macrodef> > > <macrodef name="m_cobertura-report" description="Uses properties: src.java.dir, build.dir, coverage.report.dir."> > <attribute name="cobertura.format" default="${cobertura.format}" /> > <attribute name="cobertura.datafile" default="${cobertura.datafile}" /> > <attribute name="cobertura.destdir" default="${cobertura.destdir}" /> > <attribute name="cobertura.maxmemory" default="128" /> > <attribute name="cobertura.srcdir" default="${cobertura.srcdir}" /> > > <sequential> > <taskdef resource="tasks.properties" classpathref="buildenv.lib.classpath" /> > <mkdir dir="@{cobertura.destdir}" /> > <echo message="Generating Cobertura report using datafile @{cobertura.datafile}, todir=@{cobertura.destdir}." /> > <cobertura-report format="@{cobertura.format}" datafile="@{cobertura.datafile}" destdir="@{cobertura.destdir}" maxmemory="@{cobertura.maxmemory}" srcdir="@{cobertura.srcdir}" /> > </sequential> > </macrodef> > > > <target name="foobar" description=""> > <m_cobertura-init /> > <m_cobertura-report /> > </target> > > When I run the foobar target I get the following result... > > $ time ant foobar > Buildfile: /Users/me/Desktop/Archive/build.xml > > foobar: > [echo] Generating Cobertura report using datafile /Users/me/Desktop/Archive/_BUILD/cobertura.ser, todir=/Users/me/Desktop/Archive/_DIST/reports/coverage/cobertura. > [cobertura-report] The jvmargs attribute is deprecated. Please use nested jvmarg elements. > [cobertura-report] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file > [cobertura-report] Cobertura: Loaded information on 622 classes. > [cobertura-report] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space > [cobertura-report] at java.util.Arrays.copyOfRange(Arrays.java:3209) > [cobertura-report] at java.lang.String.<init>(String.java:215) > [cobertura-report] at java.lang.StringBuffer.toString(StringBuffer.java:585) > [cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateHtmlizedJavaSource(HTMLReport.java:638) > [cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateSourceFile(HTMLReport.java:501) > [cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateSourceFiles(HTMLReport.java:434) > [cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.<init>(HTMLReport.java:97) > [cobertura-report] at net.sourceforge.cobertura.reporting.Main.parseArguments(Main.java:105) > [cobertura-report] at net.sourceforge.cobertura.reporting.Main.main(Main.java:174) > > BUILD FAILED > /Users/me/Desktop/Archive/build.xml:148: The following error occurred while executing this line: > /Users/me/Desktop/Archive/_BUILDENV/cobuto/macros/cobertura.xml:52: Error running reports. See messages above. > > Total time: 16 seconds > > real 0m17.064s > user 0m21.720s > sys 0m0.879s > > > Changing the report generation to XML format like this > > <target name="foobar" description=""> > <m_cobertura-init /> > <m_cobertura-report cobertura.format="xml" /> > </target> > > yields the following result > > $ time ant foobar > Buildfile: /Users/me/Desktop/Archive/build.xml > > foobar: > [echo] Generating Cobertura report using datafile /Users/me/Desktop/Archive/_BUILD/cobertura.ser, todir=/Users/me/Desktop/Archive/_DIST/reports/coverage/cobertura. > [cobertura-report] The jvmargs attribute is deprecated. Please use nested jvmarg elements. > [cobertura-report] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file > [cobertura-report] Cobertura: Loaded information on 622 classes. > [cobertura-report] Report time: 26887ms > > BUILD SUCCESSFUL > Total time: 28 seconds > > real 0m29.214s > user 0m34.104s > sys 0m1.133s > > > > > When bypassing the Ant task cobertura-report and calling the Java class directly, like this > > > <macrodef name="m_cobertura-report-java" description="Uses properties: src.java.dir, build.dir, coverage.report.dir."> > <attribute name="cobertura.format" default="${cobertura.format}" /> > <attribute name="cobertura.datafile" default="${cobertura.datafile}" /> > <attribute name="cobertura.destdir" default="${cobertura.destdir}" /> > <attribute name="cobertura.maxmemory" default="128" /> > <attribute name="cobertura.srcdir" default="${cobertura.srcdir}" /> > > <sequential> > <mkdir dir="@{cobertura.destdir}" /> > <echo message="Generating Cobertura report using datafile @{cobertura.datafile}, todir=@{cobertura.destdir}." /> > <echo message="NOT using Ant task" /> > <java classname="net.sourceforge.cobertura.reporting.Main" classpathref="buildenv.lib.classpath"> > <arg line="--destination @{cobertura.destdir} --basedir @{cobertura.srcdir} --datafile @{cobertura.datafile} --format @{cobertura.format}" /> > <jvmarg value="-Xmx@{cobertura.maxmemory}m" /> > </java> > </sequential> > </macrodef> > > <target name="foobar2" description=""> > <m_cobertura-report-java /> > </target> > > it yields the following result (Observe the difference in execution time!) > > $ time ant foobar2 > Buildfile: /Users/me/Desktop/Archive/build.xml > > foobar2: > [echo] Generating Cobertura report using datafile /Users/me/Desktop/Archive/_BUILD/cobertura.ser, todir=/Users/me/Desktop/Archive/_DIST/reports/coverage/cobertura. > [echo] NOT using Ant task > [java] JVM args ignored when same JVM is used. > [java] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file > [java] Cobertura: Loaded information on 622 classes. > [java] Report time: 1257ms > > BUILD SUCCESSFUL > Total time: 2 seconds > > real 0m2.997s > user 0m3.739s > sys 0m0.295s > > > > Am I doing something wrong? I tried experimenting with maxmemory attribute but it does not seem to affect anything? > Another thing, why do I get the print out? > > "[cobertura-report] The jvmargs attribute is deprecated. Please use nested jvmarg elements." > > > Cheers > Christian Jendeberg > bwin Games AB > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > |
From: John W. L. <Joh...@sa...> - 2010-03-17 12:59:20
|
Try setting maxmemory. http://cobertura.sourceforge.net/anttaskreference.html -----Original Message----- From: Christian Jendeberg [mailto:chr...@bw...] Sent: Wednesday, March 17, 2010 5:06 AM To: cob...@li... Subject: [Cobertura-devel] cobertura-report bails out with java.lang.OutOfMemoryError Hi I'm having trouble generating HTML reports with the Ant task cobertura-report with Ant 1.8.0, JDK 1.6.0_17 and Cobertura-1.9.4.1 (also tried 1.9.3) My code looks like this <macrodef name="m_cobertura-init"> <sequential> <taskdef resource="tasks.properties" classpathref="buildenv.lib.classpath" /> </sequential> </macrodef> <macrodef name="m_cobertura-report" description="Uses properties: src.java.dir, build.dir, coverage.report.dir."> <attribute name="cobertura.format" default="${cobertura.format}" /> <attribute name="cobertura.datafile" default="${cobertura.datafile}" /> <attribute name="cobertura.destdir" default="${cobertura.destdir}" /> <attribute name="cobertura.maxmemory" default="128" /> <attribute name="cobertura.srcdir" default="${cobertura.srcdir}" /> <sequential> <taskdef resource="tasks.properties" classpathref="buildenv.lib.classpath" /> <mkdir dir="@{cobertura.destdir}" /> <echo message="Generating Cobertura report using datafile @{cobertura.datafile}, todir=@{cobertura.destdir}." /> <cobertura-report format="@{cobertura.format}" datafile="@{cobertura.datafile}" destdir="@{cobertura.destdir}" maxmemory="@{cobertura.maxmemory}" srcdir="@{cobertura.srcdir}" /> </sequential> </macrodef> <target name="foobar" description=""> <m_cobertura-init /> <m_cobertura-report /> </target> When I run the foobar target I get the following result... $ time ant foobar Buildfile: /Users/me/Desktop/Archive/build.xml foobar: [echo] Generating Cobertura report using datafile /Users/me/Desktop/Archive/_BUILD/cobertura.ser, todir=/Users/me/Desktop/Archive/_DIST/reports/coverage/cobertura. [cobertura-report] The jvmargs attribute is deprecated. Please use nested jvmarg elements. [cobertura-report] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-report] Cobertura: Loaded information on 622 classes. [cobertura-report] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space [cobertura-report] at java.util.Arrays.copyOfRange(Arrays.java:3209) [cobertura-report] at java.lang.String.<init>(String.java:215) [cobertura-report] at java.lang.StringBuffer.toString(StringBuffer.java:585) [cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateHtmlizedJavaSource(HTMLReport.java:638) [cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateSourceFile(HTMLReport.java:501) [cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateSourceFiles(HTMLReport.java:434) [cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.<init>(HTMLReport.java:97) [cobertura-report] at net.sourceforge.cobertura.reporting.Main.parseArguments(Main.java:105) [cobertura-report] at net.sourceforge.cobertura.reporting.Main.main(Main.java:174) BUILD FAILED /Users/me/Desktop/Archive/build.xml:148: The following error occurred while executing this line: /Users/me/Desktop/Archive/_BUILDENV/cobuto/macros/cobertura.xml:52: Error running reports. See messages above. Total time: 16 seconds real 0m17.064s user 0m21.720s sys 0m0.879s Changing the report generation to XML format like this <target name="foobar" description=""> <m_cobertura-init /> <m_cobertura-report cobertura.format="xml" /> </target> yields the following result $ time ant foobar Buildfile: /Users/me/Desktop/Archive/build.xml foobar: [echo] Generating Cobertura report using datafile /Users/me/Desktop/Archive/_BUILD/cobertura.ser, todir=/Users/me/Desktop/Archive/_DIST/reports/coverage/cobertura. [cobertura-report] The jvmargs attribute is deprecated. Please use nested jvmarg elements. [cobertura-report] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-report] Cobertura: Loaded information on 622 classes. [cobertura-report] Report time: 26887ms BUILD SUCCESSFUL Total time: 28 seconds real 0m29.214s user 0m34.104s sys 0m1.133s When bypassing the Ant task cobertura-report and calling the Java class directly, like this <macrodef name="m_cobertura-report-java" description="Uses properties: src.java.dir, build.dir, coverage.report.dir."> <attribute name="cobertura.format" default="${cobertura.format}" /> <attribute name="cobertura.datafile" default="${cobertura.datafile}" /> <attribute name="cobertura.destdir" default="${cobertura.destdir}" /> <attribute name="cobertura.maxmemory" default="128" /> <attribute name="cobertura.srcdir" default="${cobertura.srcdir}" /> <sequential> <mkdir dir="@{cobertura.destdir}" /> <echo message="Generating Cobertura report using datafile @{cobertura.datafile}, todir=@{cobertura.destdir}." /> <echo message="NOT using Ant task" /> <java classname="net.sourceforge.cobertura.reporting.Main" classpathref="buildenv.lib.classpath"> <arg line="--destination @{cobertura.destdir} --basedir @{cobertura.srcdir} --datafile @{cobertura.datafile} --format @{cobertura.format}" /> <jvmarg value="-Xmx@{cobertura.maxmemory}m" /> </java> </sequential> </macrodef> <target name="foobar2" description=""> <m_cobertura-report-java /> </target> it yields the following result (Observe the difference in execution time!) $ time ant foobar2 Buildfile: /Users/me/Desktop/Archive/build.xml foobar2: [echo] Generating Cobertura report using datafile /Users/me/Desktop/Archive/_BUILD/cobertura.ser, todir=/Users/me/Desktop/Archive/_DIST/reports/coverage/cobertura. [echo] NOT using Ant task [java] JVM args ignored when same JVM is used. [java] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [java] Cobertura: Loaded information on 622 classes. [java] Report time: 1257ms BUILD SUCCESSFUL Total time: 2 seconds real 0m2.997s user 0m3.739s sys 0m0.295s Am I doing something wrong? I tried experimenting with maxmemory attribute but it does not seem to affect anything? Another thing, why do I get the print out? "[cobertura-report] The jvmargs attribute is deprecated. Please use nested jvmarg elements." Cheers Christian Jendeberg bwin Games AB ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Cobertura-devel mailing list Cob...@li... https://lists.sourceforge.net/lists/listinfo/cobertura-devel |