DoubleSelectTestpublic class DoubleSelectTest extends org.apache.struts2.views.jsp.AbstractUITagTest Test case for DoubleSelectTag. |
Methods Summary |
---|
private void | prepareTagGeneric(DoubleSelectTag tag)
TestAction testAction = (TestAction) action;
Region antwerp = new Region("Antwerp", "AN");
Region gent = new Region("Gent", "GN");
Region brugge = new Region("Brugge", "BRG");
ArrayList belgiumRegions = new ArrayList();
belgiumRegions.add(antwerp);
belgiumRegions.add(gent);
belgiumRegions.add(brugge);
Country belgium = new Country("Belgium", "BE", belgiumRegions);
Region paris = new Region("Paris", "PA");
Region bordeaux = new Region("Bordeaux", "BOR");
ArrayList franceRegions = new ArrayList();
franceRegions.add(paris);
franceRegions.add(bordeaux);
Country france = new Country("France", "FR", franceRegions);
Collection collection = new ArrayList(2);
collection.add("AN");
testAction.setCollection(collection);
tag.setList("collection");
List countries = new ArrayList();
countries.add(belgium);
countries.add(france);
testAction.setList2(countries);
tag.setValue("'FR'");
tag.setDoubleValue("'BOR'");
tag.setList("list2");
tag.setDoubleList("regions");
tag.setDoubleName("region");
tag.setListKey("iso");
tag.setDoubleListKey("key");
tag.setListValue("name");
tag.setDoubleListValue("name");
tag.setFormName("inputForm");
| public void | testDouble()
TestAction testAction = (TestAction) action;
Region antwerp = new Region("Antwerp", "AN");
Region gent = new Region("Gent", "GN");
Region brugge = new Region("Brugge", "BRG");
ArrayList belgiumRegions = new ArrayList();
belgiumRegions.add(antwerp);
belgiumRegions.add(gent);
belgiumRegions.add(brugge);
Country belgium = new Country("Belgium", "BE", belgiumRegions);
Region paris = new Region("Paris", "PA");
Region bordeaux = new Region("Bordeaux", "BOR");
ArrayList franceRegions = new ArrayList();
franceRegions.add(paris);
franceRegions.add(bordeaux);
Country france = new Country("France", "FR", franceRegions);
Collection collection = new ArrayList(2);
collection.add("AN");
testAction.setCollection(collection);
List countries = new ArrayList();
countries.add(belgium);
countries.add(france);
testAction.setList2(countries);
DoubleSelectTag tag = new DoubleSelectTag();
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setName("foo");
tag.setDoubleName("region");
tag.setList("list2");
tag.setDoubleList("regions");
tag.setListKey("iso");
tag.setDoubleListKey("key");
tag.setListValue("name");
tag.setDoubleListValue("name");
tag.setFormName("inputForm");
tag.setOnmousedown("window.status='onmousedown';");
tag.setOnmousemove("window.status='onmousemove';");
tag.setOnmouseout("window.status='onmouseout';");
tag.setOnmouseover("window.status='onmouseover';");
tag.setOnmouseup("window.status='onmouseup';");
//css style and class
tag.setCssClass("c1");
tag.setCssStyle("s1");
tag.setDoubleCssClass("c2");
tag.setDoubleCssStyle("s2");
tag.doStartTag();
tag.doEndTag();
verify(SelectTag.class.getResource("DoubleSelect-1.txt"));
| public void | testDoubleWithDefaultSelectedValues()
TestAction testAction = (TestAction) action;
Region antwerp = new Region("Antwerp", "AN");
Region gent = new Region("Gent", "GN");
Region brugge = new Region("Brugge", "BRG");
ArrayList belgiumRegions = new ArrayList();
belgiumRegions.add(antwerp);
belgiumRegions.add(gent);
belgiumRegions.add(brugge);
Country belgium = new Country("Belgium", "BE", belgiumRegions);
Region paris = new Region("Paris", "PA");
Region bordeaux = new Region("Bordeaux", "BOR");
ArrayList franceRegions = new ArrayList();
franceRegions.add(paris);
franceRegions.add(bordeaux);
Country france = new Country("France", "FR", franceRegions);
Collection collection = new ArrayList(2);
collection.add("AN");
testAction.setCollection(collection);
List countries = new ArrayList();
countries.add(belgium);
countries.add(france);
testAction.setList2(countries);
DoubleSelectTag tag = new DoubleSelectTag();
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setName("foo");
tag.setDoubleName("region");
tag.setValue("'FR'");
tag.setDoubleValue("'BOR'");
tag.setList("list2");
tag.setDoubleList("regions");
tag.setListKey("iso");
tag.setDoubleListKey("key");
tag.setListValue("name");
tag.setDoubleListValue("name");
tag.setFormName("inputForm");
tag.setOnmousedown("window.status='onmousedown';");
tag.setOnmousemove("window.status='onmousemove';");
tag.setOnmouseout("window.status='onmouseout';");
tag.setOnmouseover("window.status='onmouseover';");
tag.setOnmouseup("window.status='onmouseup';");
tag.doStartTag();
tag.doEndTag();
verify(SelectTag.class.getResource("DoubleSelect-2.txt"));
| public void | testDoubleWithDotName()
TestAction testAction = (TestAction) action;
Region antwerp = new Region("Antwerp", "AN");
Region gent = new Region("Gent", "GN");
Region brugge = new Region("Brugge", "BRG");
ArrayList belgiumRegions = new ArrayList();
belgiumRegions.add(antwerp);
belgiumRegions.add(gent);
belgiumRegions.add(brugge);
Country belgium = new Country("Belgium", "BE", belgiumRegions);
Region paris = new Region("Paris", "PA");
Region bordeaux = new Region("Bordeaux", "BOR");
ArrayList franceRegions = new ArrayList();
franceRegions.add(paris);
franceRegions.add(bordeaux);
Country france = new Country("France", "FR", franceRegions);
Collection collection = new ArrayList(2);
collection.add("AN");
testAction.setCollection(collection);
List countries = new ArrayList();
countries.add(belgium);
countries.add(france);
testAction.setList2(countries);
DoubleSelectTag tag = new DoubleSelectTag();
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setName("foo.bar");
tag.setDoubleName("region");
tag.setList("list2");
tag.setDoubleList("regions");
tag.setListKey("iso");
tag.setDoubleListKey("key");
tag.setListValue("name");
tag.setDoubleListValue("name");
tag.setFormName("inputForm");
tag.setOnmousedown("window.status='onmousedown';");
tag.setOnmousemove("window.status='onmousemove';");
tag.setOnmouseout("window.status='onmouseout';");
tag.setOnmouseover("window.status='onmouseover';");
tag.setOnmouseup("window.status='onmouseup';");
tag.doStartTag();
tag.doEndTag();
verify(SelectTag.class.getResource("DoubleSelect-3.txt"));
| public void | testGenericAjax()
DoubleSelectTag tag = new DoubleSelectTag();
prepareTagGeneric(tag);
verifyGenericProperties(tag, "ajax", new String[]{"value"});
| public void | testGenericSimple()
DoubleSelectTag tag = new DoubleSelectTag();
prepareTagGeneric(tag);
verifyGenericProperties(tag, "simple", new String[]{"value"});
| public void | testGenericXhtml()
DoubleSelectTag tag = new DoubleSelectTag();
prepareTagGeneric(tag);
verifyGenericProperties(tag, "xhtml", new String[]{"value"});
|
|