Hi

You were right... there is a issue with powemock, PFA pom snippet which
worked for me. we added the instrumentation goal and exclude closure
classes etc.

I am running it as mvn clean verify install

Thanks
Shantanoo Kirtane

On 8 June 2015 at 16:17, Evgeny Mandrikov <[email protected]> wrote:

> If we'll take as an example package "com.wdpr.payment.delegate", then
> according to "sessions.html" it wasn't seen by JaCoCo agent during
> execution.
>
> Possible reason for that - seems that you're using PowerMock and known
> that it doesn't play well with online instrumentation performed by JaCoCo.
> I didn't played enough with PowerMock to say for sure, but suspect that
> offline instrumentation might help, there also some mentions of this in
> internet.
>
> For an example of configuration for offline instrumentation consult with
> documentation - http://www.eclemma.org/jacoco/trunk/doc/index.html
>
> Don't hesitate to report back if this helped or not.
>
> Best regards
>
> On Monday, June 8, 2015 at 9:00:30 PM UTC+2, SHANTANOO KIRTANE wrote:
>>
>> Hi
>>
>> Attaching the data for your reference.
>>
>> Note: Just unzip the file and put it in same folder as this .html
>>
>> On 8 June 2015 at 14:27, Evgeny Mandrikov <mandrikov@...> wrote:
>>
>>> Hi,
>>>
>>> Yes, the report page, and especially info about classes from sessions
>>> page - see http://www.eclemma.org/jacoco/trunk/coverage/.sessions.html
>>> as example.
>>>
>>> On Monday, June 8, 2015 at 8:19:37 PM UTC+2, SHANTANOO KIRTANE wrote:
>>>>
>>>> Hi
>>>>
>>>> Please find my answers below.
>>>>
>>>>
>>>>
>>>> On 6 June 2015 at 17:08, Evgeny Mandrikov <mandrikov@...> wrote:
>>>>
>>>>> Hi Shantanoo,
>>>>>
>>>>> Some questions in order to help you investigate the issue:
>>>>>
>>>>>    - Are those packages located in the same module?
>>>>>
>>>>> [Shantanoo] Yes
>>>>
>>>>>
>>>>>    -
>>>>>    - Could you provide some screenshots demonstrating problem?
>>>>>
>>>>> [Shantanoo] Which screen shots are you interested in? the report page
>>>>
>>>>>
>>>>>    - Do you confirm that classes from those packages are available in
>>>>>    "target/classes" directory, when "jacoco:report" is executed?
>>>>>
>>>>> [Shantanoo] Yes
>>>>
>>>>> Best regards,
>>>>> Evgeny Mandrikov
>>>>>
>>>>> On Thursday, June 4, 2015 at 5:59:57 PM UTC+2, shantanookirtane@...
>>>>> wrote:
>>>>>>
>>>>>> Below is my maven configuration.
>>>>>>
>>>>>> <plugin>
>>>>>>
>>>>>> <groupId>org.apache.maven.plugins</groupId>
>>>>>>
>>>>>> <artifactId>maven-surefire-plugin</artifactId>
>>>>>>                                  <version>2.18</version>
>>>>>>                                  <configuration>
>>>>>>                                  <!-- Sets the VM argument line used
>>>>>> when unit tests are run. -->
>>>>>>                                          <argLine>-Xms512m -Xmx1024m
>>>>>> -XX:MaxPermSize=512m ${jacoco.agent.argLine}</argLine>
>>>>>>                                  </configuration>
>>>>>>                          </plugin>
>>>>>>                          <plugin>
>>>>>>                                 <groupId>org.jacoco</groupId>
>>>>>>                                 
>>>>>> <artifactId>jacoco-maven-plugin</artifactId>
>>>>>>
>>>>>>                                 <version>0.7.5.201505241946</version>
>>>>>>                                 <configuration>
>>>>>>
>>>>>>                          <dataFile>target/jacoco.exec</dataFile>
>>>>>>                         </configuration>
>>>>>>                                 <executions>
>>>>>>                                 <execution>
>>>>>>                                     <id>pre-unit-test</id>
>>>>>>                                     <goals>
>>>>>>                                         <goal>prepare-agent</goal>
>>>>>>                                     </goals>
>>>>>>                                     <configuration>
>>>>>>
>>>>>>                  <propertyName>jacoco.agent.argLine</propertyName>
>>>>>>
>>>>>>                  <destFile>target/jacoco.exec</destFile>
>>>>>>                                                   </configuration>
>>>>>>                                 </execution>
>>>>>>                                <execution>
>>>>>>                                                 <id>default-report</id>
>>>>>>
>>>>>>                                                 <phase>test</phase>
>>>>>>                                                 <goals>
>>>>>>                                                 <goal>report</goal>
>>>>>>                                                 </goals>
>>>>>>                                         </execution>
>>>>>>                                 </executions>
>>>>>>                          </plugin>
>>>>>>
>>>>>>
>>>>>>
>>>>>> When I run using maven
>>>>>>
>>>>>> i.e. clean test
>>>>>>
>>>>>> after this it creates the jacoco.exec file then I run
>>>>>>
>>>>>> jacoco:report and it generates the resport but for except one package
>>>>>> for all other it shows 0% code coverage which is not the case. when I run
>>>>>> the same report using cobertura it shows non 0% code coverage for those
>>>>>> packages.
>>>>>>
>>>>>> Any Idea what is wrong here.
>>>>>>
>>>>>> Thanks
>>>>>> Shantanoo K
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Thanks & Regards,
>>>> Shantanoo Kirtane
>>>>
>>>
>>
>>
>> --
>> Thanks & Regards,
>> Shantanoo Kirtane
>>
>


-- 
Thanks & Regards,
Shantanoo Kirtane

-- 
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/CAJ%2BRX%2B9AtUsDC%2BrokmZQtTu%2BFW4Em1FfKHhR%2Bs8CRBu3pkN%2B%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
<plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-surefire-plugin</artifactId>
             <version>2.18</version>
         		 <executions>
					<execution>
						<id>default-test</id>
						<phase>test</phase>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<systemPropertyVariables>
								<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
							</systemPropertyVariables>
							<forkMode>once</forkMode>
							<argLine>-Xms1024m -Xmx2048m -XX:MaxPermSize=1024m</argLine>
				
							<excludes>
								<exclude>META-INF/*.SF</exclude>
								<exclude>**/StratusAuthTemplateProviderTest.class</exclude>
								<exclude>**/StratusBalanceInquiryTemplateProviderTest.class</exclude>
								<exclude>**/PersistCardAuthDetailsForRefundProcessorTest.class</exclude>
								<exclude>**/PersistCardTxnDetailsProcessorTest.class</exclude>
								<exclude>**/StratusAuthProcessorTest.class</exclude>
								<exclude>**/UpdateTxnStatusTest.class</exclude>
								<exclude>**/RulesTest.class</exclude>
								<exclude>**/SampleRulesTest.class</exclude>
								<exclude>**/RefundUpdatePmtTxnConfirmationProcessorTest.class</exclude>
								<exclude>**/vo/*.class</exclude>
								<exclude>**/outbound/*.class</exclude>
								<exclude>**/notification/*.class</exclude>
							</excludes>
						</configuration>
					</execution>
				</executions>
         </plugin>
         <plugin> 
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.4.201502262128</version>
            <configuration>
                <excludes>
			        <exclude>com/wdpr/payment/data/mapper/*.class</exclude>
			        <exclude>**/*AjcClosure?.class</exclude>
			    </excludes>
            </configuration>
            <executions>
                <execution>
                    <id>default-instrument</id>
                    <goals>
                        <goal>instrument</goal>
                    </goals>
                </execution> 
                <execution>
                    <id>default-restore-instrumented-classes</id>
                    <goals>
                        <goal>restore-instrumented-classes</goal>
                    </goals>
                </execution>
               <execution>
                    <id>default-report</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>  
                <execution>
                    <id>default-check</id>
                    <goals>
                        <goal>check</goal>
                    </goals>
                    <configuration>
                        <rules>
                            <rule>
                                <element>METHOD</element>
                            </rule>
                        </rules>
                    </configuration>
                </execution>
            </executions>
         </plugin>

Reply via email to