CompleteAutoloadTilesContainerFactory extends BasicTilesContainerFactory { @Override protected Renderer createDefaultAttributeRenderer(BasicRendererFactory rendererFactory, ApplicationContext applicationContext, TilesContainer container, AttributeEvaluatorFactory attributeEvaluatorFactory) { ChainedDelegateRenderer retValue = new ChainedDelegateRenderer(); retValue.addAttributeRenderer(rendererFactory.getRenderer(DEFINITION_RENDERER_NAME)); retValue.addAttributeRenderer(rendererFactory.getRenderer(VELOCITY_RENDERER_NAME)); retValue.addAttributeRenderer(rendererFactory.getRenderer(FREEMARKER_RENDERER_NAME)); retValue.addAttributeRenderer(rendererFactory.getRenderer(MUSTACHE_RENDERER_NAME)); retValue.addAttributeRenderer(rendererFactory.getRenderer(TEMPLATE_RENDERER_NAME)); retValue.addAttributeRenderer(rendererFactory.getRenderer(STRING_RENDERER_NAME)); return retValue; }  @Override TilesContainer createDecoratedContainer(TilesContainer originalContainer,
            ApplicationContext applicationContext);  }
@Test public void testCreateDefaultAttributeRenderer() { ApplicationContext applicationContext = createMock(ApplicationContext.class); TilesContainer container = createMock(TilesContainer.class); AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class); BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class); Renderer stringRenderer = createMock(Renderer.class); Renderer templateRenderer = createMock(Renderer.class); Renderer definitionRenderer = createMock(Renderer.class); Renderer velocityRenderer = createMock(Renderer.class); Renderer freemarkerRenderer = createMock(Renderer.class); Renderer mustacheRenderer = createMock(Renderer.class); expect(rendererFactory.getRenderer("string")).andReturn(stringRenderer); expect(rendererFactory.getRenderer("template")).andReturn(templateRenderer); expect(rendererFactory.getRenderer("definition")).andReturn(definitionRenderer); expect(rendererFactory.getRenderer("velocity")).andReturn(velocityRenderer); expect(rendererFactory.getRenderer("freemarker")).andReturn(freemarkerRenderer); expect(rendererFactory.getRenderer("mustache")).andReturn(mustacheRenderer); replay(container, attributeEvaluatorFactory, rendererFactory, applicationContext); Renderer renderer = factory.createDefaultAttributeRenderer(rendererFactory, applicationContext, container, attributeEvaluatorFactory); assertTrue("The default renderer class is not correct", renderer instanceof ChainedDelegateRenderer); verify(container, attributeEvaluatorFactory, rendererFactory, applicationContext); }