Issue 28 in guiceyfruit: GuiceyFruit does not execute @PostConstruct in super class

6 views
Skip to first unread message

codesite...@google.com

unread,
Oct 16, 2009, 9:03:59 AM10/16/09
to guiceyf...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 28 by philippe.tseyen: GuiceyFruit does not execute
@PostConstruct in super class
http://code.google.com/p/guiceyfruit/issues/detail?id=28

@Test
public void testPostConstruct()
{
AbstractModule module = new AbstractModule()
{

@Override
protected void configure() {
bind(PostConstruct.class);
}
};
Module combine = Modules.combine(module, new Jsr250Module());
Injector createInjector = Guice.createInjector(combine);
PostConstruct instance = createInjector.getInstance(PostConstruct.class);
assertEquals(2, instance.collector.size());
assertEquals("superPostConstruct", instance.collector.get(0));
assertEquals("postConstruct", instance.collector.get(1));
}

@Singleton
public static class SuperPostConstruct
{
public List<String> collector = new ArrayList<String>();

@javax.annotation.PostConstruct
public void superPostConstruct()
{
collector.add("superPostConstruct");
}
}

@Singleton
public static class PostConstruct extends SuperPostConstruct
{
@javax.annotation.PostConstruct
public void postConstruct()
{
collector.add("postConstruct");
}
}

Guice 2.0, GuiceyFruit 2.0

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Oct 22, 2009, 9:12:27 AM10/22/09
to guiceyf...@googlegroups.com

Comment #1 on issue 28 by norman.maurer: GuiceyFruit does not execute

Same here..

Reply all
Reply to author
Forward
0 new messages