FileDocCategorySizeDatePackage
ContextUtilTest.javaAPI DocExample4227Mon Jul 23 13:26:16 BST 2007org.apache.struts2.views.util

ContextUtilTest

public class ContextUtilTest extends TestCase
Test case for ContextUtil

Fields Summary
Constructors Summary
Methods Summary
public voidtestAltSyntaxMethod1()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", "true");

        ContextUtil.setAltSyntax("true");
        assertTrue(ContextUtil.isUseAltSyntax(stack.getContext()));
    
public voidtestAltSyntaxMethod2()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", "false");

        ContextUtil.setAltSyntax("true");
        assertTrue(ContextUtil.isUseAltSyntax(stack.getContext()));
    
public voidtestAltSyntaxMethod3()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", "true");

        ContextUtil.setAltSyntax("false");
        assertTrue(ContextUtil.isUseAltSyntax(stack.getContext()));
    
public voidtestAltSyntaxMethod4()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", "false");

        ContextUtil.setAltSyntax("false");
        assertFalse(ContextUtil.isUseAltSyntax(stack.getContext()));
    
public voidtestAltSyntaxMethod5()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", Boolean.TRUE);

        ContextUtil.setAltSyntax("true");
        assertTrue(ContextUtil.isUseAltSyntax(stack.getContext()));
    
public voidtestAltSyntaxMethod6()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", Boolean.FALSE);

        ContextUtil.setAltSyntax("true");
        assertTrue(ContextUtil.isUseAltSyntax(stack.getContext()));
    
public voidtestAltSyntaxMethod7()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", Boolean.TRUE);

        ContextUtil.setAltSyntax("false");
        assertTrue(ContextUtil.isUseAltSyntax(stack.getContext()));
    
public voidtestAltSyntaxMethod8()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", Boolean.FALSE);

        ContextUtil.setAltSyntax("false");
        assertFalse(ContextUtil.isUseAltSyntax(stack.getContext()));
    
public voidtestAltSyntaxMethod9()

        ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.getContext().put("useAltSyntax", null);

        ContextUtil.setAltSyntax("true");
        assertTrue(ContextUtil.isUseAltSyntax(stack.getContext()));