Examples of DefaultListDelimiterHandler


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

        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

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

     * 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

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

     */
    @Test
    public void testConfigurationAtWithUpdateInitialized()
    {
        String key = "tables.table";
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
        config.setThrowExceptionOnMissing(true);
        List<HierarchicalConfiguration<ImmutableNode>> subs =
                config.configurationsAt(key, true);
        BaseHierarchicalConfiguration sub =
                (BaseHierarchicalConfiguration) subs.get(0);
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(','));
        BaseHierarchicalConfiguration c = (BaseHierarchicalConfiguration) InterpolationTestHelper
                .testInterpolatedConfiguration(config);

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

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

    @Before
    public void setUp() throws Exception
    {
        BaseConfiguration baseConfig = new BaseConfiguration();
        baseConfig.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        conf = new DataConfiguration(baseConfig);

        // empty value
        conf.addProperty("empty", "");
View Full Code Here

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

     */
    @Test
    public void testEscapeListDelimiters()
    {
        PropertiesConfiguration sub = new PropertiesConfiguration();
        sub.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        sub.addProperty("test.pi", "3\\,1415");
        config.addConfiguration(sub);
        assertEquals("Wrong value", "3,1415", config.getString("test.pi"));
    }
View Full Code Here

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

     */
    @Test
    public void testConversionExpressionEngine()
    {
        PropertiesConfiguration child = new PropertiesConfiguration();
        child.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        child.addProperty("test(a)", "1,2,3");
        config.addConfiguration(child);
        DefaultExpressionEngine engineQuery =
                new DefaultExpressionEngine(
                        new DefaultExpressionEngineSymbols.Builder(
View Full Code Here

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

    private static ListDelimiterHandler listHandler;

    @BeforeClass
    public static void setUpBeforeClass() throws Exception
    {
        listHandler = new DefaultListDelimiterHandler(';');
    }
View Full Code Here

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

     */
    @Test
    public void testConvertToHierarchicalDelimiters()
    {
        BaseConfiguration conf = new BaseConfiguration();
        conf.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        conf.addProperty("test.key", "1\\,2\\,3");
        assertEquals("Wrong property value", "1,2,3", conf
                .getString("test.key"));
        HierarchicalConfiguration<?> hc = ConfigurationUtils
                .convertToHierarchical(conf);
View Full Code Here

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

     */
    @Test
    public void testConvertToHierarchicalMultiValues()
    {
        BaseConfiguration config = new BaseConfiguration();
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        config.addProperty("test", "1,2,3");
        HierarchicalConfiguration<?> hc = ConfigurationUtils
                .convertToHierarchical(config);
        assertEquals("Wrong value 1", 1, hc.getInt("test(0)"));
        assertEquals("Wrong value 2", 2, hc.getInt("test(1)"));
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.