View Javadoc

1   /*
2    * $Id: AutocompleterTest.java 502296 2007-02-01 17:33:39Z niallp $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "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.setLoadOnTextChange("true");
47          tag.setLoadMinimumCount("3");
48          tag.setShowDownArrow("false");
49          tag.doStartTag();
50          tag.doEndTag();
51  
52          verify(AutocompleterTest.class.getResource("Autocompleter-1.txt"));
53      }
54  
55      public void testSimple() throws Exception {
56          AutocompleterTag tag = new AutocompleterTag();
57          tag.setPageContext(pageContext);
58          tag.setTheme("simple");
59          tag.setAutoComplete("true");
60          tag.setDisabled("false");
61          tag.setForceValidOption("false");
62          tag.setList("{'d','e'}");
63          tag.setHref("a");
64          tag.setDropdownWidth("10");
65          tag.setDropdownHeight("10");
66          tag.setDelay("100");
67          tag.setSearchType("b");
68          tag.setDisabled("c");
69          tag.setName("f");
70          tag.doStartTag();
71          tag.doEndTag();
72  
73          verify(AutocompleterTest.class.getResource("Autocompleter-2.txt"));
74      }
75  
76  }