Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.XMLConfiguration.load()


        sb.append("</configuration></extension>");

        XMLConfiguration xmlConfig = new XMLConfiguration();

        try {
            xmlConfig.load(new StringReader(sb.toString()));
        } catch (ConfigurationException ex) {
        }

        // allow all namespaces for purpose of testing
        List<String> allowedNamespaces = new ArrayList<String>();
View Full Code Here


    private static final Reader rexsterXmlReader = new StringReader(RexsterXmlData.XML);

    @Test
    public void shouldConfiguredFromXmlConfiguration() throws Exception {
        final XMLConfiguration properties = new XMLConfiguration();
        properties.load(rexsterXmlReader);
        final List<HierarchicalConfiguration> graphConfigs = properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);

        final RexsterApplication ra = new XmlRexsterApplication(graphConfigs);

        Assert.assertEquals(2, ra.getGraphNames().size());
View Full Code Here

    @Before
    public void setUp() throws Exception {
        clean();

        final XMLConfiguration properties = new XMLConfiguration();
        properties.load(Application.class.getResourceAsStream("rexster-integration-test.xml"));
        rexsterServer = new RexProRexsterServer(properties);

        final List<HierarchicalConfiguration> graphConfigs = properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);
        final RexsterApplication application = new XmlRexsterApplication(graphConfigs);
        EngineController.configure(-1, null);
View Full Code Here

  private static void startRexsterServer() throws Exception {
    InputStream rexsterConf =
      TestRexsterLongDoubleFloatIOFormat.class.getResourceAsStream(
        REXSTER_CONF);
    XMLConfiguration properties = new XMLConfiguration();
    properties.load(rexsterConf);
    rexsterConf.close();

    List<HierarchicalConfiguration> graphConfigs =
      properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);
    RexsterApplication application  = new XmlRexsterApplication(graphConfigs);
View Full Code Here

        // See JAMES-1233
        config.setAttributeSplittingDisabled(true);
       
        // Use InputStream so we are not bound to File implementations of the
        // config
        config.load(r.getInputStream());
        return config;
    }

    /**
     * Return the configuration prefix to load the configuration. In this case
View Full Code Here

       
        // Use InputStream so we are not bound to File implementations of the
        // config
        try {
            fis = new FileInputStream("/tmp/" + beanName + ".xml");
            config.load(fis);
        } catch (FileNotFoundException e) {
            throw new ConfigurationException("Bean " + beanName);
        } finally {
            if (fis != null) {
                try {
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.