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

hazendaz / httpunit / 656

06 Dec 2025 09:11PM UTC coverage: 80.452% (+0.02%) from 80.435%
656

push

github

hazendaz
[maven-release-plugin] prepare for next development iteration

3213 of 4105 branches covered (78.27%)

Branch coverage included in aggregate %.

8245 of 10137 relevant lines covered (81.34%)

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
 * MIT License
3
 *
4
 * Copyright 2011-2025 Russell Gold
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
8
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
9
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
 *
11
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions
12
 * of the Software.
13
 *
14
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
15
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
17
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
 * DEALINGS IN THE SOFTWARE.
19
 */
20
package com.meterware.httpunit.dom;
21

22
import org.w3c.dom.Node;
23
import org.w3c.dom.Text;
24
import org.w3c.dom.html.HTMLTextAreaElement;
25

26
/**
27
 * The Class HTMLTextAreaElementImpl.
28
 */
29
public class HTMLTextAreaElementImpl extends HTMLControl implements HTMLTextAreaElement {
1✔
30

31
    /** The Constant serialVersionUID. */
32
    private static final long serialVersionUID = 1L;
33

34
    /** The value. */
35
    private String _value;
36

37
    @Override
38
    ElementImpl create() {
39
        return new HTMLTextAreaElementImpl();
1✔
40
    }
41

42
    /**
43
     * simulate blur.
44
     */
45
    @Override
46
    public void blur() {
47
        handleEvent("onblur");
×
48
    }
×
49

50
    /**
51
     * simulate focus;.
52
     */
53
    @Override
54
    public void focus() {
55
        handleEvent("onfocus");
×
56
    }
×
57

58
    /**
59
     * Gets the access key.
60
     *
61
     * @return the access key
62
     */
63
    @Override
64
    public String getAccessKey() {
65
        return getAttributeWithNoDefault("accesskey");
1✔
66
    }
67

68
    /**
69
     * Gets the cols.
70
     *
71
     * @return the cols
72
     */
73
    @Override
74
    public int getCols() {
75
        return getIntegerAttribute("cols");
1✔
76
    }
77

78
    /**
79
     * Gets the default value.
80
     *
81
     * @return the default value
82
     */
83
    @Override
84
    public String getDefaultValue() {
85
        Node node = getFirstChild();
1✔
86

87
        if (node == null) {
1✔
88
            return "";
1✔
89
        }
90

91
        if (node.getNodeType() != Node.TEXT_NODE) {
1!
92
            return null;
×
93
        }
94

95
        return node.getNodeValue();
1✔
96
    }
97

98
    /**
99
     * Gets the rows.
100
     *
101
     * @return the rows
102
     */
103
    @Override
104
    public int getRows() {
105
        return getIntegerAttribute("rows");
1✔
106
    }
107

108
    /**
109
     * Select.
110
     */
111
    @Override
112
    public void select() {
113
    }
×
114

115
    /**
116
     * Sets the access key.
117
     *
118
     * @param accessKey
119
     *            the new access key
120
     */
121
    @Override
122
    public void setAccessKey(String accessKey) {
123
        setAttribute("accesskey", accessKey);
1✔
124
    }
1✔
125

126
    /**
127
     * Sets the cols.
128
     *
129
     * @param cols
130
     *            the new cols
131
     */
132
    @Override
133
    public void setCols(int cols) {
134
        setAttribute("cols", cols);
1✔
135
    }
1✔
136

137
    /**
138
     * Sets the default value.
139
     *
140
     * @param defaultValue
141
     *            the new default value
142
     */
143
    @Override
144
    public void setDefaultValue(String defaultValue) {
145
        Text textNode = getOwnerDocument().createTextNode(defaultValue);
1✔
146
        Node child = getFirstChild();
1✔
147
        if (child == null) {
1!
148
            appendChild(textNode);
1✔
149
        } else {
150
            replaceChild(textNode, child);
×
151
        }
152
    }
1✔
153

154
    /**
155
     * Sets the rows.
156
     *
157
     * @param rows
158
     *            the new rows
159
     */
160
    @Override
161
    public void setRows(int rows) {
162
        setAttribute("rows", rows);
1✔
163
    }
1✔
164

165
    /**
166
     * Gets the value.
167
     *
168
     * @return the value
169
     */
170
    @Override
171
    public String getValue() {
172
        return _value != null ? _value : getDefaultValue();
1✔
173
    }
174

175
    /**
176
     * Sets the value.
177
     *
178
     * @param value
179
     *            the new value
180
     */
181
    @Override
182
    public void setValue(String value) {
183
        _value = value;
1✔
184
    }
1✔
185

186
    @Override
187
    public void reset() {
188
        _value = null;
1✔
189
    }
1✔
190
}
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