View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.juneau.bean.html5;
18  
19  import static org.apache.juneau.bean.html5.HtmlBuilder.*;
20  import static org.apache.juneau.junit.bct.BctAssertions.*;
21  
22  import org.apache.juneau.*;
23  import org.junit.jupiter.api.*;
24  
25  class Textarea_Test extends TestBase {
26  
27  	@Test void a01_basicSetters() {
28  		Textarea x = textarea()
29  			.autocomplete("a")
30  			.autofocus(true)
31  			.cols("c")
32  			.dirname("d")
33  			.disabled("e")
34  			.form("f")
35  			.inputmode("g")
36  			.maxlength("h")
37  			.minlength("i")
38  			.name("j")
39  			.placeholder("k")
40  			.readonly("l")
41  			.required("m")
42  			.rows(1)
43  			.wrap("o")
44  			._class("p")
45  			.accesskey("q")
46  			.contenteditable("r")
47  			.dir("s")
48  			.hidden("t")
49  			.id("u")
50  			.lang("v")
51  			.onabort("w")
52  			.onblur("x")
53  			.oncancel("y")
54  			.oncanplay("z")
55  			.oncanplaythrough("aa")
56  			.onchange("ab")
57  			.onclick("ac")
58  			.oncuechange("ad")
59  			.ondblclick("ae")
60  			.ondurationchange("af")
61  			.onemptied("ag")
62  			.onended("ah")
63  			.onerror("ai")
64  			.onfocus("aj")
65  			.oninput("ak")
66  			.oninvalid("al")
67  			.onkeydown("am")
68  			.onkeypress("an")
69  			.onkeyup("ao")
70  			.onload("ap")
71  			.onloadeddata("aq")
72  			.onloadedmetadata("ar")
73  			.onloadstart("as")
74  			.onmousedown("at")
75  			.onmouseenter("au")
76  			.onmouseleave("av")
77  			.onmousemove("aw")
78  			.onmouseout("ax")
79  			.onmouseover("ay")
80  			.onmouseup("az")
81  			.onmousewheel("ba")
82  			.onpause("bb")
83  			.onplay("bc")
84  			.onplaying("bd")
85  			.onprogress("be")
86  			.onratechange("bf")
87  			.onreset("bg")
88  			.onresize("bh")
89  			.onscroll("bi")
90  			.onseeked("bj")
91  			.onseeking("bk")
92  			.onselect("bl")
93  			.onshow("bm")
94  			.onstalled("bn")
95  			.onsubmit("bo")
96  			.onsuspend("bp")
97  			.ontimeupdate("bq")
98  			.ontoggle("br")
99  			.onvolumechange("bs")
100 			.onwaiting("bt")
101 			.spellcheck("bu")
102 			.style("bv")
103 			.tabindex("bw")
104 			.title("bx")
105 			.translate("by")
106 			.text("bz");
107 
108 		assertString(
109 			"<textarea autocomplete='a' autofocus='true' cols='c' dirname='d' disabled='e' form='f' inputmode='g' maxlength='h' minlength='i' name='j' placeholder='k' readonly='l' required='m' rows='1' wrap='o' class='p' accesskey='q' contenteditable='r' dir='s' hidden='t' id='u' lang='v' onabort='w' onblur='x' oncancel='y' oncanplay='z' oncanplaythrough='aa' onchange='ab' onclick='ac' oncuechange='ad' ondblclick='ae' ondurationchange='af' onemptied='ag' onended='ah' onerror='ai' onfocus='aj' oninput='ak' oninvalid='al' onkeydown='am' onkeypress='an' onkeyup='ao' onload='ap' onloadeddata='aq' onloadedmetadata='ar' onloadstart='as' onmousedown='at' onmouseenter='au' onmouseleave='av' onmousemove='aw' onmouseout='ax' onmouseover='ay' onmouseup='az' onmousewheel='ba' onpause='bb' onplay='bc' onplaying='bd' onprogress='be' onratechange='bf' onreset='bg' onresize='bh' onscroll='bi' onseeked='bj' onseeking='bk' onselect='bl' onshow='bm' onstalled='bn' onsubmit='bo' onsuspend='bp' ontimeupdate='bq' ontoggle='br' onvolumechange='bs' onwaiting='bt' spellcheck='bu' style='bv' tabindex='bw' title='bx' translate='by'>bz</textarea>",
110 			x
111 		);
112 	}
113 
114 	@Test void a02_emptyBean() {
115 		assertString("<textarea></textarea>", textarea());
116 	}
117 
118 	@Test void a03_otherConstructors() {
119 		Textarea x1 = new Textarea("a", "b");
120 		assertString("<textarea name='a'>b</textarea>", x1);
121 
122 	}
123 }