01: /*
02: * $Id: AutocompleterTest.java 529622 2007-04-17 14:24:01Z musachy $
03: *
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
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
58: .getResource("Autocompleter-1.txt"));
59: }
60:
61: public void testSimple() throws Exception {
62: AutocompleterTag tag = new AutocompleterTag();
63: tag.setPageContext(pageContext);
64: tag.setTheme("simple");
65: tag.setAutoComplete("true");
66: tag.setDisabled("false");
67: tag.setForceValidOption("false");
68: tag.setList("{'d','e'}");
69: tag.setHref("a");
70: tag.setDropdownWidth("10");
71: tag.setDropdownHeight("10");
72: tag.setDelay("100");
73: tag.setSearchType("b");
74: tag.setDisabled("c");
75: tag.setName("f");
76: tag.setIconPath("i");
77: tag.setTemplateCssPath("j");
78: tag.setResultsLimit("1");
79: tag.doStartTag();
80: tag.doEndTag();
81:
82: verify(AutocompleterTest.class
83: .getResource("Autocompleter-2.txt"));
84: }
85:
86: }
|