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