Package org.apache.commons.configuration2.convert

Examples of org.apache.commons.configuration2.convert.ListDelimiterHandler


        for (int i = 0; i < 32; i++)
        {
            beans.add(new BasicBuilderParameters());
        }
        MultiWrapDynaBean bean = new MultiWrapDynaBean(beans);
        ListDelimiterHandler listHandler = new DefaultListDelimiterHandler('+');
        PropertyUtils
                .setProperty(bean, "throwExceptionOnMissing", Boolean.TRUE);
        PropertyUtils
                .setProperty(bean, "listDelimiterHandler", listHandler);
        Map<String, Object> map = params.getParameters();
View Full Code Here


    public void testSetListDelimiterHandlerInParent()
    {
        BaseConfiguration config = new BaseConfiguration();
        AbstractConfiguration subset =
                (AbstractConfiguration) config.subset("prefix");
        ListDelimiterHandler listHandler = new DefaultListDelimiterHandler(',');
        subset.setListDelimiterHandler(listHandler);
        assertSame("Handler not passed to parent", listHandler,
                config.getListDelimiterHandler());
    }
View Full Code Here

    public void testGetListDelimiterHandlerFromParent()
    {
        BaseConfiguration config = new BaseConfiguration();
        AbstractConfiguration subset =
                (AbstractConfiguration) config.subset("prefix");
        ListDelimiterHandler listHandler = new DefaultListDelimiterHandler(',');
        config.setListDelimiterHandler(listHandler);
        assertSame("Not list handler from parent", listHandler,
                subset.getListDelimiterHandler());
    }
View Full Code Here

    public void testSetListDelimiterHandlerParentNotSupported()
    {
        Configuration config = EasyMock.createNiceMock(Configuration.class);
        EasyMock.replay(config);
        SubsetConfiguration subset = new SubsetConfiguration(config, "prefix");
        ListDelimiterHandler listHandler = new DefaultListDelimiterHandler(',');
        subset.setListDelimiterHandler(listHandler);
        assertSame("List delimiter handler not set", listHandler,
                subset.getListDelimiterHandler());
    }
View Full Code Here

     *
     * @param cc the configuration to be checked
     */
    private static void checkCombinedConfigAttrs(CombinedConfiguration cc)
    {
        ListDelimiterHandler handler = cc.getListDelimiterHandler();
        assertTrue("Wrong delimiter handler: " + handler,
                handler instanceof DefaultListDelimiterHandler);
        assertEquals("Wrong list delimiter character", ',',
                ((DefaultListDelimiterHandler) handler).getDelimiter());
    }
View Full Code Here

    @Test
    public void testCustomResultConfiguration() throws ConfigurationException
    {
        File testFile =
                ConfigurationAssert.getTestFile("testCCResultClass.xml");
        ListDelimiterHandler listHandler = new DefaultListDelimiterHandler('.');
        builder.configure(new CombinedBuilderParametersImpl()
                .setDefinitionBuilderParameters(
                        new XMLBuilderParametersImpl().setFile(testFile))
                .setListDelimiterHandler(listHandler)
                .setThrowExceptionOnMissing(false));
View Full Code Here

            throws ConfigurationException
    {
        File testFile =
                ConfigurationAssert
                        .getTestFile("testCCCombinedChildBuilder.xml");
        ListDelimiterHandler listHandler = new DefaultListDelimiterHandler('*');
        builder.configure(new CombinedBuilderParametersImpl()
                .setDefinitionBuilderParameters(
                        new XMLBuilderParametersImpl().setFile(testFile))
                .setListDelimiterHandler(listHandler));
        CombinedConfiguration cc = builder.getConfiguration();
View Full Code Here

     * test is related to CONFIGURATION-315.
     */
    @Test
    public void testInvalidateEventBeforeAndAfterChange()
    {
        ConfigurationEvent event =
                new ConfigurationEvent(config, ConfigurationEvent.ANY, null, null, true);
        config.onEvent(event);
        assertEquals("No invalidate event fired", 1, listener.invalidateEvents);
        event = new ConfigurationEvent(config, ConfigurationEvent.ANY, null, null, false);
        config.onEvent(event);
        assertEquals("Another invalidate event fired", 1,
                listener.invalidateEvents);
    }
View Full Code Here

        conf = new PotentialErrorJNDIConfiguration(ctx);

        nonStringTestHolder = new NonStringTestHolder();
        nonStringTestHolder.setConfiguration(conf);

        listener = new ErrorListenerTestImpl(conf);
        conf.addEventListener(ConfigurationErrorEvent.ANY, listener);
    }
View Full Code Here

     */
    @Test
    public void testCloneModify()
    {
        MapConfiguration config = (MapConfiguration) getConfiguration();
        config.addEventListener(ConfigurationEvent.ANY, new EventListenerTestImpl(config));
        MapConfiguration copy = (MapConfiguration) config.clone();
        assertTrue("Event listeners were copied", copy
                .getEventListeners(ConfigurationEvent.ANY).isEmpty());

        config.addProperty("cloneTest", Boolean.TRUE);
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration2.convert.ListDelimiterHandler

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.