-
Enhancement
-
Resolution: Done
-
Minor
-
None
-
None
-
2022 Week 29-31 (from Jul 18)
-
2
-
NEW
-
NEW
To reproduce:
- Take optaplanner-quickstarts hello-world
- exclude non-bavet stuff:
<dependency> <groupId>org.optaplanner</groupId> <artifactId>optaplanner-core</artifactId> <exclusions> <exclusion> <groupId>org.optaplanner</groupId> <artifactId>optaplanner-constraint-drl</artifactId> </exclusion> <exclusion> <groupId>org.optaplanner</groupId> <artifactId>optaplanner-constraint-streams-drools</artifactId> </exclusion> </exclusions> </dependency>
- Adjust TimeTableApp to use Bavet.
- Run "mvn clean install". You get this error message:
[ERROR] org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest.teacherTimeEfficiency Time elapsed: 0.003 s <<< ERROR! java.lang.IllegalStateException: Constraint Streams implementation was not found on the classpath. Maybe include org.optaplanner:optaplanner-constraint-streams-drools dependency in your project? Maybe ensure your uberjar bundles META-INF/services from included JAR files? at org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest.teacherTimeEfficiency(TimeTableConstraintProviderTest.java:75)
What's wrong? You forgot to switch the tests to bavet too! Very easy to do, but the error message puts you on the wrong path.
Proposal A)
Add an extra Maybe line:
"Maybe you want to use Bavet instead of Drools: in your tests, call ConstraintVerifier.build(...).withConstraintStreamImplType(BAVET).\n"