OptGroupTestpublic class OptGroupTest extends org.apache.struts2.views.jsp.AbstractUITagTest
Methods Summary |
---|
public void | testOptGroupNumbers()
((TestAction)action).setMap(new LinkedHashMap() {{
put("AAA", "aaa");
put(new Long(111111), "bbb");
put("CCC", "ccc");
}});
SelectTag selectTag = new SelectTag();
selectTag.setName("mySelection");
selectTag.setLabel("My Selection");
selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
OptGroupTag optGroupTag1 = new OptGroupTag();
optGroupTag1.setLabel("My Label 1");
optGroupTag1.setList("map");
OptGroupTag optGroupTag2 = new OptGroupTag();
optGroupTag2.setLabel("My Label 2");
optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
selectTag.setPageContext(pageContext);
selectTag.doStartTag();
optGroupTag1.setPageContext(pageContext);
optGroupTag1.doStartTag();
optGroupTag1.doEndTag();
optGroupTag2.setPageContext(pageContext);
optGroupTag2.doStartTag();
optGroupTag2.doEndTag();
selectTag.doEndTag();
//System.out.println(writer.toString());
verify(SelectTag.class.getResource("OptGroup-4.txt"));
| public void | testOptGroupSimple()
SelectTag selectTag = new SelectTag();
selectTag.setName("mySelection");
selectTag.setLabel("My Selection");
selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
OptGroupTag optGroupTag1 = new OptGroupTag();
optGroupTag1.setLabel("My Label 1");
optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
OptGroupTag optGroupTag2 = new OptGroupTag();
optGroupTag2.setLabel("My Label 2");
optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
selectTag.setPageContext(pageContext);
selectTag.doStartTag();
optGroupTag1.setPageContext(pageContext);
optGroupTag1.doStartTag();
optGroupTag1.doEndTag();
optGroupTag2.setPageContext(pageContext);
optGroupTag2.doStartTag();
optGroupTag2.doEndTag();
selectTag.doEndTag();
//System.out.println(writer.toString());
verify(SelectTag.class.getResource("OptGroup-1.txt"));
| public void | testOptGroupWithMultipleSelect()
SelectTag selectTag = new SelectTag();
selectTag.setMultiple("true");
selectTag.setName("mySelection");
selectTag.setLabel("My Selection");
selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
selectTag.setValue("%{{'EEE','BBB','TWO'}}");
OptGroupTag optGroupTag1 = new OptGroupTag();
optGroupTag1.setLabel("My Label 1");
optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
OptGroupTag optGroupTag2 = new OptGroupTag();
optGroupTag2.setLabel("My Label 2");
optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
selectTag.setPageContext(pageContext);
selectTag.doStartTag();
optGroupTag1.setPageContext(pageContext);
optGroupTag1.doStartTag();
optGroupTag1.doEndTag();
optGroupTag2.setPageContext(pageContext);
optGroupTag2.doStartTag();
optGroupTag2.doEndTag();
selectTag.doEndTag();
//System.out.println(writer.toString());
verify(SelectTag.class.getResource("OptGroup-3.txt"));
| public void | testOptGroupWithSingleSelect()
SelectTag selectTag = new SelectTag();
selectTag.setName("mySelection");
selectTag.setLabel("My Selection");
selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
selectTag.setValue("%{'EEE'}");
OptGroupTag optGroupTag1 = new OptGroupTag();
optGroupTag1.setLabel("My Label 1");
optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
OptGroupTag optGroupTag2 = new OptGroupTag();
optGroupTag2.setLabel("My Label 2");
optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
selectTag.setPageContext(pageContext);
selectTag.doStartTag();
optGroupTag1.setPageContext(pageContext);
optGroupTag1.doStartTag();
optGroupTag1.doEndTag();
optGroupTag2.setPageContext(pageContext);
optGroupTag2.doStartTag();
optGroupTag2.doEndTag();
selectTag.doEndTag();
//System.out.println(writer.toString());
verify(SelectTag.class.getResource("OptGroup-2.txt"));
|
|