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

hazendaz / httpunit / 636

05 Dec 2025 03:27AM UTC coverage: 80.509%. Remained the same
636

push

github

hazendaz
Cleanup more old since tags

you guessed it, at this point going to jautodoc the rest so the warnings on builds go away ;)

3213 of 4105 branches covered (78.27%)

Branch coverage included in aggregate %.

8249 of 10132 relevant lines covered (81.42%)

0.81 hits per line

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

92.31
/src/main/java/com/meterware/httpunit/HeaderOnlyWebRequest.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
import com.meterware.httpunit.protocol.URLEncodedString;
23

24
import java.io.IOException;
25
import java.net.URL;
26

27
import org.w3c.dom.Element;
28

29
/**
30
 * A web request which has no information in its message body.
31
 **/
32
public class HeaderOnlyWebRequest extends WebRequest {
33

34
    /**
35
     * Returns the query string defined for this request.
36
     **/
37
    @Override
38
    public String getQueryString() {
39
        try {
40
            URLEncodedString encoder = new URLEncodedString();
1✔
41
            getParameterHolder().recordPredefinedParameters(encoder);
1✔
42
            getParameterHolder().recordParameters(encoder);
1✔
43
            return encoder.getString();
1✔
44
        } catch (IOException e) {
×
45
            throw new RuntimeException("Programming error: " + e); // should never happen
×
46
        }
47
    }
48

49
    /**
50
     * @param method
51
     *            the method to set
52
     */
53
    public void setMethod(String method) {
54
        this.method = method;
1✔
55
    }
1✔
56

57
    // -------------------------------- protected members ---------------------------
58

59
    protected HeaderOnlyWebRequest(URL urlBase, String urlString, FrameSelector frame, String target) {
60
        super(urlBase, urlString, frame, target);
1✔
61
    }
1✔
62

63
    protected HeaderOnlyWebRequest(URL urlBase, String urlString, String target) {
64
        super(urlBase, urlString, target);
1✔
65
    }
1✔
66

67
    protected HeaderOnlyWebRequest(WebResponse referer, Element sourceElement, URL urlBase, String urlString,
68
            String target) {
69
        super(referer, sourceElement, urlBase, urlString, target);
1✔
70
    }
1✔
71

72
    protected HeaderOnlyWebRequest(URL urlBase, String urlString) {
73
        super(urlBase, urlString);
1✔
74
    }
1✔
75

76
    protected HeaderOnlyWebRequest(String urlString) {
77
        super(urlString);
1✔
78
    }
1✔
79

80
    // ------------------------------------ package members --------------------------
81

82
    HeaderOnlyWebRequest(WebRequestSource requestSource) {
83
        super(requestSource, WebRequest.newParameterHolder(requestSource));
1✔
84
        setHeaderField(REFERER_HEADER_NAME, requestSource.getBaseURL().toExternalForm());
1✔
85
    }
1✔
86

87
    HeaderOnlyWebRequest(WebForm sourceForm, ParameterHolder parameterHolder, SubmitButton button, int x, int y) {
88
        super(sourceForm, parameterHolder, button, x, y);
1✔
89
        setHeaderField(REFERER_HEADER_NAME, sourceForm.getBaseURL().toExternalForm());
1✔
90
    }
1✔
91

92
    HeaderOnlyWebRequest(URL urlBase, String urlString, FrameSelector frame) {
93
        super(urlBase, urlString, frame, frame.getName());
1✔
94
    }
1✔
95

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