Package org.apache.tiles.renderer

Examples of org.apache.tiles.renderer.AttributeRenderer


    public void testCreateDefaultAttributeRenderer() {
        TilesContainer container = createMock(TilesContainer.class);
        TilesRequestContextFactory requestContextFactory = createMock(TilesRequestContextFactory.class);
        AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
        BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);
        AttributeRenderer stringRenderer = createMock(TypeDetectingAttributeRenderer.class);
        AttributeRenderer templateRenderer = createMock(TypeDetectingAttributeRenderer.class);
        AttributeRenderer definitionRenderer = createMock(TypeDetectingAttributeRenderer.class);

        expect(rendererFactory.getRenderer("string")).andReturn(stringRenderer);
        expect(rendererFactory.getRenderer("template")).andReturn(templateRenderer);
        expect(rendererFactory.getRenderer("definition")).andReturn(definitionRenderer);

        replay(container, requestContextFactory, attributeEvaluatorFactory,
                rendererFactory);
        AttributeRenderer renderer = factory.createDefaultAttributeRenderer(
                rendererFactory, applicationContext, requestContextFactory,
                container, attributeEvaluatorFactory);
        assertTrue("The default renderer class is not correct",
                renderer instanceof ChainedDelegateAttributeRenderer);
        verify(container, requestContextFactory, attributeEvaluatorFactory,
View Full Code Here


        AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
        BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);

        replay(container, requestContextFactory, attributeEvaluatorFactory,
                rendererFactory);
        AttributeRenderer renderer = factory.createStringAttributeRenderer(
                rendererFactory, applicationContext, requestContextFactory,
                container, attributeEvaluatorFactory);
        assertTrue("The renderer class is not correct",
                renderer instanceof StringAttributeRenderer);
        verify(container, requestContextFactory, attributeEvaluatorFactory,
View Full Code Here

        AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
        BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);

        replay(container, requestContextFactory, attributeEvaluatorFactory,
                rendererFactory);
        AttributeRenderer renderer = factory.createTemplateAttributeRenderer(
                rendererFactory, applicationContext, requestContextFactory,
                container, attributeEvaluatorFactory);
        assertTrue("The renderer class is not correct",
                renderer instanceof TemplateAttributeRenderer);
        verify(container, requestContextFactory, attributeEvaluatorFactory,
View Full Code Here

        AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
        BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);

        replay(container, requestContextFactory, attributeEvaluatorFactory,
                rendererFactory);
        AttributeRenderer renderer = factory.createDefinitionAttributeRenderer(
                rendererFactory, applicationContext, requestContextFactory,
                container, attributeEvaluatorFactory);
        assertTrue("The renderer class is not correct",
                renderer instanceof DefinitionAttributeRenderer);
        verify(container, requestContextFactory, attributeEvaluatorFactory,
View Full Code Here

TOP

Related Classes of org.apache.tiles.renderer.AttributeRenderer

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.