Package org.apache.tiles

Examples of org.apache.tiles.TilesContainer.evaluate()


        AttributeContext attributeContext = createMock(AttributeContext.class);
        Attribute attribute = new Attribute();

        expect(container.getAttributeContext(requestItem)).andReturn(attributeContext);
        expect(attributeContext.getAttribute("myName")).andReturn(attribute);
        expect(container.evaluate(attribute, requestItem)).andThrow(new RuntimeException());

        replay(container, attributeContext);
        try {
            model.getImportedAttributes(container, "myName", null, false, requestItem);
        } finally {
View Full Code Here


        AttributeContext attributeContext = createMock(AttributeContext.class);
        Attribute attribute = new Attribute();

        expect(container.getAttributeContext(requestItem)).andReturn(attributeContext);
        expect(attributeContext.getAttribute("myName")).andReturn(attribute);
        expect(container.evaluate(attribute, requestItem)).andReturn(null);

        replay(container, attributeContext);
        model.getImportedAttributes(container, "myName", null, true, requestItem);
        verify(container, attributeContext);
    }
View Full Code Here

        AttributeContext attributeContext = createMock(AttributeContext.class);
        Attribute attribute = new Attribute();

        expect(container.getAttributeContext(requestItem)).andReturn(attributeContext);
        expect(attributeContext.getAttribute("myName")).andReturn(attribute);
        expect(container.evaluate(attribute, requestItem)).andThrow(new RuntimeException());

        replay(container, attributeContext);
        model.getImportedAttributes(container, "myName", null, true, requestItem);
        verify(container, attributeContext);
    }
View Full Code Here

        expect(pageContext.getRequest()).andReturn(httpServletRequest);
        expect(pageContext.getResponse()).andReturn(httpServletResponse);
        expect(pageContext.getAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME, PageContext.REQUEST_SCOPE)).andReturn(container);
        expect(container.getAttributeContext(isA(JspRequest.class))).andReturn(attributeContext);
        expect(attributeContext.getAttribute("name")).andReturn(attribute);
        expect(container.evaluate(isA(Attribute.class), isA(JspRequest.class))).andReturn(new Integer(1));
        pageContext.setAttribute("id", new Integer(1), PageContext.PAGE_SCOPE);
        replay(jspBody, pageContext, parent,
               applicationContext, httpServletRequest, httpServletResponse,
               applicationScope, container, attributeContext, attribute);
        tag.setName("name");
View Full Code Here

        expect(request.getApplicationContext()).andReturn(applicationContext);
        expect(request.getContext("request")).andReturn(requestScope).anyTimes();
        expect(container.getAttributeContext(request)).andReturn(attributeContext);
        expect(attributeContext.getAttribute("myName")).andReturn(attribute);
        expect(container.evaluate(attribute, request)).andReturn("myEvaluatedValue");

        replay(container, attributeContext, request, applicationContext);
        model.execute("myName", "request", null, false, request);
        Map<String, Object> attributes = requestScope;
        assertEquals(2, attributes.size());
View Full Code Here

        expect(request.getApplicationContext()).andReturn(applicationContext);
        expect(request.getContext("request")).andReturn(requestScope).anyTimes();
        expect(container.getAttributeContext(request)).andReturn(attributeContext);
        expect(attributeContext.getAttribute("myName")).andReturn(attribute);
        expect(container.evaluate(attribute, request)).andReturn("myEvaluatedValue");

        replay(container, attributeContext, request, applicationContext);
        model.execute("myName", "request", "myToName", false, request);
        Map<String, Object> attributes = requestScope;
        assertEquals(2, attributes.size());
View Full Code Here

        expect(attributeContext.getCascadedAttributeNames()).andReturn(cascadedNames);
        expect(attributeContext.getLocalAttributeNames()).andReturn(localNames);
        expect(attributeContext.getAttribute("myName1")).andReturn(attribute1).times(2);
        expect(attributeContext.getAttribute("myName2")).andReturn(attribute2);
        expect(attributeContext.getAttribute("myName3")).andReturn(attribute3);
        expect(container.evaluate(attribute1, request)).andReturn("myEvaluatedValue1").times(2);
        expect(container.evaluate(attribute2, request)).andReturn("myEvaluatedValue2");
        expect(container.evaluate(attribute3, request)).andReturn("myEvaluatedValue3");

        replay(container, attributeContext, request, applicationContext);
        model.execute(null, "request", null, false, request);
View Full Code Here

        expect(attributeContext.getLocalAttributeNames()).andReturn(localNames);
        expect(attributeContext.getAttribute("myName1")).andReturn(attribute1).times(2);
        expect(attributeContext.getAttribute("myName2")).andReturn(attribute2);
        expect(attributeContext.getAttribute("myName3")).andReturn(attribute3);
        expect(container.evaluate(attribute1, request)).andReturn("myEvaluatedValue1").times(2);
        expect(container.evaluate(attribute2, request)).andReturn("myEvaluatedValue2");
        expect(container.evaluate(attribute3, request)).andReturn("myEvaluatedValue3");

        replay(container, attributeContext, request, applicationContext);
        model.execute(null, "request", null, false, request);
        Map<String, Object> attributes = requestScope;
View Full Code Here

        expect(attributeContext.getAttribute("myName1")).andReturn(attribute1).times(2);
        expect(attributeContext.getAttribute("myName2")).andReturn(attribute2);
        expect(attributeContext.getAttribute("myName3")).andReturn(attribute3);
        expect(container.evaluate(attribute1, request)).andReturn("myEvaluatedValue1").times(2);
        expect(container.evaluate(attribute2, request)).andReturn("myEvaluatedValue2");
        expect(container.evaluate(attribute3, request)).andReturn("myEvaluatedValue3");

        replay(container, attributeContext, request, applicationContext);
        model.execute(null, "request", null, false, request);
        Map<String, Object> attributes = requestScope;
        assertEquals(ATTRIBUTES_SIZE, attributes.size());
View Full Code Here

        expect(request.getApplicationContext()).andReturn(applicationContext);
        expect(request.getContext("request")).andReturn(requestScope).anyTimes();
        expect(container.getAttributeContext(request)).andReturn(attributeContext);
        expect(attributeContext.getAttribute("myName")).andReturn(attribute);
        expect(container.evaluate(attribute, request)).andReturn(null);

        replay(container, attributeContext, request, applicationContext);
        try {
            model.execute("myName", "request", null, false, request);
        } finally {
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.