Package org.apache.tiles.request.render

Examples of org.apache.tiles.request.render.CannotRenderException


    /**
     * Test method for {@link CannotRenderException#CannotRenderException(java.lang.String)}.
     */
    @Test
    public void testCannotRenderExceptionString() {
        CannotRenderException exception = new CannotRenderException("my message");
        assertEquals("my message", exception.getMessage());
        assertNull(exception.getCause());
    }
View Full Code Here


     * Test method for {@link CannotRenderException#CannotRenderException(java.lang.Throwable)}.
     */
    @Test
    public void testCannotRenderExceptionThrowable() {
        Throwable cause = new Throwable();
        CannotRenderException exception = new CannotRenderException(cause);
        assertEquals(cause.toString(), exception.getMessage());
        assertEquals(cause, exception.getCause());
    }
View Full Code Here

     * Test method for {@link CannotRenderException#CannotRenderException(java.lang.String, java.lang.Throwable)}.
     */
    @Test
    public void testCannotRenderExceptionStringThrowable() {
        Throwable cause = new Throwable();
        CannotRenderException exception = new CannotRenderException("my message", cause);
        assertEquals("my message", exception.getMessage());
        assertEquals(cause, exception.getCause());
    }
View Full Code Here

    /** {@inheritDoc} */
    @Override
    public void render(String path, Request request) throws IOException {
        if (path == null) {
            throw new CannotRenderException("Cannot dispatch a null path");
        }

        container.render(path, request);
    }
View Full Code Here

    /** {@inheritDoc} */
    public void render(Attribute attr, Request request)
        throws IOException {
        if (attr == null) {
            throw new CannotRenderException("Cannot render a null attribute");
        }

        if (attr.isPermitted(request)) {
            Renderer renderer = rendererFactory.getRenderer(attr.getRenderer());
            Object value = evaluate(attr, request);
            if (!(value instanceof String)) {
                throw new CannotRenderException(
                        "Cannot render an attribute that is not a string, toString returns: "
                                + value);
            }
            renderer.render((String) value, request);
        }
View Full Code Here

                prepare(request, attributeContext.getPreparer(), true);
            }

            render(attributeContext.getTemplateAttribute(), request);
        } catch (IOException e) {
            throw new CannotRenderException(e.getMessage(), e);
        }
    }
View Full Code Here

    /**
     * Test method for {@link CannotRenderException#CannotRenderException()}.
     */
    @Test
    public void testCannotRenderException() {
        CannotRenderException exception = new CannotRenderException();
        assertNull(exception.getMessage());
        assertNull(exception.getCause());
    }
View Full Code Here

    /**
     * Test method for {@link CannotRenderException#CannotRenderException(java.lang.String)}.
     */
    @Test
    public void testCannotRenderExceptionString() {
        CannotRenderException exception = new CannotRenderException("my message");
        assertEquals("my message", exception.getMessage());
        assertNull(exception.getCause());
    }
View Full Code Here

     * Test method for {@link CannotRenderException#CannotRenderException(java.lang.Throwable)}.
     */
    @Test
    public void testCannotRenderExceptionThrowable() {
        Throwable cause = new Throwable();
        CannotRenderException exception = new CannotRenderException(cause);
        assertEquals(cause.toString(), exception.getMessage());
        assertEquals(cause, exception.getCause());
    }
View Full Code Here

     * Test method for {@link CannotRenderException#CannotRenderException(java.lang.String, java.lang.Throwable)}.
     */
    @Test
    public void testCannotRenderExceptionStringThrowable() {
        Throwable cause = new Throwable();
        CannotRenderException exception = new CannotRenderException("my message", cause);
        assertEquals("my message", exception.getMessage());
        assertEquals(cause, exception.getCause());
    }
View Full Code Here

TOP

Related Classes of org.apache.tiles.request.render.CannotRenderException

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.