View Javadoc

1   /*
2    * $Id: AutocompleterTest.java 651946 2008-04-27 13:41:38Z apetrelli $
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  
22  package org.apache.struts2.dojo.views.jsp.ui;
23  
24  /***
25   * @see org.apache.struts2.components.Autocompleter
26   */
27  public class AutocompleterTest extends AbstractUITagTest {
28  
29      public void testAjax() throws Exception {
30          AutocompleterTag tag = new AutocompleterTag();
31          tag.setPageContext(pageContext);
32          tag.setAutoComplete("true");
33          tag.setDisabled("false");
34          tag.setForceValidOption("false");
35          tag.setHref("a");
36          tag.setDropdownWidth("10");
37          tag.setDropdownHeight("10");
38          tag.setDelay("100");
39          tag.setSearchType("b");
40          tag.setDisabled("c");
41          tag.setName("f");
42          tag.setId("f");
43          tag.setValue("g");
44          tag.setIndicator("h");
45          tag.setKeyName("i");
46          tag.setLoadOnTextChange("true");
47          tag.setLoadMinimumCount("3");
48          tag.setShowDownArrow("false");
49          tag.setIconPath("i");
50          tag.setTemplateCssPath("j");
51          tag.setDataFieldName("k");
52          tag.setValueNotifyTopics("l");
53          tag.setResultsLimit("2");
54          tag.setTransport("m");
55          tag.setPreload("true");
56          tag.setKeyValue("key");
57          tag.doStartTag();
58          tag.doEndTag();
59  
60          verify(AutocompleterTest.class.getResource("Autocompleter-1.txt"));
61      }
62  
63      public void testSimple() throws Exception {
64          AutocompleterTag tag = new AutocompleterTag();
65          tag.setPageContext(pageContext);
66          tag.setAutoComplete("true");
67          tag.setDisabled("false");
68          tag.setForceValidOption("false");
69          tag.setList("{'d','e'}");
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.setId("f");
77          tag.setIconPath("i");
78          tag.setTemplateCssPath("j");
79          tag.setValueNotifyTopics("k");
80          tag.setResultsLimit("2");
81          tag.doStartTag();
82          tag.doEndTag();
83  
84          verify(AutocompleterTest.class.getResource("Autocompleter-2.txt"));
85      }
86  
87  }