Examples of ConfigurationInterpolator


Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

            String basePath = xmlParams.getFileHandler().getBasePath();
            if (basePath != null)
            {
                BeanHelper.setProperty(resolver, "baseDir", basePath);
            }
            ConfigurationInterpolator ci = new ConfigurationInterpolator();
            ci.registerLookups(fetchPrefixLookups());
            BeanHelper.setProperty(resolver, "interpolator", ci);

            xmlParams.setEntityResolver(resolver);
        }
    }
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * @param defConfig the definition configuration
     */
    private void setUpParentInterpolator(Configuration resultConfig,
            Configuration defConfig)
    {
        parentInterpolator = new ConfigurationInterpolator();
        parentInterpolator.addDefaultLookup(new ConfigurationLookup(
                resultConfig));
        ConfigurationInterpolator defInterpolator = defConfig.getInterpolator();
        if (defInterpolator != null)
        {
            defInterpolator.setParentInterpolator(parentInterpolator);
        }
    }
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * Tests whether a {@code ConfigurationInterpolator} can be set.
     */
    @Test
    public void testSetInterpolator()
    {
        ConfigurationInterpolator ci =
                EasyMock.createMock(ConfigurationInterpolator.class);
        EasyMock.replay(ci);
        assertSame("Wrong result", params, params.setInterpolator(ci));
        assertSame("Wrong interpolator", ci,
                params.getParameters().get("interpolator"));
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * Tests whether a parent {@code ConfigurationInterpolator} can be set.
     */
    @Test
    public void testSetParentInterpolator()
    {
        ConfigurationInterpolator parent =
                EasyMock.createMock(ConfigurationInterpolator.class);
        EasyMock.replay(parent);
        assertSame("Wrong result", params, params.setParentInterpolator(parent));
        assertSame("Wrong parent", parent,
                params.getParameters().get("parentInterpolator"));
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

    @Test
    public void testSetLookupsAndInterpolator()
    {
        Lookup look1 = EasyMock.createMock(Lookup.class);
        Lookup look2 = EasyMock.createMock(Lookup.class);
        ConfigurationInterpolator parent =
                EasyMock.createMock(ConfigurationInterpolator.class);
        ConfigurationInterpolator ci =
                EasyMock.createMock(ConfigurationInterpolator.class);
        params.setDefaultLookups(Collections.singleton(look1));
        params.setPrefixLookups(Collections.singletonMap("test", look2));
        params.setInterpolator(ci);
        params.setParentInterpolator(parent);
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * Tests whether a specification object for interpolation can be obtained.
     */
    @Test
    public void testFetchInterpolatorSpecification()
    {
        ConfigurationInterpolator parent =
                EasyMock.createMock(ConfigurationInterpolator.class);
        Lookup l1 = EasyMock.createMock(Lookup.class);
        Lookup l2 = EasyMock.createMock(Lookup.class);
        Lookup l3 = EasyMock.createMock(Lookup.class);
        Map<String, Lookup> prefixLookups = new HashMap<String, Lookup>();
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * ConfigurationInterpolator is present.
     */
    @Test
    public void testFetchInterpolatorSpecificationWithInterpolator()
    {
        ConfigurationInterpolator ci =
                EasyMock.createMock(ConfigurationInterpolator.class);
        params.setInterpolator(ci);
        InterpolatorSpecification spec =
                BasicBuilderParameters.fetchInterpolatorSpecification(params
                        .getParameters());
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     */
    @Test
    public void testCloneValues()
    {
        Log log = EasyMock.createMock(Log.class);
        ConfigurationInterpolator ci =
                EasyMock.createMock(ConfigurationInterpolator.class);
        ListDelimiterHandler handler1 = EasyMock.createMock(ListDelimiterHandler.class);
        ListDelimiterHandler handler2 = EasyMock.createMock(ListDelimiterHandler.class);
        params.setListDelimiterHandler(handler1);
        params.setLogger(log);
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * Tests whether a {@code ConfigurationInterpolator} can be set.
     */
    @Test
    public void testSetInterpolator()
    {
        ConfigurationInterpolator interpolator =
                EasyMock.createMock(ConfigurationInterpolator.class);
        EasyMock.replay(interpolator);
        config.setInterpolator(interpolator);
        assertSame("Interpolator not set", interpolator,
                config.getInterpolator());
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

        Map<String, Lookup> prefixLookups = new HashMap<String, Lookup>();
        prefixLookups.put("test", prefixLookup);
        List<Lookup> defLookups = new ArrayList<Lookup>();
        defLookups.add(defLookup);
        config.installInterpolator(prefixLookups, defLookups);
        ConfigurationInterpolator interpolator = config.getInterpolator();
        assertEquals("Wrong prefix lookups", prefixLookups,
                interpolator.getLookups());
        List<Lookup> defLookups2 = interpolator.getDefaultLookups();
        assertEquals("Wrong number of default lookups", 2, defLookups2.size());
        assertSame("Wrong default lookup 1", defLookup, defLookups2.get(0));
        String var = "testVariable";
        Object value = 42;
        config.addProperty(var, value);
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.