Maybe I'm doing something stupid, but what's wrong with this picture:
// In my module RealServicesModule
bind( String.class ).annotatedWith(
FuncNetVersionDependent.class ).toInstance(
"http://cathdb.info/FuncNet_0_1/"; );
// A static member in my test class
@Inject @FuncNetVersi
PS This is using old-skool Guice 1.0 release, I'm hesitant to upgrade
while I'm still learning, but if this is a known issue then I can...
Cheers.
Andrew.
2008/10/28 Andrew Clegg <[EMAIL PROTECTED]>:
> Maybe I'm doing something stupid, but what's wrong with this picture:
>
>
> // In my module R
You have to create the injector @BeforeClass gets called, and you need to
use requestStaticInjection in you modules for the classes in which you want
to inject statics.
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 Guic
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 @BeforeCl
On Tue, Oct 28, 2008 at 8:46 AM, Andrew Clegg <[EMAIL PROTECTED]>wrote:
> PS This is using old-skool Guice 1.0 release, I'm hesitant to upgrade
> while I'm still learning, but if this is a known issue then I can...
>
This is a known issue, one of the very few in 1.0. I'd stick with 1.0 until
you'