Package org.apache.tapestry5.ioc.services

Examples of org.apache.tapestry5.ioc.services.SymbolSource


        train_valueForSymbol(provider, "barney", "Barney");
        train_valueForSymbol(provider, "dino", "Dino");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        assertEquals(
                source.expandSymbols("Fred's friends are ${fred.friends}."),
                "Fred's friends are Barney and Dino.");

        verify();
    }
View Full Code Here


        train_valueForSymbol(provider, "barney.friends", "${fred} and ${betty}");
        train_valueForSymbol(provider, "fred", null);

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        try
        {
            source.valueForSymbol("barney");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here

        train_valueForSymbol(provider, "barney.friends", "${fred} and ${betty");
        train_valueForSymbol(provider, "fred", "Fred");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        try
        {
            source.valueForSymbol("barney");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here

        train_valueForSymbol(provider1, "dino", null);
        train_valueForSymbol(provider2, "dino", "Dino");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        assertEquals(
                source.expandSymbols("Fred's friends are ${fred.friends}."),
                "Fred's friends are Barney and Dino.");

        verify();
    }
View Full Code Here

        train_valueForSymbol(provider, "barney", "Barney");
        train_valueForSymbol(provider, "dino", "Dino");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        assertEquals(source.valueForSymbol("fred"), "Fred's friends are Barney and Dino.");

        verify();

        replay();

        // This time, comes out of the cache.

        assertEquals(source.valueForSymbol("fred"), "Fred's friends are Barney and Dino.");

        verify();
    }
View Full Code Here

        train_valueForSymbol(provider, "barney", "Barney (whose friends are ${barney.friends})");
        train_valueForSymbol(provider, "barney.friends", "${fred} and ${betty}");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        try
        {
            source.valueForSymbol("fred");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here

    }

    @Test
    public void integration_test()
    {
        SymbolSource source = getService(SymbolSource.class);

        // SystemPropertiesSymbolProvider is available by default

        String userName = System.getProperty("user.name");

        assertEquals(source.valueForSymbol("user.name"), userName);
    }
View Full Code Here

        }

        // Let subclasses do more.
        configure(config);

        renderSupport.addInit("autocompleter", new JSONArray(id, menuId, link.toAbsoluteURI(), config));
    }
View Full Code Here

        "class", "t-autocomplete-menu");
        writer.end();

        Link link = resources.createEventLink(EVENT_NAME);

        JSONObject config = new JSONObject();
        config.put("paramName", PARAM_NAME);
        config.put("indicator", loaderId);

        if (resources.isBound("minChars"))
            config.put("minChars", minChars);

        if (resources.isBound("frequency"))
            config.put("frequency", frequency);

        if (resources.isBound("tokens"))
        {
            for (int i = 0; i < tokens.length(); i++)
            {
                config.accumulate("tokens", tokens.substring(i, i + 1));
            }
        }

        // Let subclasses do more.
        configure(config);
View Full Code Here

        MarkupWriter writer = factory.newPartialMarkupWriter(contentType);

        generateResponseMarkup(writer, matchesHolder.get());

        return new TextStreamResponse(contentType.toString(), writer.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.services.SymbolSource

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.