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

leeonky / test-charm-java / 252

02 Aug 2025 11:17AM UTC coverage: 74.246% (-0.01%) from 74.26%
252

push

circleci

leeonky
Update exception output

4 of 6 new or added lines in 3 files covered. (66.67%)

8075 of 10876 relevant lines covered (74.25%)

0.74 hits per line

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

95.65
/DAL-java/src/main/java/com/github/leeonky/dal/Accessors.java
1
package com.github.leeonky.dal;
2

3
import com.github.leeonky.interpreter.InterpreterException;
4

5
import java.util.function.Supplier;
6

7
public class Accessors {
8
    private final String expression;
9
    private static boolean dumpInput = true;
1✔
10
    private DAL dal;
11
    private static Supplier<DAL> dalFactory = () -> DAL.dal("AssertD");
1✔
12

13
    public static void setDALFactory(Supplier<DAL> dalFactory) {
14
        Accessors.dalFactory = dalFactory;
1✔
15
    }
1✔
16

17
    public static void dumpInput(boolean enable) {
18
        dumpInput = enable;
1✔
19
    }
1✔
20

21
    public Accessors by(DAL dal) {
22
        this.dal = dal;
1✔
23
        return this;
1✔
24
    }
25

26
    public Accessors(String expression) {
1✔
27
        this.expression = expression;
1✔
28
    }
1✔
29

30
    public static Accessors get(String expression) {
31
        return new Accessors(expression);
1✔
32
    }
33

34
    public <T> T from(Object input) {
35
        try {
36
            return getDAL().evaluate(input, expression);
1✔
37
        } catch (InterpreterException e) {
1✔
38
            String detailMessage = "\n" + e.show(expression, 0) + "\n\n" + e.getMessage();
1✔
39
            if (dumpInput)
1✔
40
                detailMessage += "\n\nThe root value was: "
1✔
41
                        + getDAL().getRuntimeContextBuilder().build(input).getThis().dump();
1✔
42
            throw new RuntimeException(detailMessage, e) {
1✔
43

44
                @Override
45
                public String toString() {
NEW
46
                    return RuntimeException.class.getName() + ":\n" + getMessage();
×
47
                }
48
            };
49
        }
50
    }
51

52
    private DAL getDAL() {
53
        if (dal == null)
1✔
54
            dal = dalFactory.get();
1✔
55
        return dal;
1✔
56
    }
57
}
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