Package org.apache.tiles.request.servlet

Examples of org.apache.tiles.request.servlet.ServletApplicationContext


     * Sets up the test.
     */
    @Before
    public void setUp() {
        servletContext = createMock(ServletContext.class);
        applicationContext = new ServletApplicationContext(servletContext);
    }
View Full Code Here


     * Sets up the test.
     */
    @Before
    public void setUp() {
        servletContext = createMock(ServletContext.class);
        applicationContext = new ServletApplicationContext(servletContext);
    }
View Full Code Here

     */
    @SuppressWarnings("deprecation")
    @Test
    public void testRegisterAttributeRenderers() {
        BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);
        ServletApplicationContext applicationContext = createMock(ServletApplicationContext.class);
        TilesContainer container = createMock(TilesContainer.class);
        AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
        ServletContext servletContext = createMock(ServletContext.class);

        rendererFactory.registerRenderer(eq("string"), isA(StringRenderer.class));
        rendererFactory.registerRenderer(eq("template"), isA(DispatchRenderer.class));
        rendererFactory.registerRenderer(eq("definition"), isA(DefinitionRenderer.class));
        rendererFactory.registerRenderer(eq("freemarker"), isA(FreemarkerRenderer.class));
        rendererFactory.registerRenderer(eq("velocity"), isA(VelocityRenderer.class));
        rendererFactory.registerRenderer(eq("mustache"), isA(MustacheRenderer.class));

        expect(applicationContext.getContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getInitParameter(VelocityView.PROPERTIES_KEY)).andReturn(null);
        expect(servletContext.getInitParameter(VelocityView.TOOLS_KEY)).andReturn(null);
        expect(servletContext.getAttribute(VelocityView.TOOLS_KEY)).andReturn(null);
        expect(servletContext.getResourceAsStream("/WEB-INF/velocity.properties")).andReturn(
                getClass().getResourceAsStream("/velocity.properties"));
View Full Code Here

    @Override
    public void init() {
        initializer = createTilesInitializer();
        ServletContext adaptedContext = new ServletContextAdapter(
                getServletConfig());
        ServletApplicationContext preliminaryContext = new ServletApplicationContext(
                adaptedContext);
        initializer.initialize(preliminaryContext);
    }
View Full Code Here

     * @param event The intercepted event.
     */
    public void contextInitialized(ServletContextEvent event) {
        ServletContext servletContext = event.getServletContext();
        initializer = createTilesInitializer();
        initializer.initialize(new ServletApplicationContext(
                servletContext));
    }
View Full Code Here

     */
    @SuppressWarnings("deprecation")
    @Test
    public void testRegisterAttributeRenderers() {
        BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);
        ServletApplicationContext applicationContext = createMock(ServletApplicationContext.class);
        TilesContainer container = createMock(TilesContainer.class);
        AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
        ServletContext servletContext = createMock(ServletContext.class);

        rendererFactory.registerRenderer(eq("string"), isA(StringRenderer.class));
        rendererFactory.registerRenderer(eq("template"), isA(DispatchRenderer.class));
        rendererFactory.registerRenderer(eq("definition"), isA(DefinitionRenderer.class));
        rendererFactory.registerRenderer(eq("freemarker"), isA(FreemarkerRenderer.class));
        rendererFactory.registerRenderer(eq("velocity"), isA(VelocityRenderer.class));
        rendererFactory.registerRenderer(eq("mustache"), isA(MustacheRenderer.class));

        expect(applicationContext.getContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getInitParameter(VelocityView.PROPERTIES_KEY)).andReturn(null);
        expect(servletContext.getInitParameter(VelocityView.TOOLS_KEY)).andReturn(null);
        expect(servletContext.getAttribute(VelocityView.TOOLS_KEY)).andReturn(null);
        expect(servletContext.getResourceAsStream("/WEB-INF/velocity.properties")).andReturn(
                getClass().getResourceAsStream("/velocity.properties"));
View Full Code Here

    @Override
    public void init() {
        initializer = createTilesInitializer();
        ServletContext adaptedContext = new ServletContextAdapter(
                getServletConfig());
        ServletApplicationContext preliminaryContext = new ServletApplicationContext(
                adaptedContext);
        initializer.initialize(preliminaryContext);
    }
View Full Code Here

     * @param event The intercepted event.
     */
    public void contextInitialized(ServletContextEvent event) {
        ServletContext servletContext = event.getServletContext();
        initializer = createTilesInitializer();
        initializer.initialize(new ServletApplicationContext(
                servletContext));
    }
View Full Code Here

TOP

Related Classes of org.apache.tiles.request.servlet.ServletApplicationContext

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.