Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.Bean.destroy()


        CreationalContext creationalContext = beanManager.createCreationalContext(bean);
        Marathon marathon = (Marathon) bean.create(creationalContext);

        assertTrue(LifecycleInterceptor.isPostConstructCalled());
        assertEquals(42, marathon.getLength());
        bean.destroy(marathon, creationalContext);
        assertTrue(LifecycleInterceptor.isPreDestroyCalled());
    }

}
View Full Code Here


      Bean bean = beanManager.getBeans(SimpleBeanImpl.class).iterator().next();
      CreationalContext creationalContext = beanManager.createCreationalContext(bean);
      SimpleBeanImpl simpleBean = (SimpleBeanImpl) bean.create(creationalContext);
      String result = simpleBean.doSomething();
      assert "decorated-Hello!-decorated".equals(result);
      bean.destroy(simpleBean, creationalContext);
      assert SimpleInterceptor.aroundInvokeCalled;
      assert !SimpleInterceptor.postConstructCalled;
      assert !SimpleInterceptor.preDestroyCalled;
      assert TwoBindingsInterceptor.aroundInvokeCalled;
      assert SimpleBeanImpl.postConstructCalled;
View Full Code Here

      Bean bean = beanManager.getBeans(SimpleBeanWithStereotype.class).iterator().next();
      CreationalContext creationalContext = beanManager.createCreationalContext(bean);
      SimpleBeanWithStereotype simpleBean = (SimpleBeanWithStereotype) bean.create(creationalContext);
      String result = simpleBean.doSomething();
      assert "Hello!".equals(result);
      bean.destroy(simpleBean, creationalContext);
      assert SimpleInterceptor.aroundInvokeCalled;
      assert SimpleInterceptor.postConstructCalled;
      assert SimpleInterceptor.preDestroyCalled;
      assert TwoBindingsInterceptor.aroundInvokeCalled;
      assert SimpleBeanWithStereotype.postConstructCalled;
View Full Code Here

        CreationalContext creationalContext = beanManager.createCreationalContext(bean);
        Marathon m = (Marathon) bean.create(creationalContext);

        Assert.assertTrue(LifecycleInterceptor.isPostConstructCalled());
        Assert.assertEquals(42, m.getLength());
        bean.destroy(m, creationalContext);
        Assert.assertTrue(LifecycleInterceptor.isPreDestroyCalled());
    }

}
View Full Code Here

        CreationalContext creationalContext = beanManager.createCreationalContext(bean);
        Marathon marathon = (Marathon) bean.create(creationalContext);

        assertTrue(LifecycleInterceptor.isPostConstructCalled());
        assertEquals(42, marathon.getLength());
        bean.destroy(marathon, creationalContext);
        assertTrue(LifecycleInterceptor.isPreDestroyCalled());
    }

}
View Full Code Here

        CreationalContext creationalContext = beanManager.createCreationalContext(bean);
        Marathon marathon = (Marathon) bean.create(creationalContext);

        assertTrue(LifecycleInterceptor.isPostConstructCalled());
        assertEquals(marathon.getLength(), 42);
        bean.destroy(marathon, creationalContext);
        assertTrue(LifecycleInterceptor.isPreDestroyCalled());
    }
   
    @Test
    @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "b"), @SpecAssertion(section = INIT_EVENTS, id = "bb"),
View Full Code Here

        CreationalContext creationalContext = beanManager.createCreationalContext(bean);
        Marathon marathon = (Marathon) bean.create(creationalContext);

        assertTrue(LifecycleInterceptor.isPostConstructCalled());
        assertEquals(marathon.getLength(), 42);
        bean.destroy(marathon, creationalContext);
        assertTrue(LifecycleInterceptor.isPreDestroyCalled());
    }
   
    @Test
    @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "b"), @SpecAssertion(section = INIT_EVENTS, id = "bb"),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.