cobertura

Cobertura “unable to locate file” problem

和自甴很熟 提交于 2019-12-13 15:26:33
问题 Can anyone please help me to understand what is wrong here? I am using Cobertura 1.9.4.1 for Java Code Coverage. I want to attache the source file with HTML report, I am generating report using the below command: cobertura-report.sh --format html --datafile $COBERTURA_HOME/core/emscore.ser --basedir $COBERTURA_HOME/core/src --destination $REPORT_DIR HTML report generated successfully. Where I click on the file name in HTML report, it is giving the below error: "Unable to locate com/airvana

Zero code coverage with cobertura 1.9.2 but tests are working

允我心安 提交于 2019-12-13 13:43:10
问题 I run the code coverage target: <junit fork="yes" dir="${basedir}" failureProperty="test.failed"> <!-- Note the classpath order: instrumented classes are before the original (uninstrumented) classes. This is important. --> <classpath path="${instrumented.dir}" /> <classpath path="${classes.dir}" /> <classpath refid="classpath" /> <!-- The instrumented classes reference classes used by the Cobertura runtime, so Cobertura and its dependencies must be on your classpath. --> <classpath refid=

cobertura report

≡放荡痞女 提交于 2019-12-13 06:54:45
问题 I am making a jar file of project1 and placing the jar file in project2. For project2 I'm able to create the coberatura report. My question is how do I get the cobertura report for project1(in jar format) which is in project2? 回答1: I got solution. instrumented the class of project1 build the jar place the jar in project2. .ser file created placed in tomcat home path. I deployed project2 in tomcat and ran the application. After stopping tomcat the .ser file was overwritten. Now generate the

How to output coverage XML with nosetests?

北战南征 提交于 2019-12-12 09:32:36
问题 I'm trying to output the coverage XML of my nosetests so they show up on Hudson. The line I'm executing is: nosetests --with-gae -v --all-modules --with-xunit --with-coverage I see the coverage output in the console, but there's no xml file containing the coverage data. How can I get it to output the coverage xml? 回答1: Once you've run the nosetests command, there will be a .coverage data file in the directory. If you then run coverage xml , it will create a Cobertura-compatible XML file from

cobertura-maven-plugin excludes configuration

天大地大妈咪最大 提交于 2019-12-12 08:26:48
问题 I have a Maven project with a test case DefaultViewTypeToFragmentMapperTest.java in the directory /src/test/java/test/com/mycompany/myproduct/android/viewtype2fragmentmapper/ . I want this test case to be excluded from unit test coverage calculation. In order to achieve this result, I configured the plugin like this: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.5.2</version> <configuration> <formats> <format>html</format> <format>xml

Ignoring report generation for specific classes in cobertura maven plugin

谁都会走 提交于 2019-12-12 08:25:21
问题 I've been using Cobertura plugin for report generation and instrumentation (with surefire). Here is the issue I am facing: I am unable to make the plugin ignore report generation for specific classes in my project. PF below the related excerpt from pom.xml, I have added the ignore tag, but that just ignores instrumentation for the ignored classes. I want the report for specific projects to not be generated at all. Firstly, due to my limited knowledge of both Maven and Conberture, I want to

Cobertura code coverage results not complete

风格不统一 提交于 2019-12-12 06:24:22
问题 I am using Cobertura for code coverage analysis. If I run a build in Jenkins the classes in generated are contained in the coverage result but the coverage is at 0% . If I run code coverage in my workspace (Eclipse) the coverage is much higher. The coverage for the package com.my.package is ok. Have I missed some configuration? My projects structure is as following: - com +- com.my +-- com.my.package +--- class1.java +--- class2.java - generated +- classX.java +- classY.java My cobertura

Sonar-Cobertura custom filters

自作多情 提交于 2019-12-12 01:04:21
问题 I am using sonar in my project through sonar-maven plugin . I am using Cobertura plugin for code coverage analysis. I want to exclude some modules/classes from code coverage report. How can I do it? Thanks in advance. 回答1: You can use the sonar.coverage.exclusions to not report coverage of some files of your project. You can find this property in the project settings, in the "Exclusions > Code Coverage" category. 来源: https://stackoverflow.com/questions/16014201/sonar-cobertura-custom-filters

How to increase the conditional coverage using jmockit for cobertura?

怎甘沉沦 提交于 2019-12-11 19:46:31
问题 I am trying to increase the code coverage for following below method using jmockit - Below is my method in DataLogger class for which I am trying to increase the coverage - public void logDebug(final Object... objects) { if (m_logger.isDebugEnabled() && objects != null) { m_logger.debug(message(objects)); } } And below is my isDebugEnabled - public boolean isDebugEnabled() { return m_logger.isDebugEnabled(); } Somehow my cobertura coverage report is showing as Conditional Coverage 25% [1/4]

Instrumented (by cobertura) @Decorator bean could not validated by OpenEJB for unit testing

天涯浪子 提交于 2019-12-11 18:09:22
问题 In order to get code coverage report, i instrument the @Decorator bean by cobertura maven plugin. When running my unit test in OpenEJB container. The container reports some error during start up (new initial context). Caused by: org.apache.webbeans.exception.WebBeansConfigurationException: Decorator : MyDecorator, Name:null, WebBeans Type:DECORATOR, API Types:[org.apache.commo ns.configuration.Configuration,net.sourceforge.cobertura.coveragedata.HasBeenInstrumented,org.apache.commons