Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.PropertiesConfiguration.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

      ClusterSpec cloudServersSpec = ClusterSpec.withTemporaryKeys(cloudServersConfig);
      assertEquals(null, cloudServersSpec.getJdkInstallUrl());

      cloudServersConfig = new PropertiesConfiguration();
      cloudServersConfig.addProperty("whirr.jdk-install-url", "http://whirr-third-party.s3.amazonaws.com/jdk-6u21-linux-i586-rpm.bin");

      cloudServersSpec = ClusterSpec.withTemporaryKeys(cloudServersConfig);
      assertEquals("http://whirr-third-party.s3.amazonaws.com/jdk-6u21-linux-i586-rpm.bin", cloudServersSpec.getJdkInstallUrl());
 
 
View Full Code Here

      ClusterSpec cloudServersSpec = ClusterSpec.withTemporaryKeys(cloudServersConfig);
      assertEquals(null, cloudServersSpec.getKerberosRealm());

      cloudServersConfig = new PropertiesConfiguration();
      cloudServersConfig.addProperty("whirr.kerberos-realm", "CDHCLUSTER.COM");

      cloudServersSpec = ClusterSpec.withTemporaryKeys(cloudServersConfig);
      assertEquals("CDHCLUSTER.COM", cloudServersSpec.getKerberosRealm());
  }
 
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

    private FileRegistry mRegistry;

    public void setUp() throws Exception {
        super.setUp();
        PropertiesConfiguration properties = new PropertiesConfiguration();
        properties.addProperty("secor.file.reader.writer",
                "com.pinterest.secor.io.impl.SequenceFileWriter");
        SecorConfig secorConfig = new SecorConfig(properties);
        mRegistry = new FileRegistry(secorConfig);
        mLogFilePath = new LogFilePath("/some_parent_dir", PATH);
        mTopicPartition = new TopicPartition("some_topic", 0);
View Full Code Here

        mLogFilePathGz = new LogFilePath("/some_parent_dir", PATH_GZ);
    }

    private void setupSequenceFileReaderConfig() {
        PropertiesConfiguration properties = new PropertiesConfiguration();
        properties.addProperty("secor.file.reader.writer",
                "com.pinterest.secor.io.impl.SequenceFileReaderWriter");
        mConfig = new SecorConfig(properties);
    }

    private void setupGzipFileReaderConfig() {
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.