Examples of TilesApplicationContext


Examples of org.apache.tiles.TilesApplicationContext

     * @throws IOException If something goes wrong during rendition.
     */
    public void testWrite() throws IOException {
        StringWriter writer = new StringWriter();
        Attribute attribute = new Attribute("Result", null, "string");
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesRequestContext requestContext = EasyMock
                .createMock(TilesRequestContext.class);
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

     * @throws IOException If something goes wrong during rendition.
     */
    public void testWriteDefinition() throws IOException {
        StringWriter writer = new StringWriter();
        Attribute attribute = new Attribute("my.definition", null, "definition");
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesContainer container = EasyMock.createMock(TilesContainer.class);
        TilesRequestContext requestContext = EasyMock
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

     * @throws IOException If something goes wrong during rendition.
     */
    public void testWriteString() throws IOException {
        StringWriter writer = new StringWriter();
        Attribute attribute = new Attribute("Result", null, "string");
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesContainer container = EasyMock.createMock(TilesContainer.class);
        TilesRequestContext requestContext = EasyMock
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

     * @throws IOException If something goes wrong during rendition.
     */
    public void testWriteTemplate() throws IOException {
        StringWriter writer = new StringWriter();
        Attribute attribute = new Attribute("/myTemplate.jsp", null, "template");
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesContainer container = EasyMock.createMock(TilesContainer.class);
        TilesRequestContext requestContext = EasyMock
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

    /**
     * Tests
     * {@link AbstractBaseAttributeRenderer#setApplicationContext(TilesApplicationContext)}.
     */
    public void testSetApplicationContext() {
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        EasyMock.replay(applicationContext);
        renderer.setApplicationContext(applicationContext);
        assertNotNull("The application context is null", renderer.applicationContext);
    }
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

     * @throws IOException If something goes wrong during rendition.
     */
    public void testRender() throws IOException {
        Attribute attribute = new Attribute();
        StringWriter writer = new StringWriter();
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesRequestContext requestContext = EasyMock
                .createMock(TilesRequestContext.class);
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

    /**
     * Tests {@link AbstractBaseAttributeRenderer#getRequestContext(Object...)}.
     */
    public void testGetRequestContext() {
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesRequestContext requestContext = EasyMock
                .createMock(TilesRequestContext.class);
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

    /**
     * Tests
     * {@link AbstractBaseAttributeRenderer#isPermitted(TilesRequestContext, Set)}.
     */
    public void testIsPermitted() {
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesRequestContext requestContext = EasyMock
                .createMock(TilesRequestContext.class);
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

    private BasicTilesContainer container;

    /** {@inheritDoc} */
    @Override
    public void setUp() {
        TilesApplicationContext context = EasyMock
                .createMock(TilesApplicationContext.class);
        Map<String, String> initParams = new HashMap<String, String>();
        URL url = getClass().getResource("/org/apache/tiles/factory/test-defs.xml");

        initParams.put(
                ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES,
                RepeaterTilesApplicationContextFactory.class.getName());
        initParams.put(
                ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES,
                RepeaterTilesRequestContextFactory.class.getName());
        try {
            Set<URL> urls = new HashSet<URL>();
            urls.add(url);
            EasyMock.expect(context.getResources("/WEB-INF/tiles.xml"))
                    .andReturn(urls);
        } catch (IOException e) {
            throw new RuntimeException("Error getting Tiles configuration URL",
                    e);
        }
        EasyMock.expect(context.getInitParams()).andReturn(initParams)
                .anyTimes();
        EasyMock.replay(context);
        AbstractTilesContainerFactory factory = AbstractTilesContainerFactory
                .getTilesContainerFactory(context);
        container = (BasicTilesContainer) factory.createContainer(context);
View Full Code Here

Examples of org.apache.tiles.TilesApplicationContext

            urlPath = "file:" + url.getPath();
        } else {
            urlPath = "file:/" + url.getPath();
        }

        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        Set<URL> urlSet = new HashSet<URL>();
        urlSet.add(url);
        EasyMock.expect(applicationContext.getResources(urlPath)).andReturn(
                urlSet);
        EasyMock.replay(applicationContext);
        ((TilesApplicationContextAware) factory)
                .setApplicationContext(applicationContext);
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.