Package org.apache.velocity.runtime

Examples of org.apache.velocity.runtime.Renderable


        String toString = null;
        if (value != null)
        {         
            if (value instanceof Renderable)
            {
                Renderable renderable = (Renderable)value;
                try
                {
                    if (renderable.render(context,writer))
                      return true;
                }
                catch(RuntimeException e)
                {
                    // We commonly get here when an error occurs within a block reference.
View Full Code Here


        container.render(eq(attribute), isA(VelocityRequest.class));

        replay(velocityContext, request, response, servletContext, container,
                internalContextAdapter, applicationContext);
        initializeTool();
        Renderable renderable = tool.render(attribute);
        renderable.render(internalContextAdapter, writer);
        verify(velocityContext, request, response, servletContext, container,
                internalContextAdapter, applicationContext);
    }
View Full Code Here

        container.render(eq("myDefinition"), isA(VelocityRequest.class));

        replay(velocityContext, request, response, servletContext, container,
                internalContextAdapter, applicationContext);
        initializeTool();
        Renderable renderable = tool.renderDefinition("myDefinition");
        renderable.render(internalContextAdapter, writer);
        verify(velocityContext, request, response, servletContext, container,
                internalContextAdapter, applicationContext);
    }
View Full Code Here

        container.renderContext(isA(VelocityRequest.class));

        replay(velocityContext, request, response, servletContext, container,
                internalContextAdapter, applicationContext);
        initializeTool();
        Renderable renderable = tool.renderAttributeContext();
        renderable.render(internalContextAdapter, writer);
        verify(velocityContext, request, response, servletContext, container,
                internalContextAdapter, applicationContext);
    }
View Full Code Here

     */
    public Renderable end() {
        if (currentExecutable == null) {
            throw new NullPointerException("The current model to start has not been set");
        }
        Renderable retValue = currentExecutable.end(getRequest(),
                getResponse(), getVelocityContext());
        currentExecutable = null;
        return retValue;
    }
View Full Code Here

     */
    @Test
    public void testAddAttributeMapOfStringObject() {
        TilesVelocityRepository repository = createMock(TilesVelocityRepository.class);
        AddAttributeVModel model = createMock(AddAttributeVModel.class);
        Renderable renderable = createMock(Renderable.class);
        Map<String, Object> params = createParams();

        expect(servletContext.getAttribute(TILES_VELOCITY_REPOSITORY_KEY)).andReturn(repository);
        expect(repository.getAddAttribute()).andReturn(model);
        expect(model.execute(request, response, velocityContext, params)).andReturn(renderable);
View Full Code Here

     */
    @Test
    public void testDefinitionMapOfStringObject() {
        TilesVelocityRepository repository = createMock(TilesVelocityRepository.class);
        DefinitionVModel model = createMock(DefinitionVModel.class);
        Renderable renderable = createMock(Renderable.class);
        Map<String, Object> params = createParams();

        expect(servletContext.getAttribute(TILES_VELOCITY_REPOSITORY_KEY)).andReturn(repository);
        expect(repository.getDefinition()).andReturn(model);
        expect(model.execute(request, response, velocityContext, params)).andReturn(renderable);
View Full Code Here

     */
    @Test
    public void testGetAsStringMapOfStringObject() {
        TilesVelocityRepository repository = createMock(TilesVelocityRepository.class);
        GetAsStringVModel model = createMock(GetAsStringVModel.class);
        Renderable renderable = createMock(Renderable.class);
        Map<String, Object> params = createParams();

        expect(servletContext.getAttribute(TILES_VELOCITY_REPOSITORY_KEY)).andReturn(repository);
        expect(repository.getGetAsString()).andReturn(model);
        expect(model.execute(request, response, velocityContext, params)).andReturn(renderable);
View Full Code Here

     */
    @Test
    public void testImportAttribute() {
        TilesVelocityRepository repository = createMock(TilesVelocityRepository.class);
        ImportAttributeVModel model = createMock(ImportAttributeVModel.class);
        Renderable renderable = createMock(Renderable.class);
        Map<String, Object> params = createParams();

        expect(servletContext.getAttribute(TILES_VELOCITY_REPOSITORY_KEY)).andReturn(repository);
        expect(repository.getImportAttribute()).andReturn(model);
        expect(model.execute(request, response, velocityContext, params)).andReturn(renderable);
View Full Code Here

     */
    @Test
    public void testInsertAttributeMapOfStringObject() {
        TilesVelocityRepository repository = createMock(TilesVelocityRepository.class);
        InsertAttributeVModel model = createMock(InsertAttributeVModel.class);
        Renderable renderable = createMock(Renderable.class);
        Map<String, Object> params = createParams();

        expect(servletContext.getAttribute(TILES_VELOCITY_REPOSITORY_KEY)).andReturn(repository);
        expect(repository.getInsertAttribute()).andReturn(model);
        expect(model.execute(request, response, velocityContext, params)).andReturn(renderable);
View Full Code Here

TOP

Related Classes of org.apache.velocity.runtime.Renderable

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.