Package org.apache.tiles.context

Examples of org.apache.tiles.context.TilesRequestContextFactory


    /**
     * Tests {@link BasicTilesContainerFactory#createDefinitionsFactory(TilesApplicationContext,
     * TilesContextFactory, LocaleResolver)}.
     */
    public void testCreateDefinitionsFactory() {
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        LocaleResolver resolver = factory.createLocaleResolver(applicationContext,
                requestContextFactory);
        DefinitionsFactory defsFactory = factory.createDefinitionsFactory(
                applicationContext, requestContextFactory, resolver);
View Full Code Here


    /**
     * Tests {@link BasicTilesContainerFactory#createLocaleResolver(TilesApplicationContext,
     * TilesContextFactory)}.
     */
    public void testCreateLocaleResolver() {
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        LocaleResolver localeResolver = factory.createLocaleResolver(applicationContext,
                requestContextFactory);
        assertTrue("The class of the locale resolver is not correct",
                localeResolver instanceof DefaultLocaleResolver);
View Full Code Here

    /**
     * Tests {@link BasicTilesContainerFactory#createDefinitionsReader(TilesApplicationContext,
     * TilesContextFactory)}.
     */
    public void testCreateDefinitionsReader() {
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        DefinitionsReader reader = factory.createDefinitionsReader(applicationContext,
                requestContextFactory);
        assertTrue("The class of the reader is not correct",
                reader instanceof DigesterDefinitionsReader);
View Full Code Here

    /**
     * Tests
     * {@link BasicTilesContainerFactory#getSourceURLs(TilesApplicationContext, TilesContextFactory)}.
     */
    public void testGetSourceURLs() {
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        List<URL> urls = factory.getSourceURLs(applicationContext, requestContextFactory);
        assertEquals("The urls list is not one-sized", 1, urls.size());
        assertEquals("The URL is not correct", url, urls.get(0));
    }
View Full Code Here

     * Tests
     * {@link BasicTilesContainerFactory#createEvaluator(TilesApplicationContext,
     * TilesContextFactory, LocaleResolver)}.
     */
    public void testCreateEvaluator() {
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        LocaleResolver resolver = factory.createLocaleResolver(applicationContext,
                requestContextFactory);
        AttributeEvaluator evaluator = factory.createEvaluator(applicationContext,
                requestContextFactory, resolver);
View Full Code Here

    /**
     * Tests
     * {@link BasicTilesContainerFactory#createPreparerFactory(TilesApplicationContext, TilesContextFactory)}.
     */
    public void testCreatePreparerFactory() {
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        PreparerFactory preparerFactory = factory.createPreparerFactory(
                applicationContext, requestContextFactory);
        assertTrue("The class of the preparer factory is not correct",
                preparerFactory instanceof BasicPreparerFactory);
View Full Code Here

     * Tests {@link BasicTilesContainerFactory#createRendererFactory(TilesApplicationContext,
     * TilesContextFactory, TilesContainer, AttributeEvaluator)}.
     */
    public void testCreateRendererFactory() {
        TilesContainer container = factory.createContainer(applicationContext);
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        LocaleResolver resolver = factory.createLocaleResolver(applicationContext,
                requestContextFactory);
        AttributeEvaluator evaluator = factory.createEvaluator(applicationContext,
                requestContextFactory, resolver);
View Full Code Here

     * Tests {@link BasicTilesContainerFactory#createDefaultAttributeRenderer(TilesApplicationContext,
     * TilesContextFactory, TilesContainer, AttributeEvaluator)}.
     */
    public void testCreateDefaultAttributeRenderer() {
        TilesContainer container = factory.createContainer(applicationContext);
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        LocaleResolver resolver = factory.createLocaleResolver(applicationContext,
                requestContextFactory);
        AttributeEvaluator evaluator = factory.createEvaluator(applicationContext,
                requestContextFactory, resolver);
View Full Code Here

        HttpServletResponse httpResponse = EasyMock
                .createMock(HttpServletResponse.class);
        EasyMock.expect(pageContext.getRequest()).andReturn(httpRequest);
        EasyMock.expect(pageContext.getResponse()).andReturn(httpResponse);

        TilesRequestContextFactory parent = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesRequestContext enclosedRequest = EasyMock
                .createMock(TilesRequestContext.class);
        EasyMock.expect(parent.createRequestContext(context, httpRequest,
                httpResponse)).andReturn(enclosedRequest);
        factory.setRequestContextFactory(parent);

        EasyMock.replay(context, pageContext, httpRequest, httpResponse, parent);
        JspTilesRequestContext request = (JspTilesRequestContext) factory
View Full Code Here

                AbstractTilesApplicationContextFactory.APPLICATION_CONTEXT_FACTORY_INIT_PARAM);
        if (contextFactory instanceof Initializable) {
            ((Initializable) contextFactory).init(configuration);
        }

        TilesRequestContextFactory requestContextFactory =
            (TilesRequestContextFactory) createFactory(configuration,
                REQUEST_CONTEXT_FACTORY_INIT_PARAM);
        requestContextFactory.init(configuration);

        RendererFactory rendererFactory =
            (RendererFactory) createFactory(configuration,
                RENDERER_FACTORY_INIT_PARAM);
View Full Code Here

TOP

Related Classes of org.apache.tiles.context.TilesRequestContextFactory

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.