SystemInstance.get().getProperties().put("openejb.fooApp.color", "blue");
}
private void assertContexts(final ContainerSystem containerSystem) {
final BeanContext beanContext = containerSystem.getBeanContext("WidgetBean");
final ModuleContext moduleContext = beanContext.getModuleContext();
final AppContext appContext = moduleContext.getAppContext();
{ // Assert as Properties
// AppContext should have color property
assertProperty(appContext.getProperties(), "color", "orange");
// BeanContext and ModuleContext should not
assertNoProperty(beanContext.getProperties(), "color");
assertNoProperty(moduleContext.getProperties(), "color");
// Try all the above again with mixed case
assertProperty(appContext.getProperties(), "coLOr", "orange");
assertNoProperty(beanContext.getProperties(), "coLOr");
assertNoProperty(moduleContext.getProperties(), "coLOr");
}
{ // Assert as Options
// AppContext should have color option
assertOption(appContext.getOptions(), "color", "orange");
// BeanContext and ModuleContext should inherit AppContext color
assertOption(beanContext.getOptions(), "color", "orange");
assertOption(moduleContext.getOptions(), "color", "orange");
// Try all the above again using mixed case
assertOption(appContext.getOptions(), "coLoR", "orange");
assertOption(moduleContext.getOptions(), "coLoR", "orange");
assertOption(beanContext.getOptions(), "coLoR", "orange");
}
}