• 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

85.71
/src/main/java/com/meterware/httpunit/FrameSelector.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;
21

22
/**
23
 * An immutable class which describes the position of a frame in the window hierarchy.
24
 **/
25
public class FrameSelector {
26

27
    /** The top frame. */
28
    public static FrameSelector TOP_FRAME = new FrameSelector(WebRequest.TOP_FRAME);
1✔
29

30
    /** The new frame. */
31
    static FrameSelector NEW_FRAME = new FrameSelector(WebRequest.TOP_FRAME);
1✔
32

33
    /** The name. */
34
    private String _name;
35

36
    /** The window. */
37
    private WebWindow _window;
38

39
    /** The parent. */
40
    private FrameSelector _parent;
41

42
    /**
43
     * Instantiates a new frame selector.
44
     */
45
    FrameSelector() {
1✔
46
        _name = super.toString();
1✔
47
    }
1✔
48

49
    /**
50
     * Instantiates a new frame selector.
51
     *
52
     * @param name
53
     *            the name
54
     */
55
    FrameSelector(String name) {
1✔
56
        _name = name;
1✔
57
    }
1✔
58

59
    /**
60
     * Instantiates a new frame selector.
61
     *
62
     * @param name
63
     *            the name
64
     * @param parent
65
     *            the parent
66
     */
67
    FrameSelector(String name, FrameSelector parent) {
1✔
68
        _name = name;
1✔
69
        _parent = parent;
1✔
70
    }
1✔
71

72
    /**
73
     * Gets the name.
74
     *
75
     * @return the name
76
     */
77
    String getName() {
78
        return _name;
1✔
79
    }
80

81
    /**
82
     * Gets the parent.
83
     *
84
     * @return the parent
85
     */
86
    FrameSelector getParent() {
87
        return _parent;
1✔
88
    }
89

90
    @Override
91
    public String toString() {
92
        return "Frame Selector: [ " + getFullName() + " ]";
×
93
    }
94

95
    /**
96
     * Gets the full name.
97
     *
98
     * @return the full name
99
     */
100
    private String getFullName() {
101
        return _name + (_parent == null ? "" : " in " + _parent.getFullName());
×
102
    }
103

104
    /**
105
     * Gets the window.
106
     *
107
     * @return the window
108
     */
109
    WebWindow getWindow() {
110
        return _window != null ? _window : _parent == null ? null : _parent.getWindow();
1✔
111
    }
112

113
    /**
114
     * New top frame.
115
     *
116
     * @param window
117
     *            the window
118
     *
119
     * @return the frame selector
120
     */
121
    static FrameSelector newTopFrame(WebWindow window) {
122
        return new FrameSelector(WebRequest.TOP_FRAME, window);
1✔
123
    }
124

125
    /**
126
     * Instantiates a new frame selector.
127
     *
128
     * @param name
129
     *            the name
130
     * @param window
131
     *            the window
132
     */
133
    private FrameSelector(String name, WebWindow window) {
1✔
134
        _name = name;
1✔
135
        _window = window;
1✔
136
    }
1✔
137

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