Package org.apache.tapestry5.ioc.services

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


        final ServletContext context = config.getServletContext();

        String filterName = config.getFilterName();

        SymbolProvider combinedProvider = new DelegatingSymbolProvider(
                new SystemPropertiesSymbolProvider(),
                new SingleKeySymbolProvider(SymbolConstants.CONTEXT_PATH, context.getContextPath()),
                new ServletContextSymbolProvider(context),
                new SingleKeySymbolProvider(SymbolConstants.EXECUTION_MODE, "production"));

        String executionMode = combinedProvider.valueForSymbol(SymbolConstants.EXECUTION_MODE);

        TapestryAppInitializer appInitializer = new TapestryAppInitializer(logger, combinedProvider,
                filterName, executionMode);

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


    {
        assert InternalUtils.isNonBlank(appPackage);
        assert appName != null;
        assert InternalUtils.isNonBlank(contextPath);

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

        TapestryAppInitializer initializer = new TapestryAppInitializer(LoggerFactory.getLogger(PageTester.class), provider, appName,
                null);

        initializer.addModules(PageTesterModule.class);
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, 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

        extraLoader = new URLClassLoader(new URL[] { url }, contextLoader);
        RegistryBuilder builder = new RegistryBuilder(extraLoader);

        builder.add(TapestryModule.class);

        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

        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

        expect(context.getInitParameter(key1)).andReturn(value1);
        expect(context.getInitParameter(key2)).andReturn(value2);

        replay();

        SymbolProvider p = new ServletContextSymbolProvider(context);

        assertEquals(p.valueForSymbol(key1), value1);
        assertEquals(p.valueForSymbol(key2), value2);

        // Not in config is null
        assertNull(p.valueForSymbol("wilma"));

        // Check for case insensitivity
        assertEquals(p.valueForSymbol("FRED"), value1);

        verify();
    }
View Full Code Here

    }

    @Test
    public void simple_expansions()
    {
        SymbolProvider provider = mockSymbolProvider();

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

        train_valueForSymbol(provider, "barney", "Barney");
        train_valueForSymbol(provider, "dino", "Dino");
View Full Code Here

    @Test
    public void undefined_symbol()
    {

        SymbolProvider provider = mockSymbolProvider();

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

        train_valueForSymbol(provider, "barney", null);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.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.