ArcBees / Jukito

The combined power of JUnit, Guice and Mockito. Plus it sounds like a cool martial art.
http://jukito.arcbees.com/
Other
270 stars 33 forks source link

tests in groovy #32

Open przemekgalazka opened 11 years ago

przemekgalazka commented 11 years ago

Hi :) lately I was doing some groovy tests and I think that using Jukito in groovy test would be very cool.

What do you think?

DI with Guice in Groovy described here http://blog.stannard.net.au/2010/05/18/dependency-injection-with-groovy-and-google-guice/

christiangoudreau commented 11 years ago

Would be very cool! What is the adoption of Guice in Groovy like?

przemekgalazka commented 11 years ago

the adoptions is ok, and just work according to info in this post http://blog.stannard.net.au/2010/05/18/dependency-injection-with-groovy-and-google-guice/

I just wonder about our custom JunitRunner

olafleur commented 10 years ago

@przemekgalazka Is that a feature request? Do you want to do it?

przemekgalazka commented 10 years ago

hmmm. Right now I am quite sure that jukito could be used with junit tests written in groovy right away.

However, a spock extension should be a good idea.

christiangoudreau commented 10 years ago

Did you got a chance to investigate this? We're not using groovy at all (yet), so we're kinda short on testing resources for that.

przemekgalazka commented 9 years ago

Lately I was doing a lot Spock tests (pure groovy). I must say that mocking in Spock is strange and Jukito features like automocking with mockito would be very cool. So to sum up, Jukito should be good to go with pure junit tests in groovy. Spock extension supporting guice could be armed with automocking too. Btw, I liked Jukito idea so much that I did similar solution for Spring https://github.com/przemekgalazka/irmina

christiangoudreau commented 9 years ago

Seems like a good idea! The problem is that we don't have anyone in the team that worked a lot with Groovy.

As for spring, it would be great to support some of this natively. We're also using extensively spring in a lot of projects. Since we're using Javax annotations and ctor injection, we never really had to botter about spring annotations. Any use case besides using Config class from spring instead of Guice modules?

Cheers,

Christian Goudreau | CEO - Président M: 1.877.635.1585 ArcBees http://www.arcbees.com/ | Blog http://blog.arcbees.com/ | Facebook https://www.facebook.com/arcbees | LinkedIn http://www.linkedin.com/company/arcbees

On Sun, Feb 15, 2015 at 10:27 AM, Przemek Galazka notifications@github.com wrote:

Lately I was doing a lot Spock tests (pure groovy). I must say that mocking in Spock is strange and Jukito features like automocking with mockito would be very cool. So to sum up, Jukito should be good to go with pure junit tests in groovy. Spock extension supporting guice could be armed with automocking too. Btw, I liked Jukito idea so much that I did similar solution for Spring https://github.com/przemekgalazka/irmina

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/Jukito/issues/32#issuecomment-74421691.

przemekgalazka commented 9 years ago

Try groovy just for fun. It's easy to use - 3 days and you are a master :) I did not get you question. What do you mean?

christiangoudreau commented 9 years ago

Well, we're heavily using Spring and Jukito without modifications to Jukito, I guess my question is: What are your use case that needs spring specific usage?

przemekgalazka commented 9 years ago

how can you do that? Could you give me some examples (jukito + spring) ? My use case is typical. Every spring tests that needs a few spring beans and mocks.

Pozdrawiam Przemek Gałązka

On Fri, Feb 20, 2015 at 5:06 PM, christiangoudreau <notifications@github.com

wrote:

Well, we're heavily using Spring and Jukito without modifications to Jukito, I guess my question is: What are your use case that needs spring specific usage?

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/Jukito/issues/32#issuecomment-75262955.

christiangoudreau commented 9 years ago

We simply use Javax annotations and use CTOR injection :D There's no "magic", but we can't use Spring config file doing that.

przemekgalazka commented 9 years ago

so with Irmina now you can :)

On Mon, Mar 2, 2015 at 2:29 PM, christiangoudreau notifications@github.com wrote:

We simply use Javax annotations and use CTOR injection :D There's no "magic", but we can't use Spring config file doing that.

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/Jukito/issues/32#issuecomment-76711271.

christiangoudreau commented 9 years ago

We had a discussion with the team yesterday about that and it ended up into our nice to have feature list. I'm wondering it there would be more non intrusive way of doing it while using the JukitoRunner.

What do you think?

przemekgalazka commented 9 years ago

At first I was thinking about adding this feature to Jukito. But it's appeared that it is not about runner but spring custom ContextLoader. It is dooable but is it worth to complicate jukito so much?

On Tue, Mar 10, 2015 at 6:58 PM, christiangoudreau <notifications@github.com

wrote:

We had a discussion with the team yesterday about that and it ended up into our nice to have feature list. I'm wondering it there would be more non intrusive way of doing it while using the JukitoRunner.

What do you think?

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/Jukito/issues/32#issuecomment-78110627.

christiangoudreau commented 9 years ago

I'm really not sure, but that would go along the road of using other DI configuration files. I don't really want to use Spring context loader, but read a config file and do the appropriate mapping as if I would use "install".

But I may be overthinking it and it may be not useful at all. The other DI framework that I would like to support would be Dagger.

przemekgalazka commented 9 years ago

hmm, only common thing here is mocks register so this could be overthinking :)

On Wed, Mar 11, 2015 at 1:37 PM, christiangoudreau <notifications@github.com

wrote:

I'm really not sure, but that would go along the road of using other DI configuration files. I don't really want to use Spring context loader, but read a config file and do the appropriate mapping as if I would use "install".

But I may be overthinking it and it may be not useful at all. The other DI framework that I would like to support would be Dagger.

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/Jukito/issues/32#issuecomment-78254772.

RaviH commented 9 years ago

+1 for Jukito port to Spock with Guice injections!