Package org.apache.tapestry.ioc.services

Examples of org.apache.tapestry.ioc.services.SymbolProvider


    @Test
    public void undefined_symbol_in_path()
    {

        SymbolProvider provider = newSymbolProvider();

        List<SymbolProvider> providers = Arrays.asList(provider);

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


    @Test
    public void missing_brace_in_path()
    {

        SymbolProvider provider = newSymbolProvider();

        List<SymbolProvider> providers = Arrays.asList(provider);

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

    }

    @Test
    public void providers_searched_in_order()
    {
        SymbolProvider provider1 = newSymbolProvider();
        SymbolProvider provider2 = newSymbolProvider();

        List<SymbolProvider> providers = Arrays.asList(provider1, provider2);

        train_valueForSymbol(provider1, "fred.friends", "${barney} and ${dino}");
        train_valueForSymbol(provider1, "barney", null);
View Full Code Here

    }

    @Test
    public void symbols_are_cached()
    {
        SymbolProvider provider = newSymbolProvider();

        List<SymbolProvider> providers = Arrays.asList(provider);

        train_valueForSymbol(provider, "fred", "Fred's friends are ${barney} and ${dino}.");
        train_valueForSymbol(provider, "barney", "Barney");
View Full Code Here

    }

    @Test
    public void recursive_symbols_fail()
    {
        SymbolProvider provider = newSymbolProvider();

        List<SymbolProvider> providers = Arrays.asList(provider);

        train_valueForSymbol(provider, "fred", "Fred (whose friends are ${fred.friends})");
        train_valueForSymbol(provider, "fred.friends", "${barney} and ${dino}");
View Full Code Here

     */
    public PageTester(String appPackage, String appName, String contextPath, Class... moduleClasses)
    {
        _preferedLanguage = Locale.ENGLISH;

        SymbolProvider provider = new SingleKeySymbolProvider(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM, appPackage);

        TapestryAppInitializer initializer = new TapestryAppInitializer(provider, appName, PageTesterModule.TEST_MODE);

        initializer.addModules(PageTesterModule.class);
        initializer.addModules(moduleClasses);
View Full Code Here

        builder.add(TapestryModule.class);

        // A synthetic module to ensure that the tapestry.alias-mode is set correctly.

        SymbolProvider provider = new SingleKeySymbolProvider(
                InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL, "servlet");
        ContributionDef contribution = new SyntheticSymbolSourceContributionDef("AliasMode",
                provider, "before:ApplicationDefaults");

        ModuleDef module = new SyntheticModuleDef(contribution);
View Full Code Here

        ServletContext context = _config.getServletContext();

        String filterName = _config.getFilterName();

        SymbolProvider provider = new ServletContextSymbolProvider(context);

        TapestryAppInitializer appInitializer = new TapestryAppInitializer(provider, filterName,
                "servlet");

        appInitializer.addModules(provideExtraModuleDefs(context));
View Full Code Here

    public PageTester(String appPackage, String appName, String contextPath)
    {
        _preferedLanguage = Locale.ENGLISH;
        _contextPath = contextPath;

        SymbolProvider provider = new SingleKeySymbolProvider(
                InternalConstants.TAPESTRY_APP_PACKAGE_PARAM, appPackage);

        TapestryAppInitializer initializer = new TapestryAppInitializer(provider, appName,
                PageTesterModule.TEST_MODE);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.services.SymbolProvider

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.