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