• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / httpunit / 755

14 Feb 2026 07:14PM UTC coverage: 80.526%. Remained the same
755

push

github

hazendaz
[ci] Fix badge

3213 of 4105 branches covered (78.27%)

Branch coverage included in aggregate %.

8245 of 10124 relevant lines covered (81.44%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.05
/src/main/java/com/meterware/httpunit/dom/HTMLTextAreaElementImpl.java
1
/*
2
 * SPDX-License-Identifier: MIT
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2000-2026 Russell Gold
6
 * Copyright 2021-2000 hazendaz
7
 */
8
package com.meterware.httpunit.dom;
9

10
import org.w3c.dom.Node;
11
import org.w3c.dom.Text;
12
import org.w3c.dom.html.HTMLTextAreaElement;
13

14
/**
15
 * The Class HTMLTextAreaElementImpl.
16
 */
17
public class HTMLTextAreaElementImpl extends HTMLControl implements HTMLTextAreaElement {
1✔
18

19
    /** The Constant serialVersionUID. */
20
    private static final long serialVersionUID = 1L;
21

22
    /** The value. */
23
    private String _value;
24

25
    @Override
26
    ElementImpl create() {
27
        return new HTMLTextAreaElementImpl();
1✔
28
    }
29

30
    /**
31
     * simulate blur.
32
     */
33
    @Override
34
    public void blur() {
35
        handleEvent("onblur");
×
36
    }
×
37

38
    /**
39
     * simulate focus;.
40
     */
41
    @Override
42
    public void focus() {
43
        handleEvent("onfocus");
×
44
    }
×
45

46
    /**
47
     * Gets the access key.
48
     *
49
     * @return the access key
50
     */
51
    @Override
52
    public String getAccessKey() {
53
        return getAttributeWithNoDefault("accesskey");
1✔
54
    }
55

56
    /**
57
     * Gets the cols.
58
     *
59
     * @return the cols
60
     */
61
    @Override
62
    public int getCols() {
63
        return getIntegerAttribute("cols");
1✔
64
    }
65

66
    /**
67
     * Gets the default value.
68
     *
69
     * @return the default value
70
     */
71
    @Override
72
    public String getDefaultValue() {
73
        Node node = getFirstChild();
1✔
74

75
        if (node == null) {
1✔
76
            return "";
1✔
77
        }
78

79
        if (node.getNodeType() != Node.TEXT_NODE) {
1!
80
            return null;
×
81
        }
82

83
        return node.getNodeValue();
1✔
84
    }
85

86
    /**
87
     * Gets the rows.
88
     *
89
     * @return the rows
90
     */
91
    @Override
92
    public int getRows() {
93
        return getIntegerAttribute("rows");
1✔
94
    }
95

96
    /**
97
     * Select.
98
     */
99
    @Override
100
    public void select() {
101
    }
×
102

103
    /**
104
     * Sets the access key.
105
     *
106
     * @param accessKey
107
     *            the new access key
108
     */
109
    @Override
110
    public void setAccessKey(String accessKey) {
111
        setAttribute("accesskey", accessKey);
1✔
112
    }
1✔
113

114
    /**
115
     * Sets the cols.
116
     *
117
     * @param cols
118
     *            the new cols
119
     */
120
    @Override
121
    public void setCols(int cols) {
122
        setAttribute("cols", cols);
1✔
123
    }
1✔
124

125
    /**
126
     * Sets the default value.
127
     *
128
     * @param defaultValue
129
     *            the new default value
130
     */
131
    @Override
132
    public void setDefaultValue(String defaultValue) {
133
        Text textNode = getOwnerDocument().createTextNode(defaultValue);
1✔
134
        Node child = getFirstChild();
1✔
135
        if (child == null) {
1!
136
            appendChild(textNode);
1✔
137
        } else {
138
            replaceChild(textNode, child);
×
139
        }
140
    }
1✔
141

142
    /**
143
     * Sets the rows.
144
     *
145
     * @param rows
146
     *            the new rows
147
     */
148
    @Override
149
    public void setRows(int rows) {
150
        setAttribute("rows", rows);
1✔
151
    }
1✔
152

153
    /**
154
     * Gets the value.
155
     *
156
     * @return the value
157
     */
158
    @Override
159
    public String getValue() {
160
        return _value != null ? _value : getDefaultValue();
1✔
161
    }
162

163
    /**
164
     * Sets the value.
165
     *
166
     * @param value
167
     *            the new value
168
     */
169
    @Override
170
    public void setValue(String value) {
171
        _value = value;
1✔
172
    }
1✔
173

174
    @Override
175
    public void reset() {
176
        _value = null;
1✔
177
    }
1✔
178
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc