[ http://jira.codehaus.org/browse/MCOBERTURA-23?page=comments#action_62859 ]
Detlef Pleiss commented on MCOBERTURA-23: ----------------------------------------- (both following cases from a cleaned project dir, no cobertura.ser) if I do not have the surefire-report-maven-plugin activated in the POM, I get this output: [INFO] Scanning for projects... [INFO] ---------------------------------------------------------------------------- [INFO] Building Webed [INFO] task-segment: [site] [INFO] ---------------------------------------------------------------------------- [INFO] Preparing cobertura:cobertura [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] Compiling 31 source files to J:\webed\target\classes [INFO] [cobertura:instrument] [INFO] Cobertura 1.7 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Instrumenting 40 classes to J:\webed\target\generated-classes\cobertura [cobertura] WARN [main] net.sourceforge.cobertura.instrument.ClassInstrumenter - No line number information found for class com.comundus.util.CurrentTime$1. Perhaps you need to compile with debug=true? Cobertura: Saved information on 38 classes. Instrument time: 329ms [INFO] Instrumentation was successful. [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] Compiling 7 source files to J:\webed\target\test-classes [INFO] [surefire:test] [INFO] Setting reports dir: J:\webed\target/surefire-reports [ERROR] There are some test failure. [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] ************************************************************** [INFO] Starting Jakarta Velocity v1.4 [INFO] RuntimeInstance initializing. [INFO] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl) [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader [INFO] ClasspathResourceLoader : initialization starting. [INFO] ClasspathResourceLoader : initialization complete. [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl) [INFO] Default ResourceManager initialization complete. [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach [INFO] Created: 20 parsers. [INFO] Velocimacro : initialization starting. [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm [ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader. [INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm' [INFO] Velocimacro : VM library template macro registration complete. [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed. [INFO] Velocimacro : initialization complete. [INFO] Velocity successfully started. [INFO] [site:site] [INFO] Generate "Cobertura Test Coverage" report. [INFO] Cobertura 1.7 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Cobertura: Loaded information on 38 classes. Report time: 1755ms [INFO] Cobertura Report generation was successful. [INFO] Generate "Continuous Integration" report. [ERROR] VM #displayTree: error : too few arguments to macro. Wanted 2 got 0 [ERROR] VM #menuItem: error : too few arguments to macro. Wanted 1 got 0 [INFO] Generate "Dependencies" report. [INFO] Generate "Issue Tracking" report. [INFO] Generate "Project License" report. [INFO] Generate "Mailing Lists" report. [INFO] Generate "Source Repository" report. [INFO] Generate "Project Team" report. [INFO] Generate an index file for the English version. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 18 seconds [INFO] Finished at: Wed Apr 05 13:16:09 CEST 2006 [INFO] Final Memory: 9M/17M [INFO] ------------------------------------------------------------------------ it seems there are no tests executed and it says something about a test failure, don't know why, as if I do activate the surefire-report-maven-plugin in the POM, tests execute successfully: [INFO] Scanning for projects... [INFO] ---------------------------------------------------------------------------- [INFO] Building Webed [INFO] task-segment: [site] [INFO] ---------------------------------------------------------------------------- [INFO] Preparing cobertura:cobertura [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] Compiling 31 source files to J:\webed\target\classes [INFO] [cobertura:instrument] [INFO] Cobertura 1.7 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Instrumenting 40 classes to J:\webed\target\generated-classes\cobertura [cobertura] WARN [main] net.sourceforge.cobertura.instrument.ClassInstrumenter - No line number information found for class com.comundus.util.CurrentTime$1. Perhaps you need to compile with debug=true? Cobertura: Saved information on 38 classes. Instrument time: 345ms [INFO] Instrumentation was successful. [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] Compiling 7 source files to J:\webed\target\test-classes [INFO] [surefire:test] [INFO] Setting reports dir: J:\webed\target/surefire-reports [ERROR] There are some test failure. [INFO] Preparing surefire-report:report [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] [INFO] Nothing to compile - all classes are up to date [INFO] [surefire:test] [INFO] Setting reports dir: J:\webed\target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- 0 [main] INFO com.comundus.webed.db.BlocksHome - getting DBTable 0 [main] INFO com.comundus.webed.db.BlocksHome - getting DBTable [surefire] Running com.comundus.util.db.DBDatabaseTest [surefire] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0,676 sec [surefire] Running com.comundus.util.db.DBExceptionTest [surefire] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0,015 sec [surefire] Running com.comundus.util.db.DBTest [surefire] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0,031 sec [surefire] Running com.comundus.webed.db.BlocksHomeTest [surefire] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0,141 sec 942 [main] INFO com.comundus.webed.db.BlocksHome - getting DBTable 958 [main] INFO com.comundus.webed.db.BlocksHome - getting DBTable 974 [main] INFO com.comundus.webed.db.BlocksHome - getting DBTable [surefire] Running com.comundus.webed.db.BlocksTest [surefire] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0,079 sec 1021 [main] INFO com.comundus.webed.db.PublicationsHome - getting DBTable 1021 [main] INFO com.comundus.webed.db.CategoriesHome - getting DBTable 1021 [main] INFO com.comundus.webed.db.ThemesHome - getting DBTable 1021 [main] INFO com.comundus.webed.db.ArticlesHome - getting DBTable 1036 [main] INFO com.comundus.webed.db.ArticlesBlocksHome - getting DBTable 1036 [main] INFO com.comundus.webed.db.BlocksHome - getting DBTable [surefire] Running com.comundus.webed.WebedTest [surefire] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0,047 sec Results : [surefire] Tests run: 9, Failures: 0, Errors: 0 [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] ************************************************************** [INFO] Starting Jakarta Velocity v1.4 [INFO] RuntimeInstance initializing. [INFO] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl) [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader [INFO] ClasspathResourceLoader : initialization starting. [INFO] ClasspathResourceLoader : initialization complete. [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl) [INFO] Default ResourceManager initialization complete. [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach [INFO] Created: 20 parsers. [INFO] Velocimacro : initialization starting. [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm [ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader. [INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm' [INFO] Velocimacro : VM library template macro registration complete. [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed. [INFO] Velocimacro : initialization complete. [INFO] Velocity successfully started. [INFO] [site:site] [WARNING] Error loading report org.codehaus.mojo.surefire.SurefireReportMojo - AbstractMethodError: canGenerateReport() [INFO] Generate "Cobertura Test Coverage" report. [INFO] Cobertura 1.7 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Cobertura: Loaded information on 38 classes. Report time: 1178ms [INFO] Cobertura Report generation was successful. [INFO] Generate "Maven Surefire Report" report. [ERROR] VM #displayTree: error : too few arguments to macro. Wanted 2 got 0 [ERROR] VM #menuItem: error : too few arguments to macro. Wanted 1 got 0 [INFO] Generate "Continuous Integration" report. [INFO] Generate "Dependencies" report. [INFO] Generate "Issue Tracking" report. [INFO] Generate "Project License" report. [INFO] Generate "Mailing Lists" report. [INFO] Generate "Source Repository" report. [INFO] Generate "Project Team" report. [INFO] Generate an index file for the English version. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12 seconds [INFO] Finished at: Wed Apr 05 13:20:33 CEST 2006 [INFO] Final Memory: 9M/19M [INFO] ------------------------------------------------------------------------ Anyway, in both cases I get 0% coverage reported by Cobertura. In case this information might be useful: I'm running on a german Windows; might influence the results if there's locale dependent number conversions involved somewhere in the software. > Fails to run tests > ------------------ > > Key: MCOBERTURA-23 > URL: http://jira.codehaus.org/browse/MCOBERTURA-23 > Project: Maven 2.x Cobertura Plugin > Type: Bug > Environment: JUnit 4. Maven 2.0.3. Java 1.5. Linux, 64 bit processor. > Reporter: Adrian > Priority: Critical > > > I have an EJB 3.0 project that I have JUnit tests for. The tests launch the > JBoss EJB 3.0 Embeddable environment on setUp() and shut it down on > tearDown(). When I run the following command > mvn clean cobertura:clean cobertura:cobertura > Maven runs and instruments the code, but it appears as if no tests ever run. > If you want further info I will watch this issue and will reply to your > comments. > See below for maven output: > [INFO] Scanning for projects... > [INFO] Searching repository for plugin with prefix: 'cobertura'. > [INFO] > ---------------------------------------------------------------------------- > [INFO] Building PICS Core EJB > [INFO] task-segment: [clean, cobertura:clean, cobertura:cobertura] > [INFO] > ---------------------------------------------------------------------------- > [INFO] [clean:clean] > [INFO] Deleting directory /home/apill/workspaces/pics/pics-core-ejb/target > [INFO] Deleting directory > /home/apill/workspaces/pics/pics-core-ejb/target/classes > [INFO] Deleting directory > /home/apill/workspaces/pics/pics-core-ejb/target/test-classes > [INFO] [cobertura:clean {execution: default}] > [INFO] [cobertura:clean] > [INFO] Preparing cobertura:cobertura > [INFO] [resources:resources] > [INFO] Using default encoding to copy filtered resources. > [WARNING] > Artifact com.dolby.pics:dd-pics-test-data:jar:0.2-SNAPSHOT:test > retains local scope 'test' overriding broader scope 'compile' > given by a dependency. If this is not intended, modify or remove the > local scope. > [INFO] [compiler:compile] > Compiling 51 source files to > /home/apill/workspaces/pics/pics-core-ejb/target/classes > [INFO] [cobertura:instrument] > [INFO] Cobertura 1.7 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file > Instrumenting 53 classes to > /home/apill/workspaces/pics/pics-core-ejb/target/generated-classes/cobertura > Cobertura: Saved information on 51 classes. > Instrument time: 687ms > [INFO] Instrumentation was successful. > [INFO] [resources:testResources] > [INFO] Using default encoding to copy filtered resources. > [WARNING] > Artifact junit:junit:jar:4.0:test retains local scope 'test' > overriding broader scope 'compile' > given by a dependency. If this is not intended, modify or remove the > local scope. > [INFO] [compiler:testCompile] > Compiling 6 source files to > /home/apill/workspaces/pics/pics-core-ejb/target/test-classes > [INFO] [surefire:test] > [INFO] Setting reports dir: > /home/apill/workspaces/pics/pics-core-ejb/target/surefire-reports > [INFO] [cobertura:cobertura] > [INFO] Cobertura 1.7 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file > Cobertura: Loaded information on 51 classes. > Report time: 1563ms > [INFO] Cobertura Report generation was successful. > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESSFUL > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 20 seconds > [INFO] Finished at: Wed Mar 29 14:25:12 BST 2006 > [INFO] Final Memory: 9M/34M > [INFO] > ------------------------------------------------------------------------ -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
