Package org.apache.commons.configuration

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


        HierarchicalConfiguration hc2 = new HierarchicalConfiguration();
        hc2.addProperty("key1", "value1");

        HierarchicalConfiguration hc2i = new HierarchicalConfiguration();
        hc2i.addProperty("key2i", "value2i");
        hc2.addProperty("key2", hc2i);
        ExtensionConfiguration config2 = new ExtensionConfiguration("ns", "name", hc2);

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


    }

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceNoNeo4jConfig() throws GraphConfigurationException {
        Configuration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        Map<String, RexsterApplicationGraph> graphs = new HashMap<String, RexsterApplicationGraph>();
        GraphConfigurationContext context = new GraphConfigurationContext(graphConfig, graphs);

        configuration.configureGraphInstance(context);
    }
View Full Code Here

    }

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceHaOnNoProperties() throws GraphConfigurationException {
        Configuration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_HA, "true");
        Map<String, RexsterApplicationGraph> graphs = new HashMap<String, RexsterApplicationGraph>();
        GraphConfigurationContext context = new GraphConfigurationContext(graphConfig, graphs);

        configuration.configureGraphInstance(context);
View Full Code Here

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceHaOnNoProperties() throws GraphConfigurationException {
        Configuration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_HA, "true");
        Map<String, RexsterApplicationGraph> graphs = new HashMap<String, RexsterApplicationGraph>();
        GraphConfigurationContext context = new GraphConfigurationContext(graphConfig, graphs);

        configuration.configureGraphInstance(context);
    }
View Full Code Here

    }

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceHaOnNoMachineId() throws GraphConfigurationException {
        HierarchicalConfiguration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_HA, "true");

        ArrayList<HierarchicalConfiguration.Node> listOfNodes = new ArrayList<HierarchicalConfiguration.Node>();
        listOfNodes.add(new HierarchicalConfiguration.Node("anything", "nothing"));
        graphConfig.addNodes(Tokens.REXSTER_GRAPH_PROPERTIES, listOfNodes);
View Full Code Here

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceHaOnNoMachineId() throws GraphConfigurationException {
        HierarchicalConfiguration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_HA, "true");

        ArrayList<HierarchicalConfiguration.Node> listOfNodes = new ArrayList<HierarchicalConfiguration.Node>();
        listOfNodes.add(new HierarchicalConfiguration.Node("anything", "nothing"));
        graphConfig.addNodes(Tokens.REXSTER_GRAPH_PROPERTIES, listOfNodes);
        Map<String, RexsterApplicationGraph> graphs = new HashMap<String, RexsterApplicationGraph>();
View Full Code Here

    }

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceHaOnNoServer() throws GraphConfigurationException {
        HierarchicalConfiguration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_HA, "true");

        ArrayList<HierarchicalConfiguration.Node> listOfNodes = new ArrayList<HierarchicalConfiguration.Node>();
        listOfNodes.add(new HierarchicalConfiguration.Node("ha.machine_id", "1"));
        graphConfig.addNodes(Tokens.REXSTER_GRAPH_PROPERTIES, listOfNodes);
View Full Code Here

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceHaOnNoServer() throws GraphConfigurationException {
        HierarchicalConfiguration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_HA, "true");

        ArrayList<HierarchicalConfiguration.Node> listOfNodes = new ArrayList<HierarchicalConfiguration.Node>();
        listOfNodes.add(new HierarchicalConfiguration.Node("ha.machine_id", "1"));
        graphConfig.addNodes(Tokens.REXSTER_GRAPH_PROPERTIES, listOfNodes);
        Map<String, RexsterApplicationGraph> graphs = new HashMap<String, RexsterApplicationGraph>();
View Full Code Here

    }

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceHaOnNoZkServers() throws GraphConfigurationException {
        HierarchicalConfiguration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_HA, "true");

        ArrayList<HierarchicalConfiguration.Node> listOfNodes = new ArrayList<HierarchicalConfiguration.Node>();
        listOfNodes.add(new HierarchicalConfiguration.Node("ha.machine_id", "1"));
        listOfNodes.add(new HierarchicalConfiguration.Node("ha.server", "localhost:9939"));
View Full Code Here

    @Test(expected = GraphConfigurationException.class)
    public void configureGraphInstanceHaOnNoZkServers() throws GraphConfigurationException {
        HierarchicalConfiguration graphConfig = new HierarchicalConfiguration();
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_LOCATION, this.neo4jFile);
        graphConfig.addProperty(Tokens.REXSTER_GRAPH_HA, "true");

        ArrayList<HierarchicalConfiguration.Node> listOfNodes = new ArrayList<HierarchicalConfiguration.Node>();
        listOfNodes.add(new HierarchicalConfiguration.Node("ha.machine_id", "1"));
        listOfNodes.add(new HierarchicalConfiguration.Node("ha.server", "localhost:9939"));
        graphConfig.addNodes(Tokens.REXSTER_GRAPH_PROPERTIES, listOfNodes);
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.