Package org.apache.commons.configuration

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


    t1 = templates.get(0);
    assertThat(t1.getMinNumberOfInstances(), is(1));
    t2 = templates.get(1);
    assertThat(t2.getMinNumberOfInstances(), is(2));

    conf.addProperty("whirr.instance-templates-minumum-number-of-instances", "1 hadoop-datanode+hadoop-tasktracker");
    expectedClusterSpec = ClusterSpec.withNoDefaults(conf);
    templates = expectedClusterSpec.getInstanceTemplates();
    t1 = templates.get(0);
    assertThat(t1.getMinNumberOfInstances(), is(1));
    t2 = templates.get(1);
View Full Code Here


      "cloudservers-uk:cloudfiles-uk"
    }) {
      String[] parts = pair.split(":");

      Configuration config = new PropertiesConfiguration();
      config.addProperty("whirr.provider", parts[0]);

      ClusterSpec spec = ClusterSpec.withTemporaryKeys(config);
      assertThat(spec.getBlobStoreProvider(), is(parts[1]));
    }
  }
View Full Code Here

  }

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

      ClusterSpec cloudServersSpec = ClusterSpec.withTemporaryKeys(cloudServersConfig);
      assertEquals(cloudServersSpec.getAutoHostnamePrefix(), null);
      assertEquals(cloudServersSpec.getAutoHostnameSuffix(), ".static.cloud-ips.com");
View Full Code Here

      ClusterSpec cloudServersSpec = ClusterSpec.withTemporaryKeys(cloudServersConfig);
      assertEquals(cloudServersSpec.getAutoHostnamePrefix(), null);
      assertEquals(cloudServersSpec.getAutoHostnameSuffix(), ".static.cloud-ips.com");

      Configuration cloudServersUkConfig = new PropertiesConfiguration();
      cloudServersUkConfig.addProperty("whirr.provider", "cloudservers-uk");

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

      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

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.