• 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

0.0
/src/main/java/com/meterware/httpunit/WebList.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;
9

10
import com.meterware.httpunit.scripting.ScriptableDelegate;
11

12
import java.net.URL;
13
import java.util.ArrayList;
14

15
import org.w3c.dom.Element;
16

17
/**
18
 * Represents an HTML list. Experimental.
19
 **/
20
public class WebList extends HTMLElementBase {
21

22
    /** Indicator of an ordered list (HTML tag <ol>). */
23
    public static final int ORDERED_LIST = 1;
24

25
    /** Indicator of a bullet list (HTML tag <ul>). */
26
    public static final int BULLET_LIST = 2;
27

28
    /** The response. */
29
    private WebResponse _response;
30

31
    /** The frame. */
32
    private FrameSelector _frame;
33

34
    /** The base URL. */
35
    private URL _baseURL;
36

37
    /** The base target. */
38
    private String _baseTarget;
39

40
    /** The character set. */
41
    private String _characterSet;
42

43
    /** The items. */
44
    private ArrayList _items = new ArrayList<>();
×
45

46
    /** The list type. */
47
    private int _listType;
48

49
    /**
50
     * Instantiates a new web list.
51
     *
52
     * @param response
53
     *            the response
54
     * @param frame
55
     *            the frame
56
     * @param baseURL
57
     *            the base URL
58
     * @param baseTarget
59
     *            the base target
60
     * @param element
61
     *            the element
62
     * @param characterSet
63
     *            the character set
64
     */
65
    public WebList(WebResponse response, FrameSelector frame, URL baseURL, String baseTarget, Element element,
66
            String characterSet) {
67
        super(element);
×
68
        if (element.getNodeName().equalsIgnoreCase("ol")) {
×
69
            _listType = ORDERED_LIST;
×
70
        } else if (element.getNodeName().equalsIgnoreCase("ul")) {
×
71
            _listType = BULLET_LIST;
×
72
        }
73
        _response = response;
×
74
        _frame = frame;
×
75
        _baseURL = baseURL;
×
76
        _baseTarget = baseTarget;
×
77
        _characterSet = characterSet;
×
78
    }
×
79

80
    /**
81
     * Gets the list type.
82
     *
83
     * @return the list type
84
     */
85
    public int getListType() {
86
        return _listType;
×
87
    }
88

89
    /**
90
     * Gets the items.
91
     *
92
     * @return the items
93
     */
94
    public TextBlock[] getItems() {
95
        return (TextBlock[]) _items.toArray(new TextBlock[_items.size()]);
×
96
    }
97

98
    @Override
99
    public ScriptableDelegate newScriptable() {
100
        return new HTMLElementScriptable(this);
×
101
    }
102

103
    @Override
104
    public ScriptableDelegate getParentDelegate() {
105
        return _response.getDocumentScriptable();
×
106
    }
107

108
    /**
109
     * Adds the new item.
110
     *
111
     * @param element
112
     *            the element
113
     *
114
     * @return the text block
115
     */
116
    TextBlock addNewItem(Element element) {
117
        TextBlock listItem = new TextBlock(_response, _frame, _baseURL, _baseTarget, element, _characterSet);
×
118
        _items.add(listItem);
×
119
        return listItem;
×
120
    }
121
}
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