Package org.apache.commons.configuration

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


    @Test
    public void tryGetMapFromConfigurationBadConfig() {
        HierarchicalConfiguration hc = new HierarchicalConfiguration();
        HierarchicalConfiguration innerHc = new HierarchicalConfiguration();
        innerHc.addProperty("test", "1");
        hc.addProperty("test-bad", innerHc);

        ExtensionConfiguration config = new ExtensionConfiguration("ns", "name", hc);

        Map<String, String> map = config.tryGetMapFromConfiguration();
View Full Code Here


    }

    @Test
    public void tryGetMapFromConfigurationNiceConfig() {
        HierarchicalConfiguration hc = new HierarchicalConfiguration();
        hc.addProperty("key1", "value1");
        hc.addProperty("key2", "value2");
        ExtensionConfiguration config = new ExtensionConfiguration("ns", "name", hc);

        Map<String, String> map = config.tryGetMapFromConfiguration();
        Assert.assertNotNull(map);
View Full Code Here

    @Test
    public void tryGetMapFromConfigurationNiceConfig() {
        HierarchicalConfiguration hc = new HierarchicalConfiguration();
        hc.addProperty("key1", "value1");
        hc.addProperty("key2", "value2");
        ExtensionConfiguration config = new ExtensionConfiguration("ns", "name", hc);

        Map<String, String> map = config.tryGetMapFromConfiguration();
        Assert.assertNotNull(map);
        Assert.assertTrue(map.containsKey("key1"));
View Full Code Here

    }

    @Test
    public void isConfigurationValidNiceConfiguration() {
        HierarchicalConfiguration hc = new HierarchicalConfiguration();
        hc.addProperty("key1", "value1");
        hc.addProperty("key2", "value2");
        ExtensionConfiguration configuration = new ExtensionConfiguration("ns", "name", hc);
        Assert.assertTrue(this.framesExtension.isConfigurationValid(configuration));
    }
View Full Code Here

    }

    @Test
    public void shouldEqual() {
        HierarchicalConfiguration hc1 = new HierarchicalConfiguration();
        hc1.addProperty("key1", "value1");
        hc1.addProperty("key2", "value2");
        ExtensionConfiguration config1 = new ExtensionConfiguration("ns", "name", hc1);

        HierarchicalConfiguration hc2 = new HierarchicalConfiguration();
        hc2.addProperty("key1", "value1");
View Full Code Here

    @Test
    public void isConfigurationValidNiceConfiguration() {
        HierarchicalConfiguration hc = new HierarchicalConfiguration();
        hc.addProperty("key1", "value1");
        hc.addProperty("key2", "value2");
        ExtensionConfiguration configuration = new ExtensionConfiguration("ns", "name", hc);
        Assert.assertTrue(this.framesExtension.isConfigurationValid(configuration));
    }

    @Test
View Full Code Here

    @Test
    public void shouldEqual() {
        HierarchicalConfiguration hc1 = new HierarchicalConfiguration();
        hc1.addProperty("key1", "value1");
        hc1.addProperty("key2", "value2");
        ExtensionConfiguration config1 = new ExtensionConfiguration("ns", "name", hc1);

        HierarchicalConfiguration hc2 = new HierarchicalConfiguration();
        hc2.addProperty("key1", "value1");
        hc2.addProperty("key2", "value2");
View Full Code Here

        hc1.addProperty("key1", "value1");
        hc1.addProperty("key2", "value2");
        ExtensionConfiguration config1 = new ExtensionConfiguration("ns", "name", hc1);

        HierarchicalConfiguration hc2 = new HierarchicalConfiguration();
        hc2.addProperty("key1", "value1");
        hc2.addProperty("key2", "value2");
        ExtensionConfiguration config2 = new ExtensionConfiguration("ns", "name", hc2);

        Assert.assertTrue(config1.equals(config2));
    }
View Full Code Here

        hc1.addProperty("key2", "value2");
        ExtensionConfiguration config1 = new ExtensionConfiguration("ns", "name", hc1);

        HierarchicalConfiguration hc2 = new HierarchicalConfiguration();
        hc2.addProperty("key1", "value1");
        hc2.addProperty("key2", "value2");
        ExtensionConfiguration config2 = new ExtensionConfiguration("ns", "name", hc2);

        Assert.assertTrue(config1.equals(config2));
    }
View Full Code Here

    }

    @Test
    public void shouldNotEqualWhenValuesInConfigAreDifferent() {
        HierarchicalConfiguration hc1 = new HierarchicalConfiguration();
        hc1.addProperty("key1", "value1");
        hc1.addProperty("key2", "value2");
        ExtensionConfiguration config1 = new ExtensionConfiguration("ns", "name", hc1);

        HierarchicalConfiguration hc2 = new HierarchicalConfiguration();
        hc2.addProperty("key1", "value1");
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.