Ant Jacoco hybris

1,209 views
Skip to first unread message

Mark Lübbe

unread,
Sep 19, 2017, 5:13:13 AM9/19/17
to JaCoCo and EclEmma Users
Hello,

at this time we are using Cobertura(cobertura-instrument, cobertura-coverage ) and yunit (allwebtest and alltests) from the hybris platform and in the future we want to use jacoco with hybris.

Ho can continue to use the hybris ant tasks (alltests and allwebtests) and still use jacoco?

Unfortunately, I found no suitable documentation about it.

I cannot run the junit task inside of the jacoco:coverage task, because I want to use the hybris tasks yunit.

Which tasks of jacoco I have to use?


The following link I have seen, but I find no helpful information.


thanks,
Mark

 



 

Marc Hoffmann

unread,
Sep 19, 2017, 7:14:46 AM9/19/17
to jac...@googlegroups.com

Hi Mark,

I think you asked this question before. My answer was:

https://groups.google.com/d/msg/jacoco/jK8vXyDUEwI/79tvhgpEqtEJ

Regards,
-marc

--
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 jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/c887317b-367d-4a3e-be93-a785ad1caa38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Mark Lübbe

unread,
Sep 19, 2017, 8:34:02 AM9/19/17
to JaCoCo and EclEmma Users
Hi Marc,

yes you are right and my answer was



3 years ago it was only a test, but now we have to use jacoco, because sonarqube > 6.3 only supports jacoco

actually I use the following task to instrument my classes

<jacoco:instrument destdir="bin/extension/classes-backup" xmlns:jacoco="antlib:org.jacoco.ant">
<fileset dir="bin/extension/classes" includes="**/*.class"/>
</jacoco:instrument>

You are talking about the agent. How can I use them after instrumenting the files?

Can I use the jacoco:coverage task?

Thanks ,
Mark

Marc Hoffmann

unread,
Sep 19, 2017, 9:10:03 AM9/19/17
to jac...@googlegroups.com

Hi Mark,

JaCoCo supports two modes:

1) Either JaCoCo Java agent (with on-the-fly instrumentation)
2) Or offline instrumentation

As stated in our documentation 1) is recommended. So no need to instrument class files.

So the only thing you need to do is to configure the JaCoCo agent for your test execution.

As the "coverage" task does not support yunit you can create the agent parameter with the "agent" task and store it in a Ant property. Then for the yunit task you need to add this to the JVM command line (please check yunit documentation for this).

Regards,
-marc

Mark Lübbe

unread,
Sep 22, 2017, 4:18:11 AM9/22/17
to JaCoCo and EclEmma Users
Hi Marc,

thanks for your help :-)

I solved the problem. If someone else has a problem with jacoco and hybris, please write me a private message.

Regards,
Mark

Marc Hoffmann

unread,
Sep 22, 2017, 4:28:34 AM9/22/17
to jac...@googlegroups.com

Great!

What about sharing your solution here?

Cheers,
-marc

sudhe...@gmail.com

unread,
May 8, 2018, 5:24:34 AM5/8/18
to JaCoCo and EclEmma Users
Hi Mark,

Could you please provide the steps to generate the Code Coverage for the Hybris projects using Sonar and jacoco after junit tests.
It would be helpful.

Regards,
Sudheer.

Marc Hoffmann

unread,
May 8, 2018, 5:50:17 AM5/8/18
to jac...@googlegroups.com
Hi Sudheer,

SonarQube and its JaCoCo integration is a separate project.

Please check their documentation and support channels:
https://www.sonarqube.org/

Regards,
-marc
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages