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