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,

Dominic


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
there: https://dev.eclipse.org/mhonarc/lists/ide-dev/msg01084.html

2) You can use anything already in the CDT.target platform easily as
all the CQs have been filled for them. If what you need is not in
CDT.target 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 CDT.target, 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
away.

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.

[1] http://download.eclipse.org/tools/orbit/downloads/drops/S20160916162009/repository/
is the URL in CDT.target

Thanks and I hope that helped,
Jonah
~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com


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
https://bugs.eclipse.org/bugs/show_bug.cgi?id=507148.

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
tests


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,
Dominic





Back to the top