2008/10/28 Robbie Vanbrabant <[EMAIL PROTECTED]>:
> You have to create the injector @BeforeClass gets called, and you need to

You mean initialize it as a static member itself or something?

private static Injector injector = Guice.createInjector( new
RealServicesModule() );

Then do the @BeforeClass?

> use requestStaticInjection in you modules for the classes in which you want
> to inject statics.

Ah okay, thanks, I hadn't spotted this one.

> But if you're trying to unit test with Guice, you could also have a look at
> one of the projects that help you with that, like GuiceBerry or AtUnit.

You're right, I probably should :-)

I'm not using it heavily though (yet) and I figured knowing why this
didn't work would probably help with other cases too.

Thanks!

Andrew.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to