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 Area_Test extends TestBase {
26  
27  	@Test void a01_basicSetters() {
28  		Area x = area()
29  			.alt("a")
30  			.coords("b")
31  			.download("c")
32  			.href("d")
33  			.hreflang("e")
34  			.rel("f")
35  			.shape("g")
36  			.target("h")
37  			.type("i")
38  			._class("j")
39  			.accesskey("k")
40  			.contenteditable("l")
41  			.dir("m")
42  			.hidden("n")
43  			.id("o")
44  			.lang("p")
45  			.onabort("q")
46  			.onblur("r")
47  			.oncancel("s")
48  			.oncanplay("t")
49  			.oncanplaythrough("u")
50  			.onchange("v")
51  			.onclick("w")
52  			.oncuechange("x")
53  			.ondblclick("y")
54  			.ondurationchange("z")
55  			.onemptied("aa")
56  			.onended("ab")
57  			.onerror("ac")
58  			.onfocus("ad")
59  			.oninput("ae")
60  			.oninvalid("af")
61  			.onkeydown("ag")
62  			.onkeypress("ah")
63  			.onkeyup("ai")
64  			.onload("aj")
65  			.onloadeddata("ak")
66  			.onloadedmetadata("al")
67  			.onloadstart("am")
68  			.onmousedown("an")
69  			.onmouseenter("ao")
70  			.onmouseleave("ap")
71  			.onmousemove("aq")
72  			.onmouseout("ar")
73  			.onmouseover("as")
74  			.onmouseup("at")
75  			.onmousewheel("au")
76  			.onpause("av")
77  			.onplay("aw")
78  			.onplaying("ax")
79  			.onprogress("ay")
80  			.onratechange("az")
81  			.onreset("ba")
82  			.onresize("bb")
83  			.onscroll("bc")
84  			.onseeked("bd")
85  			.onseeking("be")
86  			.onselect("bf")
87  			.onshow("bg")
88  			.onstalled("bh")
89  			.onsubmit("bi")
90  			.onsuspend("bj")
91  			.ontimeupdate("bk")
92  			.ontoggle("bl")
93  			.onvolumechange("bm")
94  			.onwaiting("bn")
95  			.spellcheck("bo")
96  			.style("bp")
97  			.tabindex("bq")
98  			.title("br")
99  			.translate("bs");
100 
101 		assertString(
102 			"<area alt='a' coords='b' download='c' href='d' hreflang='e' rel='f' shape='g' target='h' type='i' class='j' accesskey='k' contenteditable='l' dir='m' hidden='n' id='o' lang='p' onabort='q' onblur='r' oncancel='s' oncanplay='t' oncanplaythrough='u' onchange='v' onclick='w' oncuechange='x' ondblclick='y' ondurationchange='z' onemptied='aa' onended='ab' onerror='ac' onfocus='ad' oninput='ae' oninvalid='af' onkeydown='ag' onkeypress='ah' onkeyup='ai' onload='aj' onloadeddata='ak' onloadedmetadata='al' onloadstart='am' onmousedown='an' onmouseenter='ao' onmouseleave='ap' onmousemove='aq' onmouseout='ar' onmouseover='as' onmouseup='at' onmousewheel='au' onpause='av' onplay='aw' onplaying='ax' onprogress='ay' onratechange='az' onreset='ba' onresize='bb' onscroll='bc' onseeked='bd' onseeking='be' onselect='bf' onshow='bg' onstalled='bh' onsubmit='bi' onsuspend='bj' ontimeupdate='bk' ontoggle='bl' onvolumechange='bm' onwaiting='bn' spellcheck='bo' style='bp' tabindex='bq' title='br' translate='bs'/>",
103 			x
104 		);
105 	}
106 
107 	@Test void a02_emptyBean() {
108 		assertString("<area/>", area());
109 	}
110 
111 	@Test void a03_otherConstructors() {
112 		Area x1 = new Area("a", "b", "c");
113 		assertString("<area shape='a' coords='b' href='c'/>", x1);
114 
115 	}
116 }