Examples of DefaultListDelimiterHandler


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

    }

    @Test
    public void testSetProperty()
    {
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        config.setProperty("tables.table(0).name", "resources");
        assertEquals("resources", config.getString("tables.table(0).name"));
        config.setProperty("tables.table.name", "tab1,tab2");
        assertEquals("tab1", config.getString("tables.table(0).name"));
        assertEquals("tab2", config.getString("tables.table(1).name"));
View Full Code Here

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

     * Tests obtaining a configuration with all variables substituted.
     */
    @Test
    public void testInterpolatedConfiguration()
    {
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        AbstractHierarchicalConfiguration<?> c = (AbstractHierarchicalConfiguration<?>) InterpolationTestHelper
                .testInterpolatedConfiguration(config);

        // tests whether the hierarchical structure has been maintained
        checkGetProperty(c);
View Full Code Here

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

     * Tests whether list handling works correctly when adding properties.
     */
    @Test
    public void testAddPropertyWithListHandling()
    {
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        final String key = "list.delimiter.value";
        config.addProperty(key + ".escaped", "3\\,1415");
        config.addProperty(key + ".elements", "3,1415");
        assertEquals("Wrong escaped property", "3,1415", config.getString(key + ".escaped"));
        assertEquals("Wrong list property", "3", config.getString(key + ".elements"));
View Full Code Here

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

     * Tests changing the list delimiter handler.
     */
    @Test
    public void testSetListDelimiter()
    {
        cc.setListDelimiterHandler(new DefaultListDelimiterHandler('/'));
        checkSetListDelimiterHandler();
    }
View Full Code Here

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

     * operation.
     */
    @Test
    public void testSetListDelimiterAfterClear()
    {
        cc.setListDelimiterHandler(new DefaultListDelimiterHandler('/'));
        cc.clear();
        checkSetListDelimiterHandler();
    }
View Full Code Here

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

        assertEquals("Wrong value of property", "a,b,c", cc
                .getString("test.property"));

        AbstractConfiguration config =
                (AbstractConfiguration) cc.getInMemoryConfiguration();
        DefaultListDelimiterHandler listHandler =
                (DefaultListDelimiterHandler) config.getListDelimiterHandler();
        assertEquals("Wrong list delimiter", '/', listHandler.getDelimiter());
    }
View Full Code Here

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

    public void testSetListDelimiterInMemoryConfigNonBaseConfig()
    {
        Configuration inMemoryConfig = EasyMock.createMock(Configuration.class);
        EasyMock.replay(inMemoryConfig);
        cc = new CompositeConfiguration(inMemoryConfig);
        cc.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
    }
View Full Code Here

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

    @Before
    public void setUp() throws Exception
    {
        config = new BaseConfiguration();
        config.setThrowExceptionOnMissing(true);
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
    }
View Full Code Here

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

     */
    private static INIConfiguration setUpConfig(String data)
            throws ConfigurationException
    {
        INIConfiguration instance = new INIConfiguration();
        instance.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        load(instance, data);
        return instance;
    }
View Full Code Here

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

     */
    @Test
    public void testListDelimiterHandling() throws ConfigurationException
    {
        INIConfiguration config = new INIConfiguration();
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        config.addProperty("list", "a,b,c");
        config.addProperty("listesc", "3\\,1415");
        String output = saveToString(config);
        INIConfiguration config2 = setUpConfig(output);
        assertEquals("Wrong list size", 3, config2.getList("list").size());
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.