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.doStartTag();
53 tag.doEndTag();
54
55 verify(AutocompleterTest.class.getResource("Autocompleter-1.txt"));
56 }
57
58 public void testSimple() throws Exception {
59 AutocompleterTag tag = new AutocompleterTag();
60 tag.setPageContext(pageContext);
61 tag.setTheme("simple");
62 tag.setAutoComplete("true");
63 tag.setDisabled("false");
64 tag.setForceValidOption("false");
65 tag.setList("{'d','e'}");
66 tag.setHref("a");
67 tag.setDropdownWidth("10");
68 tag.setDropdownHeight("10");
69 tag.setDelay("100");
70 tag.setSearchType("b");
71 tag.setDisabled("c");
72 tag.setName("f");
73 tag.setIconPath("i");
74 tag.setTemplateCssPath("j");
75 tag.doStartTag();
76 tag.doEndTag();
77
78 verify(AutocompleterTest.class.getResource("Autocompleter-2.txt"));
79 }
80
81 }