• 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

88.89
/src/main/java/com/meterware/servletunit/ServletUnitServletConfig.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.servletunit;
9

10
import jakarta.servlet.ServletConfig;
11
import jakarta.servlet.ServletContext;
12

13
import java.util.Enumeration;
14
import java.util.Hashtable;
15

16
/**
17
 * This class acts as a test environment for servlets.
18
 **/
19
class ServletUnitServletConfig implements ServletConfig {
20

21
    /**
22
     * Instantiates a new servlet unit servlet config.
23
     *
24
     * @param name
25
     *            the name
26
     * @param application
27
     *            the application
28
     * @param initParams
29
     *            the init params
30
     */
31
    ServletUnitServletConfig(String name, WebApplication application, Hashtable initParams) {
1✔
32
        _name = name;
1✔
33
        _initParameters = initParams;
1✔
34
        _context = application.getServletContext();
1✔
35
    }
1✔
36

37
    // -------------------------------------------- ServletConfig methods
38
    // ---------------------------------------------------
39

40
    /**
41
     * Returns the value of the specified init parameter, or null if no such init parameter is defined.
42
     **/
43
    @Override
44
    public String getInitParameter(String name) {
45
        return (String) _initParameters.get(name);
1✔
46
    }
47

48
    /**
49
     * Returns an enumeration over the names of the init parameters.
50
     **/
51
    @Override
52
    public Enumeration getInitParameterNames() {
53
        return _initParameters.keys();
×
54
    }
55

56
    /**
57
     * Returns the current servlet context.
58
     **/
59
    @Override
60
    public ServletContext getServletContext() {
61
        return _context;
1✔
62
    }
63

64
    /**
65
     * Returns the registered name of the servlet, or its class name if it is not registered.
66
     **/
67
    @Override
68
    public java.lang.String getServletName() {
69
        return _name;
1✔
70
    }
71

72
    // ----------------------------------------------- private members
73
    // ------------------------------------------------------
74

75
    /** The name. */
76
    private String _name;
77

78
    /** The init parameters. */
79
    private final Hashtable _initParameters;
80

81
    /** The context. */
82
    private final ServletContext _context;
83

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