Destroy the existing contextual instance. If there is no existing instance, no action is taken.
979899100101102103104105106107
assertNull(reference.getValue()); reference.setValue(string); assertEquals(reference.getValue(), string); AbstractComponent.reset(); context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); assertNull(reference.getValue(), reference.getValue()); } } }
90919293949596979899100
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);
93949596979899100101102103
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); } @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, expectedExceptions = UnsupportedOperationException.class)
9596979899100101102103104105
context.destroy(bean); assertTrue(AbstractComponent.isDestroyed()); context.destroy(bean); // Make sure subsequent calls do not raise exception context.destroy(bean); } @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, expectedExceptions = UnsupportedOperationException.class) @SpecAssertions({ @SpecAssertion(section = DYNAMIC_LOOKUP, id = "p") }) public void testUnsupportedOperationExceptionThrownIfUnderlyingContextNotAlterable(
8485868788899091929394
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); }
8788899091929394959697
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) {
8889909192939495969798
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();