Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.PropertiesConfiguration.addProperty()


      ClusterSpec cloudServersUkSpec = ClusterSpec.withTemporaryKeys(cloudServersUkConfig);
      assertEquals(cloudServersUkSpec.getAutoHostnamePrefix(), null);
      assertEquals(cloudServersUkSpec.getAutoHostnameSuffix(), ".static.cloud-ips.co.uk");

      Configuration ec2Config = new PropertiesConfiguration();
      ec2Config.addProperty("whirr.provider", "aws-ec2");

      ClusterSpec ec2Spec = ClusterSpec.withTemporaryKeys(ec2Config);
      assertEquals(null, ec2Spec.getAutoHostnamePrefix());
      assertEquals(null, ec2Spec.getAutoHostnameSuffix());
  }
View Full Code Here


  @Test
  public void testApplySubroleAliases() throws ConfigurationException {
    CompositeConfiguration c = new CompositeConfiguration();
    Configuration config = new PropertiesConfiguration();
    config.addProperty("whirr.instance-templates",
      "1 puppet:somepup::pet+something-else, 1 something-else-only");
    c.addConfiguration(config);
    InstanceTemplate template = InstanceTemplate.parse(c).get(0);
    Set<String> expected = Sets.newLinkedHashSet(Arrays.asList(new String[]{
      "puppet:somepup::pet", "something-else"}));
View Full Code Here

  @Test
  public void testGenerateYamlConfig() {
    Configuration defaults = new PropertiesConfiguration();

    defaults.addProperty("cloud.aws.id", "a");
    defaults.addProperty("cloud.aws.key", "b");
    defaults.addProperty("index.store.type", "memory");

    String content = StringUtils.join(
      ElasticSearchConfigurationBuilder.asYamlLines(defaults), "\n");
View Full Code Here

  @Test
  public void testGenerateYamlConfig() {
    Configuration defaults = new PropertiesConfiguration();

    defaults.addProperty("cloud.aws.id", "a");
    defaults.addProperty("cloud.aws.key", "b");
    defaults.addProperty("index.store.type", "memory");

    String content = StringUtils.join(
      ElasticSearchConfigurationBuilder.asYamlLines(defaults), "\n");
View Full Code Here

  public void testGenerateYamlConfig() {
    Configuration defaults = new PropertiesConfiguration();

    defaults.addProperty("cloud.aws.id", "a");
    defaults.addProperty("cloud.aws.key", "b");
    defaults.addProperty("index.store.type", "memory");

    String content = StringUtils.join(
      ElasticSearchConfigurationBuilder.asYamlLines(defaults), "\n");

    assertThat(content, is("cloud:\n" +
View Full Code Here

  }

  @Test
  public void testDefaultConfigAwsEC2() throws Exception {
    Configuration baseConfig = new PropertiesConfiguration();
    baseConfig.addProperty("whirr.provider", "aws-ec2");
    baseConfig.addProperty("es.plugins", "lang-javascript, lang-python");

    ClusterSpec spec = ClusterSpec.withTemporaryKeys(baseConfig);
    Configuration config = ElasticSearchConfigurationBuilder.buildConfig(spec, null);
View Full Code Here

  @Test
  public void testDefaultConfigAwsEC2() throws Exception {
    Configuration baseConfig = new PropertiesConfiguration();
    baseConfig.addProperty("whirr.provider", "aws-ec2");
    baseConfig.addProperty("es.plugins", "lang-javascript, lang-python");

    ClusterSpec spec = ClusterSpec.withTemporaryKeys(baseConfig);
    Configuration config = ElasticSearchConfigurationBuilder.buildConfig(spec, null);

    assertThat(config.getStringArray("es.plugins"),
View Full Code Here

  }

  @Test
  public void testDefaultUnicastConfig() throws Exception {
    Configuration baseConfig = new PropertiesConfiguration();
    baseConfig.addProperty("whirr.provider", "cloudservers-us");

    ClusterSpec spec = ClusterSpec.withTemporaryKeys(baseConfig);
    Cluster cluster = mock(Cluster.class);

    Set<Cluster.Instance> instances = Sets.newLinkedHashSet();
View Full Code Here

  }

  @Test
  public void testOverrideDefaults() throws Exception {
    Configuration baseConfig = new PropertiesConfiguration();
    baseConfig.addProperty("whirr.provider", "aws-ec2");
    baseConfig.addProperty("es.index.store.type", "fs");

    ClusterSpec spec = ClusterSpec.withTemporaryKeys(baseConfig);
    Configuration config = ElasticSearchConfigurationBuilder.buildConfig(spec, null);
View Full Code Here

  @Test
  public void testOverrideDefaults() throws Exception {
    Configuration baseConfig = new PropertiesConfiguration();
    baseConfig.addProperty("whirr.provider", "aws-ec2");
    baseConfig.addProperty("es.index.store.type", "fs");

    ClusterSpec spec = ClusterSpec.withTemporaryKeys(baseConfig);
    Configuration config = ElasticSearchConfigurationBuilder.buildConfig(spec, null);

    assertThat(config.getString("es.index.store.type"), is("fs"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.