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