use of org.jboss.weld.config.WeldConfiguration in project core by weld.
the class Reports method addConfiguration.
private static void addConfiguration(HtmlTag body, BeanManagerImpl manager) {
body.add(HtmlTag.aname(CONFIG));
body.add(HtmlTag.h2(TITLE_CONFIG));
HtmlTag table = HtmlTag.stripedTable().appendTo(HtmlTag.div(CONFIG).appendTo(body));
HtmlTag.tr().add(HtmlTag.th(""), HtmlTag.th("Key"), HtmlTag.th("Default Value"), HtmlTag.th("Value"), HtmlTag.th("Description")).appendTo(table);
int idx = 0;
WeldConfiguration configuration = manager.getServices().get(WeldConfiguration.class);
for (ConfigurationKey key : getSortedConfigurationKeys()) {
Object defaultValue = key.getDefaultValue();
Object value = getValue(key, configuration);
if (value == null) {
// Unsupported property type
continue;
}
if (!defaultValue.equals(value)) {
String desc = getDesc(key);
table.add(HtmlTag.tr().add(HtmlTag.td(++idx + "."), HtmlTag.td(key.get()), HtmlTag.td(defaultValue.toString()), HtmlTag.td(value.toString()), HtmlTag.td().add(desc != null ? SafeString.of(desc) : "")));
}
}
}
use of org.jboss.weld.config.WeldConfiguration in project core by weld.
the class PropertiesFilesConfigTest method testConfiguration.
@Test
public void testConfiguration() {
WeldConfiguration configuration = beanManager.getServices().get(WeldConfiguration.class);
// Multiple definitions but the same values
assertEquals(false, configuration.getBooleanProperty(ConfigurationKey.CONCURRENT_DEPLOYMENT));
assertEquals(Integer.valueOf(5), configuration.getIntegerProperty(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE));
// Unique values
assertEquals("FIXED_TIMEOUT", configuration.getStringProperty(ConfigurationKey.EXECUTOR_THREAD_POOL_TYPE));
assertEquals(Long.valueOf(1000), configuration.getLongProperty(ConfigurationKey.RESOLUTION_CACHE_SIZE));
// Default value
assertEquals(ConfigurationKey.NON_PORTABLE_MODE.getDefaultValue(), configuration.getBooleanProperty(ConfigurationKey.NON_PORTABLE_MODE));
}
use of org.jboss.weld.config.WeldConfiguration in project core by weld.
the class SystemPropertiesConfigTest method testPropertiesLoadedAndPropagatedToWeldConfiguration.
@Test
@OperateOnDeployment(WAR_DEPLOYMENT)
public void testPropertiesLoadedAndPropagatedToWeldConfiguration() {
WeldConfiguration configuration = beanManager.getServices().get(WeldConfiguration.class);
assertEquals(false, configuration.getBooleanProperty(ConfigurationKey.CONCURRENT_DEPLOYMENT));
assertEquals(true, configuration.getBooleanProperty(ConfigurationKey.INJECTABLE_REFERENCE_OPTIMIZATION));
}
use of org.jboss.weld.config.WeldConfiguration in project core by weld.
the class CombinedPropertiesFilesConfigTest method testWeldPropertiesFilePriorityInConfiguration.
@Test
@OperateOnDeployment(WAR_DEPLOYMENT)
public void testWeldPropertiesFilePriorityInConfiguration() {
WeldConfiguration configuration = beanManager.getServices().get(WeldConfiguration.class);
// Multiple definitions but the same values
assertEquals(false, configuration.getBooleanProperty(ConfigurationKey.CONCURRENT_DEPLOYMENT));
assertEquals(Integer.valueOf(5), configuration.getIntegerProperty(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE));
// Unique values
assertEquals("FIXED_TIMEOUT", configuration.getStringProperty(ConfigurationKey.EXECUTOR_THREAD_POOL_TYPE));
assertEquals(Long.valueOf(1000), configuration.getLongProperty(ConfigurationKey.RESOLUTION_CACHE_SIZE));
}
use of org.jboss.weld.config.WeldConfiguration in project core by weld.
the class CombinedPropertiesFilesConfigTest method testDefault.
@Test
@OperateOnDeployment(WAR_DEPLOYMENT)
public void testDefault() {
WeldConfiguration configuration = beanManager.getServices().get(WeldConfiguration.class);
// Default value
assertEquals(ConfigurationKey.NON_PORTABLE_MODE.getDefaultValue(), configuration.getBooleanProperty(ConfigurationKey.NON_PORTABLE_MODE));
}
Aggregations