Package org.apache.tapestry5.ioc.services

Examples of org.apache.tapestry5.ioc.services.SymbolSource.valueForSymbol()


            SymbolProvider contextProvider = new ServletContextSymbolProvider(context);
            SymbolProvider systemProvider = new SystemPropertiesSymbolProvider();

            public String valueForSymbol(String symbolName)
            {
                String contextValue = contextProvider.valueForSymbol(symbolName);
                if (contextValue != null) return contextValue;

                return systemProvider.valueForSymbol(symbolName);
            }
        };
View Full Code Here


                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

            public String valueForSymbol(String symbolName)
            {
                String contextValue = contextProvider.valueForSymbol(symbolName);
                if (contextValue != null) return contextValue;

                return systemProvider.valueForSymbol(symbolName);
            }
        };

        String executionMode = System.getProperty(SymbolConstants.EXECUTION_MODE, "production");
View Full Code Here

                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

        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"));
View Full Code Here

        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
View Full Code Here

        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

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

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

        verify();
    }

    protected final <T> Enumeration<T> toEnumeration(T... values)
View Full Code Here

    {
        Registry r = buildRegistry(CaseInsensitiveContributeMethodModule.class);

        SymbolSource symbolSource = r.getService(SymbolSource.class);

        assertEquals(symbolSource.valueForSymbol("it"), "works");

        r.shutdown();
    }
}
View Full Code Here

    getMocksControl().resetToNice();

    expect(instantiator.getModel()).andReturn(model).anyTimes();
   
    // off by default
    expect(symbolSource.valueForSymbol(PRODUCTION_MODE)).andReturn("false");
    expect(symbolSource.valueForSymbol(COMPONENT_RENDER_TRACING_ENABLED)).andReturn("false");
    expect(request.getParameter("t:component-trace")).andReturn("false");
   
    // enable by query parameter
    expect(symbolSource.valueForSymbol(PRODUCTION_MODE)).andReturn("false");
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.