View Javadoc

1   /*
2    * $Id: DateTimePickerTagTest.java 493867 2007-01-07 22:26:23Z mrdon $
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  /***
27   */
28  public class DateTimePickerTagTest extends AbstractUITagTest {
29  
30  
31      public void testGenericSimple() throws Exception {
32          AbstractRemoteCallUITag tag = new DivTag();
33          verifyGenericProperties(tag, "simple", new String[]{"value","tabindex","disabled"});
34      }
35  
36      public void testGenericXhtml() throws Exception {
37          AbstractRemoteCallUITag tag = new DivTag();
38          verifyGenericProperties(tag, "xhtml", new String[]{"value","tabindex","disabled"});
39      }
40  
41      public void testGenericAjax() throws Exception {
42          AbstractRemoteCallUITag tag = new DivTag();
43          verifyGenericProperties(tag, "ajax", new String[]{"value","tabindex","disabled"});
44      }
45  
46      public void testSimple() throws Exception {
47          DateTimePickerTag tag = new DateTimePickerTag();
48          tag.setPageContext(pageContext);
49  
50          tag.setId("id");
51          tag.setTheme("ajax");
52  
53          tag.setAdjustWeeks("true");
54          tag.setDayWidth("b");
55          tag.setDisplayWeeks("true");
56          tag.setEndDate("d");
57          tag.setStartDate("e");
58          tag.setStaticDisplay("false");
59          tag.setWeekStartsOn("g");
60          tag.setName("h");
61          tag.setLanguage("i");
62          tag.doStartTag();
63          tag.doEndTag();
64  
65          verify(DateTimePickerTagTest.class.getResource("DateTimePickerTagTest-1.txt"));
66      }
67  
68  }