Showing posts with label Cobertura. Show all posts
Showing posts with label Cobertura. Show all posts

Cobertura Issue



Failure while instrumented class file, with tools:
cobertura-1.9.4.1
jdk java version 1.6.0_30
Apache Ant(TM) version 1.8.2







[tutorial@tutorialhost coveragereport]$ ant
Buildfile: /coveragereport/build.xml

init:
    [mkdir] Created dir: /coveragereport/instrumented
    [mkdir] Created dir: /coveragereport/htmlReports

InstrumentEARLib:
[cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura-instrument] Instrumenting 19368 files to /coveragereport/instrumented
[cobertura-instrument] WARN   addInstrumentationToSingleClass, Unable to instrument file /StructureLoader.class
[cobertura-instrument] java.lang.RuntimeException: java.lang.ClassNotFoundException: WarningNode
[cobertura-instrument]  at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source)
[cobertura-instrument]  at org.objectweb.asm.ClassWriter.a(Unknown Source)
[cobertura-instrument]  at org.objectweb.asm.Frame.a(Unknown Source)
[cobertura-instrument]  at org.objectweb.asm.Frame.a(Unknown Source)
[cobertura-instrument]  at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
[cobertura-instrument]  at org.objectweb.asm.ClassReader.accept(Unknown Source)
[cobertura-instrument]  at org.objectweb.asm.ClassReader.accept(Unknown Source)
[cobertura-instrument]  at org.objectweb.asm.ClassWriter.toByteArray(Unknown Source)
[cobertura-instrument]  at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:392)
[cobertura-instrument]  at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:416)
[cobertura-instrument]  at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:492)
[cobertura-instrument]  at net.sourceforge.cobertura.instrument.Main.main(Main.java:514)
[cobertura-instrument] Caused by: java.lang.ClassNotFoundException: WarningNode
[cobertura-instrument]  at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
[cobertura-instrument]  at java.security.AccessController.doPrivileged(Native Method)
[cobertura-instrument]  at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
[cobertura-instrument]  at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
[cobertura-instrument]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
[cobertura-instrument]  at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
[cobertura-instrument]  at java.lang.Class.forName0(Native Method)
[cobertura-instrument]  at java.lang.Class.forName(Class.java:190)
[cobertura-instrument]  ... 12 more
[cobertura-instrument] Cobertura: Saved information on 19277 classes.
[cobertura-instrument] Instrument time: 17997ms

BUILD FAILED

Solution:
<cobertura-instrument todir="${instrumented.dir}">
        <ignore regex="org.apache.log4j.*" />
        <fileset dir="${project_home}/ext-path">
      <include name="**/*.class" />
       <exclude name="**/*Test.class" />
</fileset>
</cobertura-instrument>


Issue:JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java

XXXXNotFoundException: No result for the given query at SearchService.searchUnique(DefaultSearchService.java:243) at sun.reflect.GeneratedMethodAccessor2047.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:622) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196) at com.sun.proxy.$Proxy30.getXXXX(Unknown Source) at CLSName.getXXXXX(CLSName.java:221) at PoolableThread.run(PoolableThread.java:198)

Solution:
<cobertura-instrument todir="${instrumented.dir}">
        <ignore regex="org.apache.log4j.*" />
        <fileset dir="${prj_home}/ext">
      <include name="**/*.class" />
       <exclude name="**/*Test.class" />
</fileset>
</cobertura-instrument>

Issue While using the Cobertura version 2.1.1:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultService' defined in class path resource [test-spring.xml]: Cannot resolve reference to bean 'TestDao' while setting bean property 'TestDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'TestDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private TestService DefaultDao.SearchService; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class  or dependent class; nested exception is java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/HasBeenInstrumented
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:329)
at de.hybris.platform.spring.ThreadSafeScopeMap.get(ThreadSafeScopeMap.java:68)

Solution: Looking into...


Unable to instrument jar file, as while doing removing the original file:

 [tutorialbyexample]$ ant Buildfile: /tutorialbyexample/build.xml init:
 [delete] Deleting directory /tutorialbyexample/instrumented
 [delete] Deleting directory /tutorialbyexample/htmlReports
 [delete] Deleting: /tutorialbyexample/cobertura.ser
 [mkdir] Created dir: /tutorialbyexample/instrumented
 [mkdir] Created dir: /tutorialbyexample/htmlReports InstrumentEARLib:
 [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See  COPYRIGHT file
 [cobertura-instrument] Instrumenting 316 files to /tutorialbyexample/classes [cobertura-instrument]  Cobertura: Saved information on 316 classes.
 [cobertura-instrument] Instrument time: 782ms
 [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See  COPYRIGHT file
 [cobertura-instrument] Cobertura: Loaded information on 316 classes.
 [cobertura-instrument] Instrumenting 1 file to /tutorialbyexample/web/webroot/WEB-INF/classes  [cobertura-instrument] Cobertura: Saved information on 317 classes.
 [cobertura-instrument] Instrument time: 192ms
 [cobertura-instrument] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See  COPYRIGHT file [cobertura-instrument] Cobertura: Loaded information on 317 classes.
[cobertura-instrument] Instrumenting 1 file to /tutorialbyexample/bin
[cobertura-instrument] Cobertura: Error closing output stream.
[cobertura-instrument] java.util.zip.ZipException: ZIP file must have at least one entry [cobertura-instrument] at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:321)
[cobertura-instrument] at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:163) [cobertura-instrument] at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:338)
[cobertura-instrument] at net.sourceforge.cobertura.util.IOUtil.closeOutputStream(IOUtil.java:165) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.addInstrumentationToArchive(Main.java:319) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:488) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.main(Main.java:514) [cobertura-instrument] Cobertura: Saved information on 317 classes.
[cobertura-instrument] Instrument time: 188ms BUILD SUCCESSFUL Total time: 4 seconds Issue cobertura-1.9.4.1: nested exception is java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/HasBeenInstrumented Solution: Copy the below jars in tomcat/lib cobertura-1.9.4.1/cobertura.jar cobertura-1.9.4.1/lib/asm-3.0.jar cobertura-1.9.4.1/lib/jakarta-oro-2.0.8.jar cobertura-1.9.4.1/lib/log4j-1.2.9.jar cobertura-1.9.4.1/lib/asm-tree-3.0.jar Restart the tomcat server.

Cobertura Java Ant-Maven Eclipse Example


In this example we will discussed how to add jar file's instead of class. Why this is require, as most of time we are generating the .ear, .war file for application deployment and that time we won't find the any class dir in project.

Requirement:
1. Maven
2. Ant
3. Java
4. Eclipse

> Create the java project with maven command
C:\>mvn archetype:generate -DgroupId=com.tutorialbyexample -DartifactId=mavenjavaexample -DarchetypeArtifactId
=maven-archetype-quickstart -DinteractiveMode=false
Note: assuming you have set the path and class path of maven, ant and java
e.g: 
set classpath=%;C:\apache-maven-3.2.1\lib;
set path=%;C:\apache-maven-3.2.1\bin;

> Now with help of above mavenjavaexample project will created

mavenjavaexample 
- src
 -- main
   ---java
 --test
    ---java
- pom.xml

App.java
package com.tutorialbyexample;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
    }
}


AppTest.java

package com.tutorialbyexample;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Unit test for simple App.
 */
public class AppTest 
    extends TestCase
{
    /**
     * Create the test case
     *
     * @param testName name of the test case
     */
    public AppTest( String testName )
    {
        super( testName );
    }

    /**
     * @return the suite of tests being tested
     */
    public static Test suite()
    {
        return new TestSuite( AppTest.class );
    }

    /**
     * Rigourous Test :-)
     */
    public void testApp()
    {
        assertTrue( true );
    }
}





What we need now just create another project for cobertura:

Create simple project in Eclipse:Cobetura-Java-Coverage-Report-mvn
More more  details refer the http://www.tutorialbyexample.com/2015/03/cobertura-java-ant-eclipse-example.html

Now do the required change in:
cobertura.properties:
lib.dir=C:/Cobetura-Java-Coverage-Report-mvn/lib
instrumented.dir=C:/Cobetura-Java-Coverage-Report-mvn/instrumented
coverage.html.dir=C:/Cobetura-Java-Coverage-Report-mvn/htmlReports
src.module1.dir=C:/mavenjavaexample/src/main/java
target.module1.dir=C:/mavenjavaexample/target

build.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<project name="Cobetura-Java-Coverage-Report" default="GeneratingCoberturaFiles" basedir=".">
<property file="cobertura.properties" />
<property name="lib.dir" value="${lib.dir}" />

<property name="instrumented.dir" value="${instrumented.dir}" />
<property name="coverage.html.dir" value="${coverage.html.dir}" />
<property name="src.module1.dir" value="${src.module1.dir}" />
<property name="target.module1.dir" value="${target.module1.dir}" />
<path id="cobertura.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<target name="init">
<delete dir="${instrumented.dir}" />
<delete dir="${coverage.html.dir}" />
<delete file="cobertura.ser" />
<mkdir dir="${instrumented.dir}" />
<mkdir dir="${coverage.html.dir}" />
</target>
<target name="GeneratingCoberturaFiles" depends="init" description="Generating the .ser file with .class file">
<cobertura-instrument todir="${instrumented.dir}" datafile="cobertura.ser">
<ignore regex="org.apache.log4j.*" />
<!--<fileset dir="${target.module1.dir}">
<include name="**/*.class" />
</fileset>-->
<fileset dir="${target.module1.dir}">
<include name="*.jar" />
</fileset>
</cobertura-instrument>
</target>
<target name="GenerateHTMLReport" description="Generate coverage report">
<delete dir="${coverage.html.dir}" />
<mkdir dir="${coverage.html.dir}" />
<cobertura-report format="HTML" destdir="${coverage.html.dir}" datafile="cobertura.ser">
<fileset dir="${src.module1.dir}">
<include name="**/*.java" />
</fileset>
</cobertura-report>
</target>
</project>


Now open the build.xml in ant view and run it ant GeneratingCoberturaFiles

Buildfile: C:\Cobetura-Java-Coverage-Report-mvn\build.xml
init:
   [delete] Deleting directory C:\\Cobetura-Java-Coverage-Report-mvn\instrumented
   [delete] Deleting directory C:\Cobetura-Java-Coverage-Report-mvn\htmlReports
   [delete] Deleting: C:\Cobetura-Java-Coverage-Report-mvn\cobertura.ser
    [mkdir] Created dir: C:\Cobetura-Java-Coverage-Report-mvn\instrumented
    [mkdir] Created dir: C:\Cobetura-Java-Coverage-Report-mvn\htmlReports
GeneratingCoberturaFiles:
[cobertura-instrument] 17:42:50,465 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[cobertura-instrument] 17:42:50,465 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[cobertura-instrument] 17:42:50,466 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/extvkx/workspace/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-instrument] 17:42:50,467 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
[cobertura-instrument] 17:42:50,467 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-instrument] 17:42:50,467 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1.jar!/logback.xml]
[cobertura-instrument] 17:42:50,523 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@ad3fd4 - URL [jar:file:/C:/Users/extvkx/workspace/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
[cobertura-instrument] 17:42:50,562 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[cobertura-instrument] 17:42:50,574 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[cobertura-instrument] 17:42:50,590 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[cobertura-instrument] 17:42:50,619 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
[cobertura-instrument] 17:42:50,660 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
[cobertura-instrument] 17:42:50,660 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
[cobertura-instrument] 17:42:50,661 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[cobertura-instrument] 17:42:50,661 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[cobertura-instrument] 17:42:50,662 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@398f3c - Registering current configuration as safe fallback point
[cobertura-instrument] 17:42:51,441 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[cobertura-instrument] 17:42:51,441 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[cobertura-instrument] 17:42:51,441 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-instrument] 17:42:51,441 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
[cobertura-instrument] 17:42:51,441 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-instrument] 17:42:51,441 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1.jar!/logback.xml]
[cobertura-instrument] 17:42:51,457 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@193b604 - URL [jar:file:/C:/Users/extvkx/workspace/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
[cobertura-instrument] 17:42:51,500 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[cobertura-instrument] 17:42:51,507 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[cobertura-instrument] 17:42:51,513 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[cobertura-instrument] 17:42:51,528 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
[cobertura-instrument] 17:42:51,554 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
[cobertura-instrument] 17:42:51,554 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
[cobertura-instrument] 17:42:51,554 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[cobertura-instrument] 17:42:51,554 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[cobertura-instrument] 17:42:51,555 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@92e96c - Registering current configuration as safe fallback point
[cobertura-instrument] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura-instrument] [INFO] Cobertura: Saved information on 1 classes.
[cobertura-instrument] [INFO] Cobertura: Saved information on 1 classes.
BUILD SUCCESSFUL
Total time: 2 seconds


Again run the ant GenerateHTMLReport

Buildfile: C:\Cobetura-Java-Coverage-Report-mvn\build.xml
GenerateHTMLReport:
   [delete] Deleting directory C:\Cobetura-Java-Coverage-Report-mvn\htmlReports
    [mkdir] Created dir: C:\Cobetura-Java-Coverage-Report-mvn\htmlReports
[cobertura-report] 17:44:47,435 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[cobertura-report] 17:44:47,436 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[cobertura-report] 17:44:47,436 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-report] 17:44:47,437 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
[cobertura-report] 17:44:47,437 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-report] 17:44:47,437 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1.jar!/logback.xml]
[cobertura-report] 17:44:47,475 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@b6dfa8 - URL [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
[cobertura-report] 17:44:47,510 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[cobertura-report] 17:44:47,517 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[cobertura-report] 17:44:47,529 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[cobertura-report] 17:44:47,549 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
[cobertura-report] 17:44:47,601 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
[cobertura-report] 17:44:47,601 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
[cobertura-report] 17:44:47,601 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[cobertura-report] 17:44:47,602 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[cobertura-report] 17:44:47,604 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@15a68d - Registering current configuration as safe fallback point
[cobertura-report] 17:44:47,781 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[cobertura-report] 17:44:47,781 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[cobertura-report] 17:44:47,781 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-report] 17:44:47,782 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
[cobertura-report] 17:44:47,782 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-report] 17:44:47,782 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1.jar!/logback.xml]
[cobertura-report] 17:44:47,797 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@8bf135 - URL [jar:file:/C:/Cobetura-Java-Coverage-Report-mvn/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
[cobertura-report] 17:44:47,845 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[cobertura-report] 17:44:47,854 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[cobertura-report] 17:44:47,860 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[cobertura-report] 17:44:47,876 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
[cobertura-report] 17:44:47,906 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
[cobertura-report] 17:44:47,906 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
[cobertura-report] 17:44:47,907 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[cobertura-report] 17:44:47,907 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[cobertura-report] 17:44:47,908 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@1890c67 - Registering current configuration as safe fallback point
[cobertura-report] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura-report] [INFO] Cobertura: Loaded information on 1 classes.
[cobertura-report] Report time: 338ms
BUILD SUCCESSFUL
Total time: 1 second

Now time to see the report:



















Reports:








Have good day ahead!!!

Reference:
https://github.com/cobertura/cobertura/wiki/Releasing-a-new-Cobertura
Maven official site.

Cobertura, Java, Ant and Eclipse Tutorial

Cobertura:

Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage. Click Me

Requirement:
Operating System, Java, Ant, Eclipse and Cobetura.

Note; Download latest cobetura files from http://cobertura.github.io/cobertura/

Create the new java project in eclipse:
Open the eclipse.
File > New > Java Project
Enter the name: cobertura_java_project
Right Click on the src under project cobertura_java_project
New > Class
Enter the:
package name: tutorialbyexample.cobertura.com
Class Name: CoberturaJavaApp.java

CoberturaJavaApp.java file look like as below:

/**
 *
 */
package tutorialbyexample.cobertura.com;
/**
 * @author Vinod Kumar
 *
 */
public class CoberturaJavaApp {
/**
* @param args
*/
public static void main(String[] args) {
CoberturaJavaApp obj = new CoberturaJavaApp();
printData("Welcome " + obj.getName("Vinod")
+ " to learning Cobertura!!!");
}
public String getName(String name) {
return name;
}
public String getAnotherName(String name) {
return name;
}
private static void printData(Object obj) {
System.out.println(obj);
}
}

Run It: Right click on the CoberturaJavaApp.java then Run as > Java Applicaiton
Output: Welcome Vinod to learning Cobertura!!!

Create the another simple project in eclipse: Cobetura-Java-Coverage-Report

















Add the:
lib folder under Cobetura-Java-Coverage-Report
  asm-5.0.1.jar
  asm-analysis-5.0.1.jar
  asm-commons-5.0.1.jar
  asm-tree-5.0.1.jar
  asm-util-5.0.1.jar
  cobertura-2.1.1-javadoc.jar
  cobertura-2.1.1-sources.jar
  cobertura-2.1.1.jar
  commons-lang3-3.3.2.jar
  hamcrest-core-1.3.jar
  jaxen-1.1.4.jar
  jetty-6.1.14.jar
  jetty-util-6.1.14.jar
  junit-4.11.jar
  logback-classic-1.0.13.jar
  logback-core-1.0.13.jar
  oro-2.0.8.jar
  servlet-api-2.5-6.1.14.jar
  slf4j-api-1.7.5.jar
build.xml
cobertura.properties

cobertura.properties:

lib.dir=C:/Users/workspace/Cobetura-Java-Coverage-Report/lib
instrumented.dir=C:/Users/workspace/Cobetura-Java-Coverage-Report/instrumented
coverage.html.dir=C:/Users/workspace/Cobetura-Java-Coverage-Report/htmlReports
src.module1.dir=C:/Users/workspace/cobertura_java_project/src
target.module1.dir=C:/Users/workspace/cobertura_java_project/bin





build.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<project name="Cobetura-Java-Coverage-Report" default="GeneratingCoberturaFiles" basedir=".">
<property file="cobertura.properties" />
<property name="lib.dir" value="${lib.dir}" />

<property name="instrumented.dir" value="${instrumented.dir}" />
<property name="coverage.html.dir" value="${coverage.html.dir}" />
<property name="src.module1.dir" value="${src.module1.dir}" />
<property name="target.module1.dir" value="${target.module1.dir}" />
<path id="cobertura.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<target name="init">
<delete dir="${instrumented.dir}" />
<delete dir="${coverage.html.dir}" />
<delete file="cobertura.ser" />
<mkdir dir="${instrumented.dir}" />
<mkdir dir="${coverage.html.dir}" />
</target>
<target name="GeneratingCoberturaFiles" depends="init" description="Generating the .ser file with .class file">
<cobertura-instrument todir="${target.module1.dir}">
<ignore regex="org.apache.log4j.*" />
<fileset dir="${target.module1.dir}">
<include name="**/*.class" />
</fileset>
</cobertura-instrument>
</target>
<target name="GenerateHTMLReport" description="Generate coverage report">
<delete dir="${coverage.html.dir}" />
<mkdir dir="${coverage.html.dir}" />
<cobertura-report destdir="${coverage.html.dir}">
<fileset dir="${src.module1.dir}">
<include name="**/*.java" />
</fileset>
</cobertura-report>
</target>
</project>















Open the build.xml in ant view windows.
Click on the GeneratingCoberturaFiles task
Buildfile: C:\Users\workspace\Cobetura-Java-Coverage-Report\build.xml
init:
   [delete] Deleting directory C:\Users\workspace\Cobetura-Java-Coverage-Report\instrumented
   [delete] Deleting directory C:\Users\workspace\Cobetura-Java-Coverage-Report\htmlReports
   [delete] Deleting: C:\Users\workspace\Cobetura-Java-Coverage-Report\cobertura.ser
    [mkdir] Created dir: C:\Users\workspace\Cobetura-Java-Coverage-Report\instrumented
    [mkdir] Created dir: C:\Users\workspace\Cobetura-Java-Coverage-Report\htmlReports
GeneratingCoberturaFiles:
[cobertura-instrument] 16:05:22,347 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[cobertura-instrument] 16:05:22,347 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[cobertura-instrument] 16:05:22,347 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-instrument] 16:05:22,348 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
[cobertura-instrument] 16:05:22,348 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-instrument] 16:05:22,348 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1.jar!/logback.xml]
[cobertura-instrument] 16:05:22,371 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@c3e952 - URL [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
[cobertura-instrument] 16:05:22,404 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[cobertura-instrument] 16:05:22,411 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[cobertura-instrument] 16:05:22,423 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[cobertura-instrument] 16:05:22,438 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
[cobertura-instrument] 16:05:22,479 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
[cobertura-instrument] 16:05:22,479 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
[cobertura-instrument] 16:05:22,479 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[cobertura-instrument] 16:05:22,480 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[cobertura-instrument] 16:05:22,481 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@b1959 - Registering current configuration as safe fallback point
[cobertura-instrument] 16:05:22,850 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[cobertura-instrument] 16:05:22,850 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[cobertura-instrument] 16:05:22,850 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-instrument] 16:05:22,850 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
[cobertura-instrument] 16:05:22,851 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-instrument] 16:05:22,851 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1.jar!/logback.xml]
[cobertura-instrument] 16:05:22,865 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@193b604 - URL [jar:file:/C:/Users/extvkx/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
[cobertura-instrument] 16:05:22,909 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[cobertura-instrument] 16:05:22,917 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[cobertura-instrument] 16:05:22,923 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[cobertura-instrument] 16:05:22,938 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
[cobertura-instrument] 16:05:22,965 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
[cobertura-instrument] 16:05:22,965 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
[cobertura-instrument] 16:05:22,965 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[cobertura-instrument] 16:05:22,965 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[cobertura-instrument] 16:05:22,966 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@92e96c - Registering current configuration as safe fallback point
[cobertura-instrument] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura-instrument] [INFO] Cobertura: Saved information on 1 classes.
[cobertura-instrument] [INFO] Cobertura: Saved information on 1 classes.
BUILD SUCCESSFUL
Total time: 1 second

Now we will able to see the cobertura.ser file under project Cobetura-Java-Coverage-Report

Now go to the cobertura_java_project project:
Right click on the CoberturaJavaApp.java then Run as > run Configuration
Enter the main class: tutorialbyexample.cobertura.com.CoberturaJavaApp
Click on the Argument tab: -Dnet.sourceforge.cobertura.datafile=C:/Users/workspace/Cobetura-Java-Coverage-Report/cobertura.ser
In calss path add the:
  asm-5.0.1.jar
  asm-analysis-5.0.1.jar
  asm-commons-5.0.1.jar
  asm-tree-5.0.1.jar
  asm-util-5.0.1.jar
  cobertura-2.1.1-javadoc.jar
  cobertura-2.1.1-sources.jar
  cobertura-2.1.1.jar
  commons-lang3-3.3.2.jar
  hamcrest-core-1.3.jar
  jaxen-1.1.4.jar
  jetty-6.1.14.jar
  jetty-util-6.1.14.jar
  junit-4.11.jar
  logback-classic-1.0.13.jar
  logback-core-1.0.13.jar
  oro-2.0.8.jar
  servlet-api-2.5-6.1.14.jar
  slf4j-api-1.7.5.jar

Click on the apply
Click on the run
Output:
16:11:21,236 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
16:11:21,236 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
16:11:21,237 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
16:11:21,237 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
16:11:21,237 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
16:11:21,237 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1.jar!/logback.xml]
16:11:21,251 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@8bf135 - URL [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
16:11:21,293 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:11:21,301 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:11:21,308 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:11:21,324 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:11:21,352 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
16:11:21,352 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
16:11:21,352 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:11:21,353 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:11:21,354 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@1890c67 - Registering current configuration as safe fallback point

Welcome Vinod to learning Cobertura!!!
[INFO] Cobertura: Loaded information on 1 classes.
[INFO] Cobertura: Saved information on 1 classes.

Again go the the Cobetura-Java-Coverage-Report
Go the the ant view and click on the GenerateHTMLReport

Buildfile: C:\Users\workspace\Cobetura-Java-Coverage-Report\build.xml
GenerateHTMLReport:
   [delete] Deleting directory C:\Users\workspace\Cobetura-Java-Coverage-Report\htmlReports
    [mkdir] Created dir: C:\Users\workspace\Cobetura-Java-Coverage-Report\htmlReports
[cobertura-report] 16:12:51,916 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[cobertura-report] 16:12:51,916 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[cobertura-report] 16:12:51,917 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-report] 16:12:51,917 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
[cobertura-report] 16:12:51,917 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-report] 16:12:51,917 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1.jar!/logback.xml]
[cobertura-report] 16:12:51,947 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@3ec403 - URL [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
[cobertura-report] 16:12:51,980 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[cobertura-report] 16:12:51,986 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[cobertura-report] 16:12:51,998 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[cobertura-report] 16:12:52,013 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
[cobertura-report] 16:12:52,053 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
[cobertura-report] 16:12:52,054 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
[cobertura-report] 16:12:52,054 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[cobertura-report] 16:12:52,054 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[cobertura-report] 16:12:52,056 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@b6dfa8 - Registering current configuration as safe fallback point
[cobertura-report] 16:12:52,225 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[cobertura-report] 16:12:52,225 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[cobertura-report] 16:12:52,225 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-report] 16:12:52,225 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
[cobertura-report] 16:12:52,225 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml]
[cobertura-report] 16:12:52,225 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1.jar!/logback.xml]
[cobertura-report] 16:12:52,239 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@8bf135 - URL [jar:file:/C:/Users/workspace/Cobetura-Java-Coverage-Report/lib/cobertura-2.1.1-sources.jar!/logback.xml] is not of type file
[cobertura-report] 16:12:52,281 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[cobertura-report] 16:12:52,289 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[cobertura-report] 16:12:52,295 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[cobertura-report] 16:12:52,309 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
[cobertura-report] 16:12:52,336 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [net.sourceforge.cobertura] to INFO
[cobertura-report] 16:12:52,336 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
[cobertura-report] 16:12:52,336 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[cobertura-report] 16:12:52,336 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[cobertura-report] 16:12:52,337 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@1890c67 - Registering current configuration as safe fallback point
[cobertura-report] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura-report] [INFO] Cobertura: Loaded information on 1 classes.
[cobertura-report] Report time: 80ms
BUILD SUCCESSFUL
Total time: 1 second

Report has been generated:
Right click on the htmlReports under Cobetura-Java-Coverage-Report
Properties then copy the location: C:\Users\workspace\Cobetura-Java-Coverage-Report\htmlReports













Double click on the index.html














Have good day ahead!!!