Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Contribution for Bug 507148 (codan)

Hi Jonah,

thanks for your quick response :)

For this particular contribution I will just use mockito, it won't be a

problem to refactor the code later to use DI. I will contribute another

patch soon.

Best regards,


Am 10.11.2016 um 11:49 schrieb Jonah Graham:
Hi Dominic,

I am very pleased to hear you are adding tests for this. As I am sure
you are aware adding the first tests for a kind of a feature can be
the hardest to do I appreciate the effort you are having to put in!

To answer your specific questions.

1) Sounds right to me.

There has been previous debate on fragment vs. plug-in. AFAIK CDT has
followed the lead on the platform. There was a recent discussion

2) You can use anything already in the platform easily as
all the CQs have been filled for them. If what you need is not in but is already in Orbit [1] we need to apply for an orbit
piggyback CQ. If what you need is in neither, we need to create new CQ
and add it to orbit. The version numbers matter.

So, Mockito 1.9.5 is in, so we are good to go there.
Google Guice 3.0.0 is in Orbit, so if you want to use that I can apply
for the CQ for CDT. That may delay slightly when the test can be
merged in, but we can split the gerrit so that the fix can go in right

Therefore, if DI makes the test code better I am personally for it.
While the gerrit can't be merged to master until CQs are done, you can
submit the gerrit right away.

Finally, this is a good email for cdt-dev as I think the whole
community benefits from seeing these discussions. If you are ok with
that, please reply to this email on cdt-dev@xxxxxxxxxxx.

is the URL in

Thanks and I hope that helped,
Jonah Graham
Kichwa Coders Ltd.

On 10 November 2016 at 10:25, Dominic Scharfe
<dominic.scharfe@xxxxxxxxxxxxxxx> wrote:
Hella Elena, Hello Jonah,

sorry to bother you, but I have some questions regarding my contribution for

I'd like to write unit tests, so I would:

1) Create a new plugin org.eclipse.cdt.codan.checkers.ui.test

Just like the existing plugin org.eclipse.cdt.codan.core.test (I'd usually
use a fragment, but for consistency I'd use a plugin, which is okay too)

2) Use guice for DI and mockito for mocking. However I don't see them beeing
used anywhere in codan. I can avoid using DI, but I need mockito for my

Are there any guidelines for testing? I couldn't find any, that's why I am
asking you, I hope that's okay.

Thanks and best regards,

Back to the top