IJavaModelCoverage -> getProjects empty

11 views
Skip to first unread message

Mario Ackerl

unread,
Jul 6, 2020, 7:03:40 AM7/6/20
to JaCoCo and EclEmma Users
Hi,

while running JUnit Tests with coverage I got empty csv files (only header) when writing them down, but exec files were written with content. 
When I look into coverage view in eclipse the elemnts also stay empty. However if I re-import a written exec file it gets populated.image-2020-07-06-11-24-52-364.png


The reason seems to be that IJavaModelCoverage->getProjects() returns an empty IJavaProject array. What could be the reasons?

Thanks,

Mario

Marc Hoffmann

unread,
Jul 6, 2020, 8:11:28 AM7/6/20
to jac...@googlegroups.com
Hallo Mario,

can you please explain step by step what you are doing to get the CSV file?

Cheers,
-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/7fb9bb0f-6191-4035-9cbf-4e2d8648b48fo%40googlegroups.com.

Mario Ackerl

unread,
Jul 13, 2020, 5:07:10 AM7/13/20
to JaCoCo and EclEmma Users
Hi Marc,

I will try to get the major pieces:)
First of all background - we are talking about an enterprise application using an development environment based on eclipse. The build system is using https://www.eclipse.org/tea/
We also program within the IDE some pieces (like starting a unit test or recording coverage) - and the IDE is also used in headless mode as the eclipse build is not possible without. 

First step is to record coverage by using a CoverageLaunch





Then there is an ISessionListener implemented that stores the ICoverageSessions on "sessionAdded".

Finally those sessions are added to an ISessionManager and the sessions are written to disk



with coverageReportWriter containing




I hope that makes things clearer :)

Thanks,

Mario


Am Montag, 6. Juli 2020 14:11:28 UTC+2 schrieb Marc R. Hoffmann:
Hallo Mario,

can you please explain step by step what you are doing to get the CSV file?

Cheers,
-marc


On 6. Jul 2020, at 13:03, Mario Ackerl <mario...@gmail.com> wrote:

Hi,

while running JUnit Tests with coverage I got empty csv files (only header) when writing them down, but exec files were written with content. 
When I look into coverage view in eclipse the elemnts also stay empty. However if I re-import a written exec file it gets populated.image-2020-07-06-11-24-52-364.png


The reason seems to be that IJavaModelCoverage->getProjects() returns an empty IJavaProject array. What could be the reasons?

Thanks,

Mario

--
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 jac...@googlegroups.com.

Mario Ackerl

unread,
Jul 13, 2020, 5:50:18 AM7/13/20
to JaCoCo and EclEmma Users
Hi,

while writing down I found the answer ... our problem is at the beginning .. when selecting the plugins. .. So can be closed :)

Thanks,

Mario

Marc Hoffmann

unread,
Jul 13, 2020, 6:09:23 AM7/13/20
to jac...@googlegroups.com
Ok, glad you found it!

Cheers,
-marc

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/3198f0ce-26ac-4693-89bd-c664a7eeb178o%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages