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