FileDocCategorySizeDatePackage
OptionTransferSelectTagTest.javaAPI DocExample16724Mon Jul 23 13:26:16 BST 2007org.apache.struts2.views.jsp.ui

OptionTransferSelectTagTest

public class OptionTransferSelectTagTest extends org.apache.struts2.views.jsp.AbstractUITagTest

Fields Summary
Constructors Summary
Methods Summary
public voidtestDisableSomeButtons()

        List left = new ArrayList();
        left.add("Left2");

        List right = new ArrayList();
        right.add("Right2");

        List leftVal = new ArrayList();
        leftVal.add("Left1");
        leftVal.add("Left2");
        leftVal.add("Left3");

        List rightVal = new ArrayList();
        rightVal.add("Right1");
        rightVal.add("Right2");
        rightVal.add("Right3");


        TestAction testaction = (TestAction) action;
        testaction.setCollection(left);
        testaction.setList2(right);
        testaction.setCollection2(leftVal);
        testaction.setList3(rightVal);


        OptionTransferSelectTag tag = new OptionTransferSelectTag();
        tag.setPageContext(pageContext);

        tag.setName("collection");
        tag.setId("id");
        tag.setList("collection2");
        tag.setSize("20");
        tag.setMultiple("true");
        tag.setEmptyOption("true");

        tag.setDoubleName("list2");
        tag.setDoubleList("list3");
        tag.setDoubleId("doubleId");
        tag.setDoubleSize("20");
        tag.setMultiple("true");
        tag.setDoubleEmptyOption("true");

        tag.setAllowAddAllToLeft("false");
        tag.setAllowAddAllToRight("false");
        tag.setAllowAddToLeft("true");
        tag.setAllowAddToRight("true");
        tag.setAllowSelectAll("false");

        tag.setAddAllToLeftLabel("All Left");
        tag.setAddAllToRightLabel("All Right");
        tag.setAddToLeftLabel("Left");
        tag.setAddToRightLabel("Right");
        tag.setSelectAllLabel("Select All");

        tag.setLeftTitle("Title Left");
        tag.setRightTitle("Title Right");

        tag.setButtonCssClass("buttonCssClass");
        tag.setButtonCssStyle("buttonCssStyle");

        tag.setHeaderKey("Header Key");
        tag.setHeaderValue("Header Value");

        tag.setDoubleHeaderKey("Double Header Key");
        tag.setDoubleHeaderValue("Double Header Value");

        tag.setAddToLeftOnclick("alert('Moving Left')");
        tag.setAddToRightOnclick("alert('Moving Right')");

        tag.doStartTag();
        tag.doEndTag();

        //System.out.println(writer.toString());
        verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-7.txt"));
    
public voidtestWithAllSelected()

        List left = new ArrayList();
        left.add("Left1");
        left.add("Left2");

        List right = new ArrayList();
        right.add("Right1");
        right.add("Right2");

        TestAction testaction = (TestAction) action;
        testaction.setCollection(left);
        testaction.setList2(right);

        OptionTransferSelectTag tag = new OptionTransferSelectTag();
        tag.setPageContext(pageContext);

        tag.setName("collection");
        tag.setId("id");
        tag.setList("collection");
        tag.setSize("20");
        tag.setMultiple("true");
        tag.setEmptyOption("true");

        tag.setDoubleName("list2");
        tag.setDoubleList("list2");
        tag.setDoubleId("doubleId");
        tag.setDoubleSize("20");
        tag.setMultiple("true");
        tag.setDoubleEmptyOption("true");
        tag.setDoubleCssClass("c2");
        tag.setDoubleCssStyle("s2");

        tag.setAllowAddAllToLeft("true");
        tag.setAllowAddAllToRight("true");
        tag.setAllowAddToLeft("true");
        tag.setAllowAddToRight("true");
        tag.setAllowSelectAll("true");

        tag.setAddAllToLeftLabel("All Left");
        tag.setAddAllToRightLabel("All Right");
        tag.setAddToLeftLabel("Left");
        tag.setAddToRightLabel("Right");
        tag.setSelectAllLabel("Select All");

        tag.setLeftTitle("Title Left");
        tag.setRightTitle("Title Right");

        tag.setButtonCssClass("buttonCssClass");
        tag.setButtonCssStyle("buttonCssStyle");

        tag.setHeaderKey("Header Key");
        tag.setHeaderValue("Header Value");

        tag.setDoubleHeaderKey("Double Header Key");
        tag.setDoubleHeaderValue("Double Header Value");

        tag.doStartTag();
        tag.doEndTag();

        //System.out.println(writer.toString());
        verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-1.txt"));
    
public voidtestWithPartialSelectedOnBothSides()

        List left = new ArrayList();
        left.add("Left2");

        List right = new ArrayList();
        right.add("Right2");

        List leftVal = new ArrayList();
        leftVal.add("Left1");
        leftVal.add("Left2");
        leftVal.add("Left3");

        List rightVal = new ArrayList();
        rightVal.add("Right1");
        rightVal.add("Right2");
        rightVal.add("Right3");


        TestAction testaction = (TestAction) action;
        testaction.setCollection(left);
        testaction.setList2(right);
        testaction.setCollection2(leftVal);
        testaction.setList3(rightVal);


        OptionTransferSelectTag tag = new OptionTransferSelectTag();
        tag.setPageContext(pageContext);

        tag.setName("collection");
        tag.setId("id");
        tag.setList("collection2");
        tag.setSize("20");
        tag.setMultiple("true");
        tag.setEmptyOption("true");

        tag.setDoubleName("list2");
        tag.setDoubleList("list3");
        tag.setDoubleId("doubleId");
        tag.setDoubleSize("20");
        tag.setMultiple("true");
        tag.setDoubleEmptyOption("true");

        tag.setAllowAddAllToLeft("true");
        tag.setAllowAddAllToRight("true");
        tag.setAllowAddToLeft("true");
        tag.setAllowAddToRight("true");
        tag.setAllowSelectAll("true");

        tag.setAddAllToLeftLabel("All Left");
        tag.setAddAllToRightLabel("All Right");
        tag.setAddToLeftLabel("Left");
        tag.setAddToRightLabel("Right");
        tag.setSelectAllLabel("Select All");

        tag.setLeftTitle("Title Left");
        tag.setRightTitle("Title Right");

        tag.setButtonCssClass("buttonCssClass");
        tag.setButtonCssStyle("buttonCssStyle");

        tag.setHeaderKey("Header Key");
        tag.setHeaderValue("Header Value");

        tag.setDoubleHeaderKey("Double Header Key");
        tag.setDoubleHeaderValue("Double Header Value");

        tag.doStartTag();
        tag.doEndTag();

        //System.out.println(writer.toString());
        verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-2.txt"));
    
public voidtestWithoutEmptyOptionOnBothSides()

        List left = new ArrayList();
        left.add("Left2");

        List right = new ArrayList();
        right.add("Right2");

        List leftVal = new ArrayList();
        leftVal.add("Left1");
        leftVal.add("Left2");
        leftVal.add("Left3");

        List rightVal = new ArrayList();
        rightVal.add("Right1");
        rightVal.add("Right2");
        rightVal.add("Right3");


        TestAction testaction = (TestAction) action;
        testaction.setCollection(left);
        testaction.setList2(right);
        testaction.setCollection2(leftVal);
        testaction.setList3(rightVal);


        OptionTransferSelectTag tag = new OptionTransferSelectTag();
        tag.setPageContext(pageContext);

        tag.setName("collection");
        tag.setId("id");
        tag.setList("collection2");
        tag.setSize("20");
        tag.setMultiple("true");
        tag.setEmptyOption("false");

        tag.setDoubleName("list2");
        tag.setDoubleList("list3");
        tag.setDoubleId("doubleId");
        tag.setDoubleSize("20");
        tag.setMultiple("true");
        tag.setDoubleEmptyOption("false");

        tag.setAllowAddAllToLeft("true");
        tag.setAllowAddAllToRight("true");
        tag.setAllowAddToLeft("true");
        tag.setAllowAddToRight("true");
        tag.setAllowSelectAll("true");

        tag.setAddAllToLeftLabel("All Left");
        tag.setAddAllToRightLabel("All Right");
        tag.setAddToLeftLabel("Left");
        tag.setAddToRightLabel("Right");
        tag.setSelectAllLabel("Select All");

        tag.setLeftTitle("Title Left");
        tag.setRightTitle("Title Right");

        tag.setButtonCssClass("buttonCssClass");
        tag.setButtonCssStyle("buttonCssStyle");

        tag.setHeaderKey("Header Key");
        tag.setHeaderValue("Header Value");

        tag.setDoubleHeaderKey("Double Header Key");
        tag.setDoubleHeaderValue("Double Header Value");

        tag.doStartTag();
        tag.doEndTag();

        //System.out.println(writer.toString());
        verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-5.txt"));
    
public voidtestWithoutEmptyOptionOnOneSide()

        List left = new ArrayList();
        left.add("Left2");

        List right = new ArrayList();
        right.add("Right2");

        List leftVal = new ArrayList();
        leftVal.add("Left1");
        leftVal.add("Left2");
        leftVal.add("Left3");

        List rightVal = new ArrayList();
        rightVal.add("Right1");
        rightVal.add("Right2");
        rightVal.add("Right3");


        TestAction testaction = (TestAction) action;
        testaction.setCollection(left);
        testaction.setList2(right);
        testaction.setCollection2(leftVal);
        testaction.setList3(rightVal);


        OptionTransferSelectTag tag = new OptionTransferSelectTag();
        tag.setPageContext(pageContext);

        tag.setName("collection");
        tag.setId("id");
        tag.setList("collection2");
        tag.setSize("20");
        tag.setMultiple("true");
        tag.setEmptyOption("true");

        tag.setDoubleName("list2");
        tag.setDoubleList("list3");
        tag.setDoubleId("doubleId");
        tag.setDoubleSize("20");
        tag.setMultiple("true");
        tag.setDoubleEmptyOption("false");

        tag.setAllowAddAllToLeft("true");
        tag.setAllowAddAllToRight("true");
        tag.setAllowAddToLeft("true");
        tag.setAllowAddToRight("true");
        tag.setAllowSelectAll("true");

        tag.setAddAllToLeftLabel("All Left");
        tag.setAddAllToRightLabel("All Right");
        tag.setAddToLeftLabel("Left");
        tag.setAddToRightLabel("Right");
        tag.setSelectAllLabel("Select All");

        tag.setLeftTitle("Title Left");
        tag.setRightTitle("Title Right");

        tag.setButtonCssClass("buttonCssClass");
        tag.setButtonCssStyle("buttonCssStyle");

        tag.setHeaderKey("Header Key");
        tag.setHeaderValue("Header Value");

        tag.setDoubleHeaderKey("Double Header Key");
        tag.setDoubleHeaderValue("Double Header Value");

        tag.doStartTag();
        tag.doEndTag();

        //System.out.println(writer.toString());
        verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-6.txt"));
    
public voidtestWithoutHeaderOnBothSides()

        List left = new ArrayList();
        left.add("Left2");

        List right = new ArrayList();
        right.add("Right2");

        List leftVal = new ArrayList();
        leftVal.add("Left1");
        leftVal.add("Left2");
        leftVal.add("Left3");

        List rightVal = new ArrayList();
        rightVal.add("Right1");
        rightVal.add("Right2");
        rightVal.add("Right3");


        TestAction testaction = (TestAction) action;
        testaction.setCollection(left);
        testaction.setList2(right);
        testaction.setCollection2(leftVal);
        testaction.setList3(rightVal);


        OptionTransferSelectTag tag = new OptionTransferSelectTag();
        tag.setPageContext(pageContext);

        tag.setName("collection");
        tag.setId("id");
        tag.setList("collection2");
        tag.setSize("20");
        tag.setMultiple("true");
        tag.setEmptyOption("true");

        tag.setDoubleName("list2");
        tag.setDoubleList("list3");
        tag.setDoubleId("doubleId");
        tag.setDoubleSize("20");
        tag.setMultiple("true");
        tag.setDoubleEmptyOption("true");

        tag.setAllowAddAllToLeft("true");
        tag.setAllowAddAllToRight("true");
        tag.setAllowAddToLeft("true");
        tag.setAllowAddToRight("true");
        tag.setAllowSelectAll("true");

        tag.setAddAllToLeftLabel("All Left");
        tag.setAddAllToRightLabel("All Right");
        tag.setAddToLeftLabel("Left");
        tag.setAddToRightLabel("Right");
        tag.setSelectAllLabel("Select All");

        tag.setLeftTitle("Title Left");
        tag.setRightTitle("Title Right");

        tag.setButtonCssClass("buttonCssClass");
        tag.setButtonCssStyle("buttonCssStyle");

        tag.doStartTag();
        tag.doEndTag();

        //System.out.println(writer.toString());
        verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-3.txt"));
    
public voidtestWithoutHeaderOnOneSide()

        List left = new ArrayList();
        left.add("Left2");

        List right = new ArrayList();
        right.add("Right2");

        List leftVal = new ArrayList();
        leftVal.add("Left1");
        leftVal.add("Left2");
        leftVal.add("Left3");

        List rightVal = new ArrayList();
        rightVal.add("Right1");
        rightVal.add("Right2");
        rightVal.add("Right3");


        TestAction testaction = (TestAction) action;
        testaction.setCollection(left);
        testaction.setList2(right);
        testaction.setCollection2(leftVal);
        testaction.setList3(rightVal);


        OptionTransferSelectTag tag = new OptionTransferSelectTag();
        tag.setPageContext(pageContext);

        tag.setName("collection");
        tag.setId("id");
        tag.setList("collection2");
        tag.setSize("20");
        tag.setMultiple("true");
        tag.setEmptyOption("true");

        tag.setDoubleName("list2");
        tag.setDoubleList("list3");
        tag.setDoubleId("doubleId");
        tag.setDoubleSize("20");
        tag.setMultiple("true");
        tag.setDoubleEmptyOption("true");

        tag.setAllowAddAllToLeft("true");
        tag.setAllowAddAllToRight("true");
        tag.setAllowAddToLeft("true");
        tag.setAllowAddToRight("true");
        tag.setAllowSelectAll("true");

        tag.setAddAllToLeftLabel("All Left");
        tag.setAddAllToRightLabel("All Right");
        tag.setAddToLeftLabel("Left");
        tag.setAddToRightLabel("Right");
        tag.setSelectAllLabel("Select All");

        tag.setLeftTitle("Title Left");
        tag.setRightTitle("Title Right");

        tag.setButtonCssClass("buttonCssClass");
        tag.setButtonCssStyle("buttonCssStyle");

        tag.setHeaderKey("Header Key");
        tag.setHeaderValue("Header Value");

        tag.doStartTag();
        tag.doEndTag();

        //System.out.println(writer.toString());
        verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-4.txt"));