1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.struts2.views.jsp.ui;
22
23 import org.apache.struts2.views.jsp.AbstractUITagTest;
24
25 /***
26 * @see org.apache.struts2.components.Autocompleter
27 */
28 public class AutocompleterTest extends AbstractUITagTest {
29
30 public void testAjax() throws Exception {
31 AutocompleterTag tag = new AutocompleterTag();
32 tag.setPageContext(pageContext);
33 tag.setTheme("ajax");
34 tag.setAutoComplete("true");
35 tag.setDisabled("false");
36 tag.setForceValidOption("false");
37 tag.setHref("a");
38 tag.setDropdownWidth("10");
39 tag.setDropdownHeight("10");
40 tag.setDelay("100");
41 tag.setSearchType("b");
42 tag.setDisabled("c");
43 tag.setName("f");
44 tag.setValue("g");
45 tag.setIndicator("h");
46 tag.setKeyName("i");
47 tag.setLoadOnTextChange("true");
48 tag.setLoadMinimumCount("3");
49 tag.setShowDownArrow("false");
50 tag.setIconPath("i");
51 tag.setTemplateCssPath("j");
52 tag.setDataFieldName("k");
53 tag.setResultsLimit("1");
54 tag.doStartTag();
55 tag.doEndTag();
56
57 verify(AutocompleterTest.class.getResource("Autocompleter-1.txt"));
58 }
59
60 public void testSimple() throws Exception {
61 AutocompleterTag tag = new AutocompleterTag();
62 tag.setPageContext(pageContext);
63 tag.setTheme("simple");
64 tag.setAutoComplete("true");
65 tag.setDisabled("false");
66 tag.setForceValidOption("false");
67 tag.setList("{'d','e'}");
68 tag.setHref("a");
69 tag.setDropdownWidth("10");
70 tag.setDropdownHeight("10");
71 tag.setDelay("100");
72 tag.setSearchType("b");
73 tag.setDisabled("c");
74 tag.setName("f");
75 tag.setIconPath("i");
76 tag.setTemplateCssPath("j");
77 tag.setResultsLimit("1");
78 tag.doStartTag();
79 tag.doEndTag();
80
81 verify(AutocompleterTest.class.getResource("Autocompleter-2.txt"));
82 }
83
84 }