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

leeonky / test-charm-java / 156

20 Mar 2025 01:53PM UTC coverage: 74.243% (-0.2%) from 74.475%
156

push

circleci

leeonky
Refactor

14 of 15 new or added lines in 12 files covered. (93.33%)

126 existing lines in 29 files now uncovered.

7947 of 10704 relevant lines covered (74.24%)

0.74 hits per line

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

81.82
/DAL-java/src/main/java/com/github/leeonky/dal/ast/node/DALNode.java
1
package com.github.leeonky.dal.ast.node;
2

3
import com.github.leeonky.dal.ast.node.table.RowHeader;
4
import com.github.leeonky.dal.ast.node.table.RowType;
5
import com.github.leeonky.dal.ast.opt.DALOperator;
6
import com.github.leeonky.dal.runtime.Data;
7
import com.github.leeonky.dal.runtime.ExpectationFactory;
8
import com.github.leeonky.dal.runtime.RuntimeContextBuilder.DALRuntimeContext;
9
import com.github.leeonky.dal.runtime.checker.Checker;
10
import com.github.leeonky.dal.runtime.checker.CheckingContext;
11
import com.github.leeonky.interpreter.NodeBase;
12

13
import java.util.List;
14
import java.util.stream.Stream;
15

16
import static com.github.leeonky.dal.runtime.ExpressionException.opt1;
17
import static com.github.leeonky.dal.runtime.ExpressionException.opt2;
18

19
public abstract class DALNode extends NodeBase<DALRuntimeContext, DALNode> {
1✔
20

21
    public Data evaluateData(DALRuntimeContext context) {
22
        return context.wrap(() -> evaluate(context));
1✔
23
    }
24

25
    @Override
26
    public Object evaluate(DALRuntimeContext context) {
27
        return evaluateData(context).instance();
1✔
28
    }
29

30
    public abstract String inspect();
31

32
    public Object getRootSymbolName() {
33
        return null;
1✔
34
    }
35

36
    public List<Object> propertyChain() {
37
        throw new IllegalStateException();
×
38
    }
39

40
    public Stream<Object> collectFields(Data data) {
41
        return Stream.of(data.firstFieldFromAlias(getRootSymbolName()));
1✔
42
    }
43

44
    public Data verify(DALOperator operator, DALNode actual, DALRuntimeContext context) {
45
        return context.calculate(actual.evaluateData(context), operator, context.data(toVerify(context)));
1✔
46
    }
47

48
    protected ExpectationFactory toVerify(DALRuntimeContext context) {
49
        Data expected = evaluateData(context);
1✔
50
        return (operator, actual) -> new ExpectationFactory.Expectation() {
1✔
51
            @Override
52
            public Data matches() {
53
                Checker checker = context.fetchMatchingChecker(expected, actual);
1✔
54
                return checker.verify(new CheckingContext(expected, actual,
1✔
55
                        opt2(() -> checker.transformExpected(expected, context)),
1✔
56
                        opt1(() -> checker.transformActualAndCheck(actual, expected, context))));
1✔
57
            }
58

59
            @Override
60
            public Data equalTo() {
61
                Checker checker = context.fetchEqualsChecker(expected, actual);
1✔
62
                return checker.verify(new CheckingContext(expected, actual,
1✔
63
                        opt2(() -> checker.transformExpected(expected, context)),
1✔
64
                        opt1(() -> checker.transformActualAndCheck(actual, expected, context))));
1✔
65
            }
66

67
            @Override
68
            public ExpectationFactory.Type type() {
69
                return ExpectationFactory.Type.VALUE;
×
70
            }
71
        };
72
    }
73

74
    public RowType guessTableHeaderType() {
75
        return RowHeader.DEFAULT_INDEX;
×
76
    }
77

78
    public boolean needPrefixBlankWarningCheck() {
79
        return false;
1✔
80
    }
81

82
    public boolean needPostBlankWarningCheck() {
83
        return false;
1✔
84
    }
85

86
    @Override
87
    public String toString() {
UNCOV
88
        return inspect();
×
89
    }
90
}
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