Package org.apache.commons.configuration2.builder.fluent

Examples of org.apache.commons.configuration2.builder.fluent.XMLBuilderParameters


     * @throws ConfigurationException if an error occurs
     */
    private static void checkTestConfiguration(FileHandler handler)
            throws ConfigurationException
    {
        XMLConfiguration config = new XMLConfiguration();
        FileHandler h2 = new FileHandler(config, handler);
        h2.load();
        assertEquals("Wrong content", "value", config.getString("element"));
    }
View Full Code Here


            throws ConfigurationException
    {
        FileBasedConfigurationBuilder<XMLConfiguration> builder =
                new FileBasedConfigurationBuilder<XMLConfiguration>(
                        XMLConfiguration.class);
        builder.configure(new Parameters().fileBased().setFile(testFile));
        config = builder.getConfiguration();

        CountDownLatch startLatch = new CountDownLatch(1);
        Collection<SubNodeAccessThread> threads =
                new ArrayList<SubNodeAccessThread>();
View Full Code Here

    @Test
    public void testApplyDefaultsOnSubClass()
    {
        manager.registerDefaultsHandler(FileBasedBuilderParameters.class,
                new FileBasedDefaultsHandler());
        XMLBuilderParameters params = parameters.xml();
        manager.initializeParameters(params);
        Map<String, Object> map = params.getParameters();
        checkDefaultValues(map);
    }
View Full Code Here

    @Test
    public void testApplyDefaultsStartClass()
    {
        manager.registerDefaultsHandler(FileBasedBuilderParameters.class,
                new FileBasedDefaultsHandler(), XMLBuilderParameters.class);
        XMLBuilderParameters paramsXml = parameters.xml();
        manager.initializeParameters(paramsXml);
        Map<String, Object> map = paramsXml.getParameters();
        checkDefaultValues(map);
        PropertiesBuilderParameters paramsProps = parameters.properties();
        manager.initializeParameters(paramsProps);
        map = paramsProps.getParameters();
        checkNoDefaultValues(map);
View Full Code Here

                                .setExpressionEngine(engine);
                    }
                });
        manager.registerDefaultsHandler(FileBasedBuilderParameters.class,
                new FileBasedDefaultsHandler());
        XMLBuilderParameters params = parameters.xml();
        manager.initializeParameters(params);
        Map<String, Object> map = params.getParameters();
        checkDefaultValues(map);
        assertSame("Expression engine not set", engine,
                map.get("expressionEngine"));
    }
View Full Code Here

                handler, XMLBuilderParameters.class);
        manager.registerDefaultsHandler(FileBasedBuilderParameters.class,
                handler, PropertiesBuilderParameters.class);
        manager.unregisterDefaultsHandler(handler);

        XMLBuilderParameters paramsXml = parameters.xml();
        manager.initializeParameters(paramsXml);
        checkNoDefaultValues(paramsXml.getParameters());
        PropertiesBuilderParameters paramsProps = parameters.properties();
        manager.initializeParameters(paramsProps);
        checkNoDefaultValues(paramsProps.getParameters());
    }
View Full Code Here

                handler, XMLBuilderParameters.class);
        manager.registerDefaultsHandler(FileBasedBuilderParameters.class,
                handler, PropertiesBuilderParameters.class);
        manager.unregisterDefaultsHandler(handler,
                PropertiesBuilderParameters.class);
        XMLBuilderParameters paramsXml = parameters.xml();
        manager.initializeParameters(paramsXml);
        checkDefaultValues(paramsXml.getParameters());
        PropertiesBuilderParameters paramsProps = parameters.properties();
        manager.initializeParameters(paramsProps);
        checkNoDefaultValues(paramsProps.getParameters());
    }
View Full Code Here

     */
    @Test
    public void testGetDateNoFormatPropertyConversionHandler() throws Exception
    {
        conf.clearProperty(DataConfiguration.DATE_FORMAT_KEY);
        DefaultConversionHandler handler = new DefaultConversionHandler();
        handler.setDateFormat(DATE_PATTERN);
        conf.setConversionHandler(handler);
        assertEquals("Wrong result", expectedDate(), conf.getDate("date.string"));
    }
View Full Code Here

        map.put("key2", "value2");
        map.put("list", "value1, value2");
        map.put("listesc", "value1\\,value2");

        MapConfiguration config = new MapConfiguration(map);
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        return config;
    }
View Full Code Here

     * from the parent.
     */
    @Test
    public void testSetListDelimiterHandler()
    {
        ListDelimiterHandler handler1 = new DefaultListDelimiterHandler('/');
        ListDelimiterHandler handler2 = new DefaultListDelimiterHandler(';');
        parent.setListDelimiterHandler(handler1);
        setUpSubnodeConfig();
        parent.setListDelimiterHandler(handler2);
        assertEquals("List delimiter handler not obtained from parent",
                handler1, config.getListDelimiterHandler());
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration2.builder.fluent.XMLBuilderParameters

Copyright © 2018 www.massapicom. 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.