Skip to content

Commit

Permalink
test @PostConstruct after injection
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@276 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
Gavin King authored and gavin.king@gmail.com committed Nov 7, 2008
1 parent 915b8af commit 2743084
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -13,6 +13,8 @@

import org.jboss.webbeans.bean.SimpleBean;
import org.jboss.webbeans.contexts.RequestContext;
import org.jboss.webbeans.test.beans.Farm;
import org.jboss.webbeans.test.beans.FarmOffice;
import org.jboss.webbeans.test.beans.Fox;
import org.jboss.webbeans.test.beans.FoxRun;
import org.jboss.webbeans.test.beans.SpiderNest;
Expand Down Expand Up @@ -49,6 +51,18 @@ public void testPrimitiveInjectionPointResolvesToNullableWebBean() throws Except
farmHouseBean.create();
}

@Test(groups={"injection", "postConstruct"}) @SpecAssertion(section="4.2")
public void testPostConstruct() throws Exception
{
Bean<FarmOffice> farmOfficeBean = createSimpleWebBean(FarmOffice.class, manager);
Bean<Farm> farmBean = createSimpleWebBean(Farm.class, manager);
manager.addBean(farmOfficeBean);
manager.addBean(farmBean);
Farm farm = farmBean.create();
assert farm.founded!=null;
assert farm.initialStaff==20;
}

@Test(groups={"injection", "clientProxy"}, expectedExceptions=ContextNotActiveException.class) @SpecAssertion(section="4.3")
public void testInvokeNormalInjectedWebBeanWhenContextNotActive()
{
Expand Down

0 comments on commit 2743084

Please sign in to comment.