timefold-solver
timefold-solver copied to clipboard
Feat: Testing support for DSV
Design and implement APIs for filling in values of shadow variables. Testing those values can be left to user tools, such as AssertJ; we should not implement our own assertions.
Arguably, we do not need fancy tooling. SolutionManager can already fill in shadow variables, when provided with a solution. We need to enable this on an entity level, and we need to expose a simple method to run it. Could be as easy as a single static method:
SolutionManager.updateShadowVariables(solutionClass, entityClass, entities...)
However, while we're doing this, we may simplify the solution path as well. No need to create an entire solution manager during testing, if there can be a simple static method to do the update. Therefore, there are two use cases to implement:
- Updating shadow variables on individual entities; needs to fail fast if there are shadow variables which require variable listeners. (Because listeners require solutions.)
- Updating shadow variables on entire solutions.
Both need to make sure it updates not only DSV, but also the embedded shadows.