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

leeonky / test-charm-java / 111

07 Feb 2025 04:38PM UTC coverage: 73.358% (-0.3%) from 73.633%
111

push

circleci

leeonky
First inspector example

0 of 59 new or added lines in 5 files covered. (0.0%)

1 existing line in 1 file now uncovered.

7663 of 10446 relevant lines covered (73.36%)

0.73 hits per line

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

0.0
/DAL-extension-inspector/src/main/java/com/github/leeonky/dal/extensions/inspector/Inspector.java
1
package com.github.leeonky.dal.extensions.inspector;
2

3
import com.github.leeonky.dal.DAL;
4

NEW
5
public class Inspector {
×
NEW
6
    private static final Inspector instance = new Inspector();
×
7
    private HttpServer server;
8
    private Mode defaultMode;
9
    private InspectorContext inspectorContext;
10

11
    public static Inspector inspector() {
NEW
12
        return instance;
×
13
    }
14

15
    public void setDefaultMode(Mode mode) {
NEW
16
        defaultMode = mode;
×
NEW
17
    }
×
18

19
    public void launch() {
NEW
20
        synchronized (Inspector.class) {
×
NEW
21
            if (server == null) {
×
NEW
22
                inspectorContext = new InspectorContext();
×
NEW
23
                server = new HttpServer(inspectorContext.apiProvider()).start();
×
24
            }
NEW
25
        }
×
NEW
26
    }
×
27

28
    public Inspector exit() {
NEW
29
        synchronized (Inspector.class) {
×
NEW
30
            if (server != null) {
×
NEW
31
                server.stop();
×
NEW
32
                server = null;
×
33
            }
NEW
34
        }
×
NEW
35
        return this;
×
36
    }
37

38
    public void inspect(DAL dal, Object input, String code) {
NEW
39
        if (isRecursive())
×
NEW
40
            return;
×
NEW
41
        inspectorContext.inspect(dal, input, code);
×
NEW
42
    }
×
43

44
    private boolean isRecursive() {
NEW
45
        for (StackTraceElement stack : Thread.currentThread().getStackTrace())
×
NEW
46
            if (InspectorContext.ApiProvider.class.getName().equals(stack.getClassName()))
×
NEW
47
                return true;
×
NEW
48
        return false;
×
49
    }
50

NEW
51
    public enum Mode {
×
NEW
52
        DAL_INSPECTOR_ASSERT_DISABLED, DAL_INSPECTOR_AUTO, DAL_INSPECTOR_FORCED
×
53
    }
54
}
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