Package org.apache.commons.configuration

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


        mConfig = new SecorConfig(properties);
    }

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

    private void mockGzipFileReaderWriter() throws Exception {
View Full Code Here


        if (configurationFile == null)
        {
            final MyConfiguration basicConfiguration = new MyConfiguration();
            PropertiesConfiguration config = new PropertiesConfiguration();
            final String type = (String) getAttribute(TYPE);
            config.addProperty("type", type);
            VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
            if(factory != null)
            {
                for(Map.Entry<String,Object> entry : factory.createVirtualHostConfiguration(this).entrySet())
                {
View Full Code Here

            VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
            if(factory != null)
            {
                for(Map.Entry<String,Object> entry : factory.createVirtualHostConfiguration(this).entrySet())
                {
                    config.addProperty(entry.getKey(), entry.getValue());
                }
            }
            basicConfiguration.addConfiguration(config);

            CompositeConfiguration compositeConfiguration = new CompositeConfiguration();
View Full Code Here

        ));
   
    assertThat(rc, is(0));

    Configuration conf = new PropertiesConfiguration();
    conf.addProperty("whirr.version", "version-string");
    conf.addProperty("whirr.instance-templates", "1 noop");

    ClusterSpec expectedClusterSpec = ClusterSpec.withTemporaryKeys(conf);
    expectedClusterSpec.setServiceName("test-service");
    expectedClusterSpec.setProvider("rackspace");
View Full Code Here

   
    assertThat(rc, is(0));

    Configuration conf = new PropertiesConfiguration();
    conf.addProperty("whirr.version", "version-string");
    conf.addProperty("whirr.instance-templates", "1 noop");

    ClusterSpec expectedClusterSpec = ClusterSpec.withTemporaryKeys(conf);
    expectedClusterSpec.setServiceName("test-service");
    expectedClusterSpec.setProvider("rackspace");
    expectedClusterSpec.setIdentity("myusername");
View Full Code Here

        ));
   
    assertThat(rc, is(0));

    Configuration conf = new PropertiesConfiguration();
    conf.addProperty("whirr.version", "version-string");

    ClusterSpec expectedClusterSpec = ClusterSpec.withTemporaryKeys(conf);
    expectedClusterSpec.setInstanceTemplates(Lists.newArrayList(
      InstanceTemplate.builder().numberOfInstance(1).roles("role1", "role2").build(),
      InstanceTemplate.builder().numberOfInstance(2).roles("role3").build()
View Full Code Here

        ));
   
    assertThat(rc, is(0));

    Configuration conf = new PropertiesConfiguration();
    conf.addProperty("whirr.provider", "aws-ec2");
    conf.addProperty("whirr.version", "version-string");
    conf.addProperty("whirr.instance-templates-max-percent-failure", "60 hadoop-datanode+hadoop-tasktracker");

    ClusterSpec expectedClusterSpec = ClusterSpec.withTemporaryKeys(conf);
    expectedClusterSpec.setInstanceTemplates(Lists.newArrayList(
View Full Code Here

   
    assertThat(rc, is(0));

    Configuration conf = new PropertiesConfiguration();
    conf.addProperty("whirr.provider", "aws-ec2");
    conf.addProperty("whirr.version", "version-string");
    conf.addProperty("whirr.instance-templates-max-percent-failure", "60 hadoop-datanode+hadoop-tasktracker");

    ClusterSpec expectedClusterSpec = ClusterSpec.withTemporaryKeys(conf);
    expectedClusterSpec.setInstanceTemplates(Lists.newArrayList(
      InstanceTemplate.builder().numberOfInstance(1).minNumberOfInstances(1)
View Full Code Here

    assertThat(rc, is(0));

    Configuration conf = new PropertiesConfiguration();
    conf.addProperty("whirr.provider", "aws-ec2");
    conf.addProperty("whirr.version", "version-string");
    conf.addProperty("whirr.instance-templates-max-percent-failure", "60 hadoop-datanode+hadoop-tasktracker");

    ClusterSpec expectedClusterSpec = ClusterSpec.withTemporaryKeys(conf);
    expectedClusterSpec.setInstanceTemplates(Lists.newArrayList(
      InstanceTemplate.builder().numberOfInstance(1).minNumberOfInstances(1)
        .roles("hadoop-namenode", "hadoop-jobtracker").build(),
View Full Code Here

        QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
        assertTrue(qConf.getArguments().isEmpty());


        PropertiesConfiguration queueConfig = new PropertiesConfiguration();
        queueConfig.addProperty("queues.queue.test.argument", QueueArgumentsConverter.QPID_GROUP_HEADER_KEY + "=mykey");
        queueConfig.addProperty("queues.queue.test.argument", QueueArgumentsConverter.QPID_SHARED_MSG_GROUP + "=1");

        CompositeConfiguration config = new CompositeConfiguration();
        config.addConfiguration(_fullHostConf.getConfig());
        config.addConfiguration(queueConfig);
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.