Just provide the *.ear file. JaCoCo traverses archive formats recursively and 
will find all jars and class files in the ear.
 

> On 4. Dec 2020, at 18:46, abhay hegde <[email protected]> wrote:
> 
> Hi Marc,
> 
> thank you, for clearing that up! Another question :)
> 
> 1. As per JaCoco document,the --classfiles=<path_to_production_code_jar_file> 
> supports multiple jar files. Since all my jars are bundled inside the 
> application.ear , how do I provide those as argument?.
> 
> Regards
> Abhay
> 
> 
> On Fri, Dec 4, 2020 at 12:55 PM Marc Hoffmann <[email protected] 
> <mailto:[email protected]>> wrote:
> Hi Abhay,
> 
> this looks like the correct approach. It is always two steps:
> 
> 1) Collect execution data on the JVM that runs the production code using the 
> JaCoCo agent
> 2) Create coverage report from the exec file(s) from step 1) and the same 
> class files used in step 1)
> 
> Glad to hear that this works for you!
> 
> Regards,
> -marc
> 
>> On 4. Dec 2020, at 06:50, Abhay Hegde <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> I have tried the following, please correct me if I am wrong:
>> 
>> 1. export 
>> JAVA_OPTS=-javaagent:<path_to>/jacocoagent.jar=destfile=<path_to>/jacoco-it.exec
>> 2. Start JBoss server.
>> 3. Run the Integration test using maven.
>> 4. Stop the JBoss server.
>> 5. Run the command:
>> java -jar <path_to>/jacococli.jar report <path_to>/jacoco-it.exec 
>> --classfiles=<path_to_production_code_jar_file> 
>> --csv=coverage-reports/report_in_csv
>> Above step will update the jacoco-it.exec with all the instrumented classes.
>> 6. Coverage report will be present in report_in_csv given in Step 5.  
>> 
>> Thanks
>> Abhay
>> 
>> 
>> On Wednesday, December 2, 2020 at 11:36:04 AM UTC+5:30 Abhay Hegde wrote:
>> I have an MyApp.ear containing production code and a test.war containing 
>> end-to-end test code deployed in the same JBoss server on the same host 
>> machine.
>> 
>> MyApp.ear accepts MQ messages and returns the output.
>> 
>> test.war sends the MQ messages and asserts the output.
>> 
>> Both production and test application is built using maven. I am using jacoco 
>> 0.8.5 for code coverage. 
>> 
>> An end-to-end test is invoked as below in the command line: 
>> 
>> $mvn clean verify -DJBOSS_HOME=<path_to_jboss_dir> 
>> -f=integration-test/pom.xml jacoco:prepare-agent jacoco:report sonar:sonar 
>> -Dsonar.skip=false -Dit.test=com.mypackage.name.EndToEndTest 
>> 
>> 
>> 
>> Test execution flow is as below:
>> 
>> A test class sends the MQ messages to the MQs that are configured in the 
>> host.
>> Production class (MyApp.ear)   listens to the queue and accepts the MQ 
>> messages for processing.
>> Processed output is asserted by the test class using Junit.
>>  Questions:
>> 
>> Is it possible to obtain the code coverage of my production classes when i 
>> run the End to end test ?
>> If yes, would appreciate if you could point out few key things to be done.
>> Thanks
>> Abhay
>> 
>> 
>> 
>> -- 
>> 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] 
>> <mailto:[email protected]>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jacoco/a6311112-d720-41c7-b159-f132e3312e5cn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jacoco/a6311112-d720-41c7-b159-f132e3312e5cn%40googlegroups.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/0QkOV5u1w6Y/unsubscribe 
> <https://groups.google.com/d/topic/jacoco/0QkOV5u1w6Y/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/9B08C031-3069-49A7-96B6-8EBB6F51BFA1%40mountainminds.com
>  
> <https://groups.google.com/d/msgid/jacoco/9B08C031-3069-49A7-96B6-8EBB6F51BFA1%40mountainminds.com?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> LinkedIN - Abhay Hegde 
> <https://www.linkedin.com/profile/view?id=112287538&trk=nav_responsive_tab_profile>Contact:-
>  +91 9000011822
> Skype - abhayhegde
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/CAHcMQNmhUePRjokay8JZzuwU4AejMTrmVKx8DZuOj_8TPR34Vw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/jacoco/CAHcMQNmhUePRjokay8JZzuwU4AejMTrmVKx8DZuOj_8TPR34Vw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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/E7777F07-E079-4728-83CB-20FC5D09D483%40mountainminds.com.

Reply via email to