• 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

53.85
/src/main/java/com/meterware/httpunit/dom/CommentImpl.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.Comment;
11
import org.w3c.dom.DOMException;
12
import org.w3c.dom.Node;
13

14
/**
15
 * The Class CommentImpl.
16
 */
17
public class CommentImpl extends CharacterDataImpl implements Comment {
1✔
18

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

22
    /**
23
     * Creates the comment.
24
     *
25
     * @param ownerDocument
26
     *            the owner document
27
     * @param data
28
     *            the data
29
     *
30
     * @return the comment impl
31
     */
32
    static CommentImpl createComment(DocumentImpl ownerDocument, String data) {
33
        CommentImpl comment = new CommentImpl();
1✔
34
        comment.initialize(ownerDocument, data);
1✔
35
        return comment;
1✔
36
    }
37

38
    /**
39
     * Import node.
40
     *
41
     * @param document
42
     *            the document
43
     * @param comment
44
     *            the comment
45
     *
46
     * @return the node
47
     */
48
    public static Node importNode(DocumentImpl document, Comment comment) {
49
        return document.createComment(comment.getData());
1✔
50
    }
51

52
    @Override
53
    public String getNodeName() {
54
        return "#comment";
1✔
55
    }
56

57
    @Override
58
    public String getNodeValue() throws DOMException {
59
        return getData();
×
60
    }
61

62
    @Override
63
    public void setNodeValue(String nodeValue) throws DOMException {
64
        setData(nodeValue);
×
65
    }
×
66

67
    @Override
68
    public short getNodeType() {
69
        return COMMENT_NODE;
1✔
70
    }
71

72
    @Override
73
    protected NodeImpl getChildIfPermitted(Node proposedChild) {
74
        throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Comment nodes may not have children");
×
75
    }
76

77
    @Override
78
    void appendContents(StringBuilder sb) {
79
        sb.append(getData());
×
80
    }
×
81

82
}
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