Re: Guice + Mockito

2018-06-08 Thread yu via google-guice
Thank you for the suggestion, I'll take a look at it.

On Friday, June 8, 2018 at 12:53:14 AM UTC-7, David Nouls wrote:
>
> I had something similar implemented a few years ago. Indeed not difficult 
> to do.
>
> But I switched to Jukito because it offers a few advanced features:
> - Interfaces and abstract classes are automatically mocked (as a 
> singleton). In many cases you don’t need to define any binding if you use 
> interfaces for your injected dependencies.
> - you can have parameters on your test methods and these parameters are 
> automatically injected. This can even work on @Before methods.
> - Uses annotations to provide the modules to use (that would allow 
> defining your own bindings).
>
> Groeten,
> David
> On 8 Jun 2018, 09:46 +0200, yu via google-guice <
> google...@googlegroups.com >, wrote:
>
> The problem seemed simple enough, so I didn't bother looking for an 
> existing solution. It took less than a day and two iterations to get 
> everything I needed into the custom library. Of course, it took a lot 
> longer to make it look prettier. :)
>
> On Thursday, June 7, 2018 at 11:34:04 PM UTC-7, David Nouls wrote: 
>>
>> Never tried Jukito ? works great.
>> On 8 Jun 2018, 00:55 +0200, yu via google-guice <
>> google...@googlegroups.com>, wrote:
>>
>> 5 years late to the party. I ended up implementing my own library at my 
>> current company: 
>> https://eng.collectivehealth.com/introducing-testmodule-bdab286f12db.
>>
>> On Monday, November 4, 2013 at 8:09:29 AM UTC-8, Ari King wrote: 
>>>
>>> How can I mock injected dependencies in JUnit tests? Thanks.
>>>
>>
>>
>> Collective Health introduces the Employer-Driven Healthcare 
>> Economy 
>>
>> *This message may contain confidential, proprietary, or protected 
>> information.  If you are not the intended recipient, you may not review, 
>> copy, or distribute this message. If you received this message in error, 
>> please notify the sender by reply email and delete this message.* 
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "google-guice" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-guice...@googlegroups.com.
>> To post to this group, send email to google...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/google-guice.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-guice/ad0848e7-a545-4214-a4af-b174a5106b2f%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>
> Collective Health introduces the Employer-Driven Healthcare 
> Economy 
>
> *This message may contain confidential, proprietary, or protected 
> information.  If you are not the intended recipient, you may not review, 
> copy, or distribute this message. If you received this message in error, 
> please notify the sender by reply email and delete this message.* 
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-guice...@googlegroups.com .
> To post to this group, send email to google...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/google-guice.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-guice/e8380991-a1d2-4ec6-b407-533440452d6f%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
-- 


        Collective Health introduces the Employer-Driven Healthcare 
Economy 



_This message may 
contain confidential, proprietary, or protected information.  If you are 
not the intended recipient, you may not review, copy, or distribute this 
message. If you received this message in error, please notify the sender by 
reply email and delete this message._

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/1e2ec675-18df-4c7a-bd89-25490675bbb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Guice + Mockito

2018-06-08 Thread David Nouls
I had something similar implemented a few years ago. Indeed not difficult to do.

But I switched to Jukito because it offers a few advanced features:
- Interfaces and abstract classes are automatically mocked (as a singleton). In 
many cases you don’t need to define any binding if you use interfaces for your 
injected dependencies.
- you can have parameters on your test methods and these parameters are 
automatically injected. This can even work on @Before methods.
- Uses annotations to provide the modules to use (that would allow defining 
your own bindings).

Groeten,
David
On 8 Jun 2018, 09:46 +0200, yu via google-guice 
, wrote:
> The problem seemed simple enough, so I didn't bother looking for an existing 
> solution. It took less than a day and two iterations to get everything I 
> needed into the custom library. Of course, it took a lot longer to make it 
> look prettier. :)
>
> On Thursday, June 7, 2018 at 11:34:04 PM UTC-7, David Nouls wrote:
> > Never tried Jukito ? works great.
> > On 8 Jun 2018, 00:55 +0200, yu via google-guice 
> > , wrote:
> > > 5 years late to the party. I ended up implementing my own library at my 
> > > current company: 
> > > https://eng.collectivehealth.com/introducing-testmodule-bdab286f12db.
> > >
> > > On Monday, November 4, 2013 at 8:09:29 AM UTC-8, Ari King wrote:
> > > > How can I mock injected dependencies in JUnit tests? Thanks.
> > >
> > >
> > >         Collective Health introduces the Employer-Driven Healthcare 
> > > Economy
> > >
> > > This message may contain confidential, proprietary, or protected 
> > > information.  If you are not the intended recipient, you may not review, 
> > > copy, or distribute this message. If you received this message in error, 
> > > please notify the sender by reply email and delete this message.
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "google-guice" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to google-guice...@googlegroups.com.
> > > To post to this group, send email to google...@googlegroups.com.
> > > Visit this group at https://groups.google.com/group/google-guice.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/google-guice/ad0848e7-a545-4214-a4af-b174a5106b2f%40googlegroups.com.
> > > For more options, visit https://groups.google.com/d/optout.
>
>
>         Collective Health introduces the Employer-Driven Healthcare Economy
>
> This message may contain confidential, proprietary, or protected information. 
>  If you are not the intended recipient, you may not review, copy, or 
> distribute this message. If you received this message in error, please notify 
> the sender by reply email and delete this message.
> --
> You received this message because you are subscribed to the Google Groups 
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-guice+unsubscr...@googlegroups.com.
> To post to this group, send email to google-guice@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-guice.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-guice/e8380991-a1d2-4ec6-b407-533440452d6f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/9e7c6e19-3ea5-47bb-9e96-02d89648efe9%40Spark.
For more options, visit https://groups.google.com/d/optout.


Re: Guice + Mockito

2018-06-08 Thread yu via google-guice
The problem seemed simple enough, so I didn't bother looking for an 
existing solution. It took less than a day and two iterations to get 
everything I needed into the custom library. Of course, it took a lot 
longer to make it look prettier. :)

On Thursday, June 7, 2018 at 11:34:04 PM UTC-7, David Nouls wrote:
>
> Never tried Jukito ? works great.
> On 8 Jun 2018, 00:55 +0200, yu via google-guice <
> google...@googlegroups.com >, wrote:
>
> 5 years late to the party. I ended up implementing my own library at my 
> current company: 
> https://eng.collectivehealth.com/introducing-testmodule-bdab286f12db.
>
> On Monday, November 4, 2013 at 8:09:29 AM UTC-8, Ari King wrote: 
>>
>> How can I mock injected dependencies in JUnit tests? Thanks.
>>
>
>
> Collective Health introduces the Employer-Driven Healthcare 
> Economy 
>
> *This message may contain confidential, proprietary, or protected 
> information.  If you are not the intended recipient, you may not review, 
> copy, or distribute this message. If you received this message in error, 
> please notify the sender by reply email and delete this message.* 
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-guice...@googlegroups.com .
> To post to this group, send email to google...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/google-guice.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-guice/ad0848e7-a545-4214-a4af-b174a5106b2f%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
-- 


        Collective Health introduces the Employer-Driven Healthcare 
Economy 



_This message may 
contain confidential, proprietary, or protected information.  If you are 
not the intended recipient, you may not review, copy, or distribute this 
message. If you received this message in error, please notify the sender by 
reply email and delete this message._

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/e8380991-a1d2-4ec6-b407-533440452d6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Guice + Mockito

2018-06-08 Thread David Nouls
Never tried Jukito ? works great.
On 8 Jun 2018, 00:55 +0200, yu via google-guice 
, wrote:
> 5 years late to the party. I ended up implementing my own library at my 
> current company: 
> https://eng.collectivehealth.com/introducing-testmodule-bdab286f12db.
>
> On Monday, November 4, 2013 at 8:09:29 AM UTC-8, Ari King wrote:
> > How can I mock injected dependencies in JUnit tests? Thanks.
>
>
>         Collective Health introduces the Employer-Driven Healthcare Economy
>
> This message may contain confidential, proprietary, or protected information. 
>  If you are not the intended recipient, you may not review, copy, or 
> distribute this message. If you received this message in error, please notify 
> the sender by reply email and delete this message.
> --
> You received this message because you are subscribed to the Google Groups 
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-guice+unsubscr...@googlegroups.com.
> To post to this group, send email to google-guice@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-guice.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-guice/ad0848e7-a545-4214-a4af-b174a5106b2f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/a8be4b08-1bc2-4bdf-9ef3-397856d1ef59%40Spark.
For more options, visit https://groups.google.com/d/optout.


Re: Guice + Mockito

2018-06-07 Thread yu via google-guice
5 years late to the party. I ended up implementing my own library at my 
current 
company: https://eng.collectivehealth.com/introducing-testmodule-bdab286f12db.

On Monday, November 4, 2013 at 8:09:29 AM UTC-8, Ari King wrote:
>
> How can I mock injected dependencies in JUnit tests? Thanks.
>

-- 


        Collective Health introduces the Employer-Driven Healthcare 
Economy 



_This message may 
contain confidential, proprietary, or protected information.  If you are 
not the intended recipient, you may not review, copy, or distribute this 
message. If you received this message in error, please notify the sender by 
reply email and delete this message._

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/ad0848e7-a545-4214-a4af-b174a5106b2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Guice + Mockito

2013-11-04 Thread Ari King
How can I mock injected dependencies in JUnit tests? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Guice + Mockito

2013-11-04 Thread Stephan Classen

see: https://groups.google.com/forum/#!topic/google-guice/NEkahqnpY4k



On 11/04/2013 05:09 PM, Ari King wrote:

How can I mock injected dependencies in JUnit tests? Thanks.
--
You received this message because you are subscribed to the Google 
Groups google-guice group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to google-guice+unsubscr...@googlegroups.com.

To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups 
google-guice group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Guice + Mockito

2013-11-04 Thread Peter Reilly
I use constructor injection and the injected objects are mockito objects.

To help things a little with using @Mock attributes I have a simple base
test class:

public class MockedTester {
public MockedTester() {
MockitoAnnotations.initMocks(this);
}
}

public class DomainBlackListTest extends MockedTester {
   @Mock public EventBus eb;
   @Mock public EventBusSingleton eventBus;

   @Before public void initMocks() {
   when(eventBus.getEventBus())
   .thenReturn(eb);
   }

   @Test public void simple() {
  DomainBlackList d = new DomainBlackList(eventBus);
  .

   }

}


On Mon, Nov 4, 2013 at 9:15 AM, Stephan Classen st.clas...@gmx.ch wrote:

 see: https://groups.google.com/forum/#!topic/google-guice/NEkahqnpY4k




 On 11/04/2013 05:09 PM, Ari King wrote:

 How can I mock injected dependencies in JUnit tests? Thanks.
 --
 You received this message because you are subscribed to the Google Groups
 google-guice group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-guice+unsubscr...@googlegroups.com.
 To post to this group, send email to google-guice@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-guice.
 For more options, visit https://groups.google.com/groups/opt_out.


 --
 You received this message because you are subscribed to the Google Groups
 google-guice group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-guice+unsubscr...@googlegroups.com.
 To post to this group, send email to google-guice@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-guice.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Best JUnit/Guice/Mockito integration library?

2013-08-27 Thread Tim Boudreau
Here is a Guice-based test-runner I wrote and have been using for years in 
many projects:
https://github.com/timboudreau/giulius-selenium-tests

An example is probably worth two paragraphs of description:

@RunWith(GuiceTest.class)
public class MyTest {

@TestWith(MyModule.class)
public void test(ThingToTest injected) { ... }
}

Tthe TestWith annotation can also be on the class, and there is an advanced 
feature of being able to iterate a set of different modules - say, 
different implementations of the same basic thing - and run the test with 
each one, or even with all possible combinations of two lists of modules. 
 And there are provisions for auto-binding the contents of properties files.

-Tim

-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Best JUnit/Guice/Mockito integration library?

2013-08-10 Thread Vadim Bondarev


Please take a look on this project 

http://onami.apache.org/test/

On Aug 9, 2013, at 11:40 AM, Laszlo Ferenczi lferen...@gmail.com wrote:

 We ended up rolling our own, a simple JUnit runner implementation which 
 creates the injector before every test. The modules are specified in an 
 annotation on the class level in each test class.
 
 HTH
 
 --
 L
 
 
 On Wed, Aug 7, 2013 at 10:52 PM, Nate Pendleton n8n8b...@gmail.com wrote:
 Jukito seemed quite nice, but I could not integrate it with Maven/Tycho. 
 Something to be aware of.
 
 On Monday, February 21, 2011 7:52:17 AM UTC-8, Thomas Johnson wrote:
 What's the most matures/ library for combining Guice, JUnit, and 
 Mockito for testing? I've seen guiceberry, Jukito, mycila, atunit... 
 
 There seem to be some libraries that have support for Guice 2, and a 
 few that have support for Guice 3, and none are terribly well- 
 documented.
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 google-guice group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-guice+unsubscr...@googlegroups.com.
 To post to this group, send email to google-guice@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-guice.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 google-guice group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-guice+unsubscr...@googlegroups.com.
 To post to this group, send email to google-guice@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-guice.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Best JUnit/Guice/Mockito integration library?

2013-08-09 Thread Laszlo Ferenczi
We ended up rolling our own, a simple JUnit runner implementation which
creates the injector before every test. The modules are specified in an
annotation on the class level in each test class.

HTH

--
L


On Wed, Aug 7, 2013 at 10:52 PM, Nate Pendleton n8n8b...@gmail.com wrote:

 Jukito seemed quite nice, but I could not integrate it with Maven/Tycho.
 Something to be aware of.

 On Monday, February 21, 2011 7:52:17 AM UTC-8, Thomas Johnson wrote:

 What's the most matures/ library for combining Guice, JUnit, and
 Mockito for testing? I've seen guiceberry, Jukito, mycila, atunit...

 There seem to be some libraries that have support for Guice 2, and a
 few that have support for Guice 3, and none are terribly well-
 documented.

  --
 You received this message because you are subscribed to the Google Groups
 google-guice group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-guice+unsubscr...@googlegroups.com.
 To post to this group, send email to google-guice@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-guice.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Best JUnit/Guice/Mockito integration library?

2013-08-07 Thread Nate Pendleton
Jukito seemed quite nice, but I could not integrate it with Maven/Tycho. 
Something to be aware of.

On Monday, February 21, 2011 7:52:17 AM UTC-8, Thomas Johnson wrote:

 What's the most matures/ library for combining Guice, JUnit, and 
 Mockito for testing? I've seen guiceberry, Jukito, mycila, atunit... 

 There seem to be some libraries that have support for Guice 2, and a 
 few that have support for Guice 3, and none are terribly well- 
 documented.

-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Best JUnit/Guice/Mockito integration library?

2011-02-21 Thread Esko Luontola
On Feb 21, 5:52 pm, Thomas Johnson thomas.j.john...@gmail.com wrote:
 What's the most matures/ library for combining Guice, JUnit, and
 Mockito for testing?

All of those as-is. Constructing a Guice injector is only a couple of
lines of code, so why would a library be needed for it? On the other
hand, a large test setup is a code smell that there is some problem
with the design. Even depending on Guice or some other DI library in
unit-level tests is a code smell.

-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To post to this group, send email to google-guice@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.



Re: Best JUnit/Guice/Mockito integration library?

2011-02-21 Thread Thomas Johnson
On Mon, Feb 21, 2011 at 12:20 PM, Esko Luontola esko.luont...@gmail.comwrote:

 On Feb 21, 5:52 pm, Thomas Johnson thomas.j.john...@gmail.com wrote:
  What's the most matures/ library for combining Guice, JUnit, and
  Mockito for testing?

 All of those as-is. Constructing a Guice injector is only a couple of
 lines of code, so why would a library be needed for it? On the other
 hand, a large test setup is a code smell that there is some problem
 with the design. Even depending on Guice or some other DI library in
 unit-level tests is a code smell.


I think it's mostly for the module setup. If I've got a class that takes a
half-dozen dependencies in its constructor, don't I have to write a test
module that binds all its dependencies to the corresponding mock objects?

-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To post to this group, send email to google-guice@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.



Re: Best JUnit/Guice/Mockito integration library?

2011-02-21 Thread Christian Goudreau
http://code.google.com/p/jukito/

Even depending on Guice or some other DI library in unit-level tests is a
 code smell.

It's not about depending on Guice, it's about productivity. Any test could
be written without the need for Guice, but it's more work. If you're using
Guice at every level of your app, why not using it in your test ? It's well
documented, well tested and easy to use.

Jukito works with Guice 3 even if it's not written. There's not a lot of
documentation but it's because there's almost no boiler plate to write !
Jukito use standard Guice annotation and allow you to inject in any JUnit
method anything you want. It will also automatically mock any interface it
find that you didn't binded inside you test module.

Btw, if you need anything else on Jukito, more documentation, just ask, we
will do it ! Here's an interesting blog post about how to test views with
JUnit and Jukito:
http://arcbees.wordpress.com/2010/11/25/testing-views-using-gwt-platform-mockingbinder/

Cheers,

On Mon, Feb 21, 2011 at 1:20 PM, Esko Luontola esko.luont...@gmail.comwrote:

 On Feb 21, 5:52 pm, Thomas Johnson thomas.j.john...@gmail.com wrote:
  What's the most matures/ library for combining Guice, JUnit, and
  Mockito for testing?

 All of those as-is. Constructing a Guice injector is only a couple of
 lines of code, so why would a library be needed for it? On the other
 hand, a large test setup is a code smell that there is some problem
 with the design. Even depending on Guice or some other DI library in
 unit-level tests is a code smell.

 --
 You received this message because you are subscribed to the Google Groups
 google-guice group.
 To post to this group, send email to google-guice@googlegroups.com.
 To unsubscribe from this group, send email to
 google-guice+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-guice?hl=en.




-- 
Christian Goudreau
www.arcbees.com

-- 
You received this message because you are subscribed to the Google Groups 
google-guice group.
To post to this group, send email to google-guice@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.