• 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

65.0
/src/main/java/com/meterware/httpunit/dom/AbstractDomComponent.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.dom;
9

10
import com.meterware.httpunit.javascript.ScriptingEngineImpl;
11
import com.meterware.httpunit.scripting.ScriptableDelegate;
12
import com.meterware.httpunit.scripting.ScriptingEngine;
13

14
import org.mozilla.javascript.Scriptable;
15

16
/**
17
 * The Class AbstractDomComponent.
18
 */
19
public abstract class AbstractDomComponent extends ScriptingEngineImpl implements Scriptable {
1✔
20

21
    /** The Constant serialVersionUID. */
22
    private static final long serialVersionUID = 1L;
23

24
    /** The anonymous function num. */
25
    private static int _anonymousFunctionNum;
26

27
    @Override
28
    public String getClassName() {
29
        return getClass().getName();
×
30
    }
31

32
    @Override
33
    public ScriptingEngine newScriptingEngine(ScriptableDelegate child) {
34
        throw new UnsupportedOperationException();
×
35
    }
36

37
    @Override
38
    public void clearCaches() {
39
    }
×
40

41
    @Override
42
    public boolean has(String name, Scriptable start) {
43
        return super.has(name, start) || ScriptingSupport.hasNamedProperty(this, getJavaPropertyName(name), start);
1!
44
    }
45

46
    @Override
47
    public Object get(String propertyName, Scriptable scriptable) {
48
        Object result = super.get(propertyName, scriptable);
1✔
49
        if (result != NOT_FOUND) {
1!
50
            return result;
×
51
        }
52

53
        return ScriptingSupport.getNamedProperty(this, getJavaPropertyName(propertyName), scriptable);
1✔
54
    }
55

56
    /**
57
     * Gets the java property name.
58
     *
59
     * @param propertyName
60
     *            the property name
61
     *
62
     * @return the java property name
63
     */
64
    protected String getJavaPropertyName(String propertyName) {
65
        return propertyName;
×
66
    }
67

68
    @Override
69
    public void put(String propertyName, Scriptable initialObject, Object value) {
70
        super.put(propertyName, initialObject, value);
1✔
71
        ScriptingSupport.setNamedProperty(this, getJavaPropertyName(propertyName), value);
1✔
72
    }
1✔
73

74
    /**
75
     * Creates the anonymous function name.
76
     *
77
     * @return the string
78
     */
79
    protected static String createAnonymousFunctionName() {
80
        return "anon_" + ++_anonymousFunctionNum;
1✔
81
    }
82
}
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