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

aspectran / aspectran / #4732
44%

Build:
DEFAULT BRANCH: master
Ran 30 Oct 2025 02:32PM UTC
Jobs 1
Files 1016
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Oct 2025 02:29PM UTC coverage: 37.85% (+0.2%) from 37.648%
#4732

push

github

topframe
Refactor AsEL evaluation, fix runtime bug, and enhance tests

This commit introduces a major refactoring to the AsEL evaluation mechanism to fix a critical bug, improve the overall design, and enhance test coverage.

The core issue was that tokens parsed at runtime (e.g., via `TokenParser.parse()`) could not be evaluated if they used directives like `#{field:...}`. This was because the token's `valueProvider` was only resolved during the initial configuration parsing phase.

Key changes:

- **Fix Runtime Token Evaluation:**
  The `TokenEvaluation.getBean()` method is now self-sufficient. It detects when a token's `valueProvider` is unresolved and resolves it on-the-fly using the current activity's class loader. This ensures that dynamically parsed tokens have the same capabilities as statically parsed ones.

- **Implement Strategy Pattern:**
  A `ValueProvider` interface and strategy classes (`FieldValueProvider`, etc.) have been introduced in a new `asel.bean` package. This encapsulates evaluation logic for different bean directive types, removing a large `if/else` block from `TokenEvaluation` and making the design cleaner and more extensible.

- **Centralize and Clean Up Logic:**
  - The `valueProvider` field in `Token` is now strongly-typed.
  - Duplicated logic in `RuleParsingContext` was removed by delegating to the central `Token.resolveValueProvider()` method.
  - Manual `valueProvider` resolution in `AbstractShellService` is no longer needed, which also fixes a class loader inconsistency issue.
  - `BeanReferenceInspector` was updated to work with the new `ValueProvider` strategies.

- **Enhance Test Coverage:**
  `TokenEvaluationTest` was significantly improved with new tests for bean (`#id`, `#class:`, `#field:`), property (`%`), and enum token evaluation, ensuring the new logic is correctly verified.

40 of 84 new or added lines in 8 files covered. (47.62%)

169 existing lines in 10 files now uncovered.

15677 of 41419 relevant lines covered (37.85%)

0.38 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
71.23
5.94% core/src/main/java/com/aspectran/core/context/asel/token/Token.java
2
67.97
10.37% core/src/main/java/com/aspectran/core/context/asel/token/TokenEvaluation.java
2
80.76
4.34% core/src/main/java/com/aspectran/core/context/rule/parsing/RuleParsingContext.java
5
50.0
core/src/main/java/com/aspectran/core/context/asel/bean/FieldValueProvider.java
7
66.67
core/src/main/java/com/aspectran/core/context/asel/bean/ClassValueProvider.java
8
0.0
0.0% shell/src/main/java/com/aspectran/shell/service/AbstractShellService.java
9
70.55
-1.19% core/src/main/java/com/aspectran/core/context/rule/validation/BeanReferenceInspector.java
10
0.0
core/src/main/java/com/aspectran/core/context/asel/bean/MethodValueProvider.java

Uncovered Existing Lines

Lines Coverage ∆ File
1
0.0
0.0% shell/src/main/java/com/aspectran/shell/service/AbstractShellService.java
3
0.0
0.0% core/src/main/java/com/aspectran/core/context/asel/token/TokenEvaluationException.java
4
0.0
0.0% core/src/main/java/com/aspectran/core/context/asel/item/ItemEvaluationException.java
4
0.0
0.0% core/src/main/java/com/aspectran/core/context/asel/token/TokenEvaluator.java
6
0.0
0.0% core/src/main/java/com/aspectran/core/context/asel/token/InvalidTokenException.java
18
87.3
0.0% core/src/main/java/com/aspectran/core/context/asel/token/Tokenizer.java
23
35.71
0.0% core/src/main/java/com/aspectran/core/context/asel/token/TokenParser.java
26
67.97
10.37% core/src/main/java/com/aspectran/core/context/asel/token/TokenEvaluation.java
27
71.23
5.94% core/src/main/java/com/aspectran/core/context/asel/token/Token.java
57
46.83
2.95% core/src/main/java/com/aspectran/core/context/asel/item/ItemEvaluation.java
Jobs
ID Job ID Ran Files Coverage
1 #4732.1 30 Oct 2025 02:32PM UTC 1016
37.85
Source Files on build #4732
  • Tree
  • List 1016
  • Changed 20
  • Source Changed 14
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • e4f31408 on github
  • Prev Build on master
  • Next Build on master
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