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