Destroy the existing contextual instance. If there is no existing instance, no action is taken.
8384858687888990919293
Bean<?> bean = getUniqueBean(ApplicationScopedComponent.class); AlterableContext context = (AlterableContext) getCurrentManager().getContext(bean.getScope()); AbstractComponent.reset(); application.setValue("value"); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); context.destroy(bean); // make sure subsequent calls do not raise exception context.destroy(bean); }
8687888990919293949596
AbstractComponent.reset(); application.setValue("value"); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); context.destroy(bean); // make sure subsequent calls do not raise exception context.destroy(bean); } private <T extends AbstractComponent> void testComponent(Instance<T> instance) { for (String string : VALUES) {
8788899091929394959697
application.setValue("value"); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); context.destroy(bean); // make sure subsequent calls do not raise exception context.destroy(bean); } private <T extends AbstractComponent> void testComponent(Instance<T> instance) { for (String string : VALUES) { T reference = instance.get();
7778798081828384858687
8081828384858687888990
AbstractComponent.reset(); application.setValue("value"); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); context.destroy(bean); // make sure subsequent calls do not raise exception context.destroy(bean); } private <T extends AbstractComponent> void testComponent(Class<T> javaClass) { Bean<?> bean = getUniqueBean(javaClass);
8182838485868788899091
application.setValue("value"); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); context.destroy(bean); // make sure subsequent calls do not raise exception context.destroy(bean); } private <T extends AbstractComponent> void testComponent(Class<T> javaClass) { Bean<?> bean = getUniqueBean(javaClass); @SuppressWarnings("unchecked")
96979899100101102103104105106
assertNull(reference.getValue()); reference.setValue(string); assertEquals(reference.getValue(), string); AbstractComponent.reset(); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); assertNull(reference.getValue(), reference.getValue()); } } }
7980818283848586878889
} // try to destroy the bean Bean<?> contextual = manager.resolve(manager.getBeans(StatefulBean.class)); AlterableContext context = (AlterableContext) manager.getContext(ApplicationScoped.class); context.destroy(contextual); assertEquals("pong", bean.ping()); } @Test
7475767778798081828384
Bean<?> bean = manager.resolve(manager.getBeans(ApplicationScopedComponent.class)); AlterableContext context = (AlterableContext) manager.getContext(bean.getScope()); AbstractComponent.reset(); application.setValue("value"); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); context.destroy(bean); // make sure subsequent calls do not raise exception context.destroy(bean); }
AbstractComponent.reset(); application.setValue("value"); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); context.destroy(bean); // make sure subsequent calls do not raise exception context.destroy(bean); } private <T extends AbstractComponent> void testComponent(Class<T> javaClass) { Bean<?> bean = manager.resolve(manager.getBeans(javaClass));