Examples of JspTagLifecycle


Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testOutTagEscapeXml()
        throws JspException, IOException
    {
        OutTag tag = new OutTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setValue("<value/>");
        lifecycle.expectBodySkipped();
        lifecycle.invoke();
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

    public void testOutTagNoEscapeXml()
        throws JspException, IOException
    {
        OutTag tag = new OutTag();
        tag.setEscapeXml("false");
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setValue("<value/>");
        lifecycle.expectBodySkipped();
        lifecycle.invoke();
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testOutTagDefaultAttribute()
        throws JspException, IOException
    {
        OutTag tag = new OutTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setValue(null);
        tag.setDefault("Default");
        lifecycle.expectBodySkipped();
        lifecycle.invoke();
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testOutTagDefaultAttributeIgnored()
        throws JspException, IOException
    {
        OutTag tag = new OutTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setValue("Value");
        tag.setDefault("Default");
        lifecycle.expectBodySkipped();
        lifecycle.invoke();
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testOutTagDefaultBody()
        throws JspException, IOException
    {
        OutTag tag = new OutTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setValue(null);
        lifecycle.addNestedText("Default");
        lifecycle.expectBodyEvaluated();
        lifecycle.invoke();
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testOutTagDefaultBodyIgnored()
        throws JspException, IOException
    {
        OutTag tag = new OutTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setValue("Value");
        lifecycle.addNestedText("Default");
        lifecycle.expectBodySkipped();
        lifecycle.invoke();
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testSetTag()
        throws JspException, IOException
    {
        SetTag tag = new SetTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setVar("Var");
        tag.setValue("Value");
        lifecycle.invoke();
        assertEquals("Value", pageContext.findAttribute("Var"));
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testForEachTag()
        throws JspException, IOException
    {
        ForEachTag tag = new ForEachTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setVar("Item");
        tag.setItems("One,Two,Three");
        lifecycle.expectBodyEvaluated(3);
        lifecycle.expectScopedVariableExposed(
            "Item", new Object[] {"One", "Two", "Three"});
        lifecycle.invoke();
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testForEachTagStatus()
        throws JspException, IOException
    {
        ForEachTag tag = new ForEachTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setVarStatus("status");
        tag.setBegin("0");
        tag.setEnd("2");
        lifecycle.expectBodyEvaluated(3);
        lifecycle.addInterceptor(new JspTagLifecycle.Interceptor()
        {
            public void evalBody(int theIteration, BodyContent theBody)
            {
                LoopTagStatus status = (LoopTagStatus)
                    pageContext.findAttribute("status");
                assertNotNull(status);
                if (theIteration == 0)
                {
                    assertEquals(0, status.getIndex());
                    assertEquals(1, status.getCount());
                    assertTrue(status.isFirst());
                    assertTrue(!status.isLast());
                }
                else if (theIteration == 1)
                {
                    assertEquals(1, status.getIndex());
                    assertEquals(2, status.getCount());
                    assertTrue(!status.isFirst());
                    assertTrue(!status.isLast());
                }
                else if (theIteration == 2)
                {
                    assertEquals(2, status.getIndex());
                    assertEquals(3, status.getCount());
                    assertTrue(!status.isFirst());
                    assertTrue(status.isLast());
                }
            }
        });
        lifecycle.invoke();
    }
View Full Code Here

Examples of org.apache.cactus.extension.jsp.JspTagLifecycle

     */
    public void testIfTagTrue()
        throws JspException, IOException
    {
        IfTag tag = new IfTag();
        JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag);
        tag.setTest("true");
        lifecycle.addNestedText("Value");
        lifecycle.expectBodyEvaluated();
        lifecycle.invoke();
    }
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.