Hi Marc,

I have configured the JaCoCo agent for the JVM where your classes under
test are actually executed.


PFA Plugins_Services and Plugins_Jacoco for the plugins I have configured
in the pom.xml for the maven sure fire, maven fail safe and jacoco maven
plugin.



I have configured the jacoco agent pointing during run time before
execution of integration tests in the maven fail safe plugin in the
following way:


 <configuration>
       <!-- Sets the VM argument line used when integration tests are run.
-->
       <argLine>${failsafeArgLine}</argLine>
  </configuration>


But as the reports generated for Junit test cases as well as integration
tests I am able to figure out a small difference:


1. For the HTML report generated for the Junit test cases I am able to see
the java classes which were executed while execution of java test classes
but not able to see the Test java classes.


2.For the HTML report generated for the Integration test cases I am not
able to see the java classes which were executed while execution of java
test classes but able to see the Test java classes.


Please let me know your suggestions.


Thanks,

Sravan Kumar

On Wed, Nov 26, 2014 at 10:57 PM, Marc R. Hoffmann <
[email protected]> wrote:

> Hi Sravan,
>
> you need to make sure that you configure the JaCoCo agent for the JVM
> where your classes under test are actually executed, in your case the JBoss
> container.
>
> Regards,
> -marc
>
> On 26.11.14 06:47, [email protected] wrote:
>
>> Hi Marc,
>>
>> Thanks for the explaination.
>>
>> When i see the sessions link in the HTML report generated it lists down
>> only the integration tests classes with the ids that got executed,but i
>> didn't get the code coverage for the integration tests.
>>
>> Coming to in detailed information of integration tests these will be make
>> use of the JBoss container for execution and in built h2 database for data
>> setup for execution of integration tests.
>>
>> Thanks,
>> Sravan Kumar Indupuri
>>
>> On Tuesday, November 25, 2014 8:20:26 PM UTC+5:30, Marc R. Hoffmann wrote:
>>
>>> Have you performed the checks described in the FAQ? What are your
>>> observations?
>>>
>>> http://www.eclemma.org/jacoco/trunk/doc/faq.html
>>>
>>>
>>> Q: Why does a class show as not covered although it has been executed?
>>>
>>> A: First make sure execution data has been collected. For this select
>>> the Sessions link on the top right corner of the HTML report and check
>>> whether the class in question is listed. If it is listed but not linked
>>> the class at execution time is a different class file. Make sure you're
>>> using the exact same class file at runtime as for report generation.
>>> Note that some tools (e.g. EJB containers, mocking frameworks) might
>>> modify your class files at runtime. Please see the chapter about class
>>> ids for a detailed discussion.
>>>
>>>
>>> Best regards,
>>> -marc
>>>
>>>
>>>
>>> On 2014-11-25 10:05, sri priyanka wrote:
>>>
>>>> I am attaching the pom.xml that we have used to generate
>>>> jacoco-it.exec and also the index.html file generated after executing
>>>> the above command(sonar step).
>>>>
>>>> On Tue, Nov 25, 2014 at 1:53 PM, <[email protected]> wrote:
>>>>
>>>>  Hi Team,
>>>>>
>>>>> We are not able to get IT code coverage using Jacoco.
>>>>>
>>>>> IT coverage is shown as 0.0% in sonar dashboard.
>>>>>
>>>>> As a first step we have generated jacoco-it.exec file and executed
>>>>> the below command to get the coverage on sonar dashboard.
>>>>>
>>>>> mvn
>>>>>
>>>>>  -Dsonar.jacoco.itReportPath="E:BuildAgentworkb8f0a63c1c75b440
>>>> servicesbranchesphase_1_iteration_3targetjacoco-it.exec"
>>>>
>>>>> sonar:sonar -Dsonar.dynamicAnalysis=reuseReports
>>>>>
>>>>> Please note that it is a multi module project and we need IT
>>>>> coverage for a particular module.
>>>>>
>>>>> Kindly help us in resolving this issue and let me know if any
>>>>> further information is needed.
>>>>>
>>>>> Thanks,
>>>>> Sri Priyanka
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to a topic in
>>>>> the Google Groups "JaCoCo and EclEmma Users" group.
>>>>> To unsubscribe from this topic, visit
>>>>> https://groups.google.com/d/topic/jacoco/3VzuqP4EHTs/unsubscribe
>>>>> [1].
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> [email protected].
>>>>> To view this discussion on the web visit
>>>>>
>>>>>  https://groups.google.com/d/msgid/jacoco/41285386-475f-
>>>> 4ec1-b925-e3969fc4d503%40googlegroups.com
>>>>
>>>>> [2].
>>>>> For more options, visit https://groups.google.com/d/optout [3].
>>>>>
>>>>   --
>>>>   You received this message because you are subscribed to the Google
>>>> Groups "JaCoCo and EclEmma Users" group.
>>>>   To unsubscribe from this group and stop receiving emails from it,
>>>> send an email to [email protected].
>>>>   To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jacoco/CANbHXxAvgpAoEjufaOO3Kvqdr3jK4
>>>> Ld-x%2BxtJKAf6uOOaVB_vQ%40mail.gmail.com
>>>> [4].
>>>>   For more options, visit https://groups.google.com/d/optout [3].
>>>>
>>>>
>>>> Links:
>>>> ------
>>>> [1] https://groups.google.com/d/topic/jacoco/3VzuqP4EHTs/unsubscribe
>>>> [2]
>>>> https://groups.google.com/d/msgid/jacoco/41285386-475f-
>>>> 4ec1-b925-e3969fc4d503%40googlegroups.com
>>>> [3] https://groups.google.com/d/optout
>>>> [4]
>>>> https://groups.google.com/d/msgid/jacoco/CANbHXxAvgpAoEjufaOO3Kvqdr3jK4
>>>> Ld-x%2BxtJKAf6uOOaVB_vQ%40mail.gmail.com?utm_medium=
>>>> email&utm_source=footer
>>>>
>>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jacoco/3VzuqP4EHTs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jacoco/54760D6C.3070102%40mountainminds.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAJEFfU2C7-JpovkQDy6B2_C57qi6us85mHvg4VTJOevuZ-RVHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>${jacocoMavenPluginVersion}</version>
  <executions>
        <execution>
      <id>prepare-unit-test-agent</id>
        <goals>
          <goal>prepare-agent</goal>
        </goals>
    </execution>
    <execution>
      <id>generate-unit-test-report</id>
        <goals>
          <goal>report</goal>
        </goals>
    </execution>
    <execution>
         <id>jacoco-initialize</id>
      <phase>pre-integration-test</phase>
      <goals>
        <goal>prepare-agent-integration</goal>
      </goals>
          <configuration>
                <!-- Sets the path to the file which contains the execution 
data. -->
                <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                <!--
                    Sets the name of the property containing the settings
                    for JaCoCo runtime agent.
                -->
                <propertyName>failsafeArgLine</propertyName>
            </configuration>
    </execution>
    <execution>
      <id>report</id>
          <phase>verify</phase>
      <goals>
        <goal>report-integration</goal>
      </goals>
          <configuration>
                <!-- Sets the path to the file which contains the execution 
data. -->
                <dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
                <!-- Sets the output directory for the code coverage report. -->
                
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
            </configuration>
    </execution>
  </executions>
</plugin>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAJEFfU2C7-JpovkQDy6B2_C57qi6us85mHvg4VTJOevuZ-RVHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
<plugins>
                        <!-- Maven Sure fire plugin 
${mavenSurefirePluginVersion} =2.17 used for 
                                JUnit Test Cases -->
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
                                <version>${mavenSurefirePluginVersion}</version>
                                <configuration>
                                                        <!-- Sets the VM 
argument line used when integration tests are run. -->
                                                        
<argLine>${surefireArgLine}</argLine>
                                                </configuration>
                        </plugin>

                        <!-- Maven fail safe plugin 
${mavenFailSafePluginVersion} =2.17 used for 
                                Integration Test Cases -->
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-failsafe-plugin</artifactId>
                                <version>${mavenFailSafePluginVersion}</version>
                                <executions>
                                        <execution>
                                                <id>integration-test</id>
                                                <goals>
                                                        
<goal>integration-test</goal>
                                                        <goal>verify</goal>
                                                </goals>
                                                <configuration>
                                                        <!-- Sets the VM 
argument line used when integration tests are run. -->
                                                        
<argLine>${failsafeArgLine}</argLine>
                                                </configuration>
                                        </execution>
                                </executions>
</plugin>
</plugins>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAJEFfU2C7-JpovkQDy6B2_C57qi6us85mHvg4VTJOevuZ-RVHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to