• 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

25.0
/src/main/java/com/meterware/httpunit/ParameterHolder.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.protocol.ParameterCollection;
11
import com.meterware.httpunit.protocol.ParameterProcessor;
12
import com.meterware.httpunit.protocol.UploadFileSpec;
13

14
import java.io.IOException;
15
import java.nio.charset.StandardCharsets;
16

17
/**
18
 * This abstract class is extended by classes which hold parameters for web requests. Note that it is an abstract class
19
 * rather than an interface in order to keep its methods package-local.
20
 **/
21
abstract class ParameterHolder implements ParameterCollection {
1✔
22

23
    /**
24
     * Specifies the position at which an image button (if any) was clicked. This default implementation does nothing.
25
     *
26
     * @param imageButton
27
     *            the image button
28
     * @param x
29
     *            the x
30
     * @param y
31
     *            the y
32
     */
33
    void selectImageButtonPosition(SubmitButton imageButton, int x, int y) {
34
    }
×
35

36
    /**
37
     * Iterates through the fixed, predefined parameters in this holder, recording them in the supplied parameter
38
     * processor.\ These parameters always go on the URL, no matter what encoding method is used.
39
     *
40
     * @param processor
41
     *            the processor
42
     *
43
     * @throws IOException
44
     *             Signals that an I/O exception has occurred.
45
     */
46
    abstract void recordPredefinedParameters(ParameterProcessor processor) throws IOException;
47

48
    /**
49
     * Returns an array of all parameter names in this collection.
50
     *
51
     * @return the parameter names
52
     */
53
    abstract String[] getParameterNames();
54

55
    /**
56
     * Returns the multiple default values of the named parameter.
57
     *
58
     * @param name
59
     *            the name
60
     *
61
     * @return the parameter values
62
     */
63
    abstract String[] getParameterValues(String name);
64

65
    /**
66
     * Removes a parameter name from this collection.
67
     *
68
     * @param name
69
     *            the name
70
     */
71
    abstract void removeParameter(String name);
72

73
    /**
74
     * Sets the value of a parameter in a web request.
75
     *
76
     * @param name
77
     *            the name
78
     * @param value
79
     *            the value
80
     */
81
    abstract void setParameter(String name, String value);
82

83
    /**
84
     * Sets the multiple values of a parameter in a web request.
85
     *
86
     * @param name
87
     *            the name
88
     * @param values
89
     *            the values
90
     */
91
    abstract void setParameter(String name, String[] values);
92

93
    /**
94
     * Sets the multiple values of a file upload parameter in a web request.
95
     *
96
     * @param name
97
     *            the name
98
     * @param files
99
     *            the files
100
     */
101
    abstract void setParameter(String name, UploadFileSpec[] files);
102

103
    /**
104
     * Returns true if the specified name is that of a file parameter. The default implementation returns false.
105
     *
106
     * @param name
107
     *            the name
108
     *
109
     * @return true, if is file parameter
110
     */
111
    boolean isFileParameter(String name) {
112
        return false;
×
113
    }
114

115
    /**
116
     * Returns the character set encoding for the request.
117
     *
118
     * @return the character set
119
     */
120
    String getCharacterSet() {
121
        return StandardCharsets.ISO_8859_1.name();
×
122
    }
123

124
    /**
125
     * Checks if is submit as mime.
126
     *
127
     * @return true, if is submit as mime
128
     */
129
    abstract boolean isSubmitAsMime();
130
}
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