Search in sources :

Example 86 with CompositeConfiguration

use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.

the class VoldemortServiceTest method setUp.

@Before
public void setUp() throws Exception {
    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
        config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration("whirr-voldemort-test.properties"));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
    cluster = controller.launchCluster(clusterSpec);
    waitForBootstrap();
}
Also used : ClusterController(org.apache.whirr.ClusterController) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) Before(org.junit.Before)

Example 87 with CompositeConfiguration

use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.

the class YarnConfigurationBuilder method build.

private static Configuration build(ClusterSpec clusterSpec, Cluster cluster, Configuration defaults, String prefix) throws ConfigurationException {
    CompositeConfiguration config = new CompositeConfiguration();
    Configuration sub = clusterSpec.getConfigurationForKeysWithPrefix(prefix);
    config.setDelimiterParsingDisabled(true);
    // remove prefix
    config.addConfiguration(sub.subset(prefix));
    config.addConfiguration(defaults.subset(prefix));
    return config;
}
Also used : Configuration(org.apache.commons.configuration.Configuration) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration)

Example 88 with CompositeConfiguration

use of org.apache.commons.configuration.CompositeConfiguration in project wcomponents by BorderTech.

the class Config method loadConfiguration.

/**
 * @return the configuration to use.
 */
private static synchronized Configuration loadConfiguration() {
    // Find if there are classes implementing the ConfigurationLoader SPI.
    ServiceLoader<ConfigurationLoader> loaders = ServiceLoader.load(ConfigurationLoader.class);
    Iterator<ConfigurationLoader> iterator = loaders.iterator();
    // Use a CompositeConfiguration if there are custom ConfigurationLoader implementations.
    if (iterator.hasNext()) {
        CompositeConfiguration compositeConfig = new CompositeConfiguration(new MapConfiguration(new HashMap<String, Object>()));
        while (iterator.hasNext()) {
            compositeConfig.addConfiguration(iterator.next().getConfiguration());
        }
        // Add the base WComponents configuration last so it is overridden.
        compositeConfig.addConfiguration(new DefaultInternalConfiguration());
        return compositeConfig;
    } else {
        // If no custom ConfigurationLoader is defined, return the default configuration.
        return new DefaultInternalConfiguration();
    }
}
Also used : HashMap(java.util.HashMap) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) MapConfiguration(org.apache.commons.configuration.MapConfiguration)

Example 89 with CompositeConfiguration

use of org.apache.commons.configuration.CompositeConfiguration in project wcomponents by BorderTech.

the class AbstractWSelectList_Test method setUp.

@BeforeClass
public static void setUp() {
    originalConfig = Config.getInstance();
    CompositeConfiguration config = new CompositeConfiguration(originalConfig);
    MapConfiguration overrides = new MapConfiguration(new HashMap<String, Object>());
    overrides.setProperty(ConfigurationProperties.INTEGRITY_ERROR_MODE, "true");
    config.addConfiguration(overrides);
    Config.setConfiguration(config);
}
Also used : CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) MapConfiguration(org.apache.commons.configuration.MapConfiguration) BeforeClass(org.junit.BeforeClass)

Aggregations

CompositeConfiguration (org.apache.commons.configuration.CompositeConfiguration)89 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)46 Test (org.junit.Test)24 ClusterController (org.apache.whirr.ClusterController)22 Configuration (org.apache.commons.configuration.Configuration)21 File (java.io.File)17 Before (org.junit.Before)11 ForceField (ffx.potential.parameters.ForceField)10 ConfigurationException (org.apache.commons.configuration.ConfigurationException)9 HadoopProxy (org.apache.whirr.service.hadoop.HadoopProxy)9 BeforeClass (org.junit.BeforeClass)9 IOException (java.io.IOException)8 ClusterSpec (org.apache.whirr.ClusterSpec)8 MolecularAssembly (ffx.potential.MolecularAssembly)7 ForceFieldFilter (ffx.potential.parsers.ForceFieldFilter)7 PDBFilter (ffx.potential.parsers.PDBFilter)7 MapConfiguration (org.apache.commons.configuration.MapConfiguration)6 Crystal (ffx.crystal.Crystal)5 ReflectionList (ffx.crystal.ReflectionList)5 ForceFieldEnergy (ffx.potential.ForceFieldEnergy)5