JAVA-18133 fix optaplanner test
This commit is contained in:
parent
1bba7257a4
commit
583bde3f6a
|
@ -1,7 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<solver>
|
||||
<scanAnnotatedClasses/>
|
||||
|
||||
|
||||
<solutionClass>com.baeldung.drools.optaplanner.CourseSchedule</solutionClass>
|
||||
<entityClass>com.baeldung.drools.optaplanner.Lecture</entityClass>
|
||||
|
||||
<scoreDirectorFactory>
|
||||
<scoreDrl>courseSchedule.drl</scoreDrl>
|
||||
</scoreDirectorFactory>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<solver>
|
||||
<scanAnnotatedClasses/>
|
||||
|
||||
<solutionClass>com.baeldung.drools.optaplanner.CourseSchedule</solutionClass>
|
||||
<entityClass>com.baeldung.drools.optaplanner.Lecture</entityClass>
|
||||
|
||||
<scoreDirectorFactory>
|
||||
<easyScoreCalculatorClass>com.baeldung.drools.optaplanner.ScoreCalculator</easyScoreCalculatorClass>
|
||||
</scoreDirectorFactory>
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.junit.jupiter.api.BeforeAll;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.optaplanner.core.api.solver.Solver;
|
||||
import org.optaplanner.core.api.solver.SolverFactory;
|
||||
import org.optaplanner.core.config.solver.SolverConfig;
|
||||
|
||||
public class OptaPlannerUnitTest {
|
||||
|
||||
|
@ -28,8 +27,7 @@ public class OptaPlannerUnitTest {
|
|||
|
||||
@Test
|
||||
public void test_whenCustomJavaSolver() {
|
||||
SolverConfig solverConfig = SolverConfig.createFromXmlResource("courseScheduleSolverConfiguration.xml");
|
||||
SolverFactory<CourseSchedule> solverFactory = SolverFactory.create(solverConfig);
|
||||
SolverFactory<CourseSchedule> solverFactory = SolverFactory.createFromXmlResource("courseScheduleSolverConfiguration.xml");
|
||||
Solver<CourseSchedule> solver = solverFactory.buildSolver();
|
||||
CourseSchedule solvedCourseSchedule = solver.solve(unsolvedCourseSchedule);
|
||||
|
||||
|
@ -39,7 +37,6 @@ public class OptaPlannerUnitTest {
|
|||
|
||||
@Test
|
||||
public void test_whenDroolsSolver() {
|
||||
|
||||
SolverFactory<CourseSchedule> solverFactory = SolverFactory.createFromXmlResource("courseScheduleSolverConfigDrools.xml");
|
||||
Solver<CourseSchedule> solver = solverFactory.buildSolver();
|
||||
CourseSchedule solvedCourseSchedule = solver.solve(unsolvedCourseSchedule);
|
||||
|
|
8
pom.xml
8
pom.xml
|
@ -904,13 +904,13 @@
|
|||
<module>core-java-modules/core-java-networking-3</module>
|
||||
<module>core-java-modules/core-java-strings</module>
|
||||
<module>core-java-modules/core-java-httpclient</module>
|
||||
<module>custom-pmd</module>
|
||||
<module>custom-pmd</module>
|
||||
<module>spring-core-6</module>
|
||||
<module>data-structures</module>
|
||||
<module>ddd-contexts</module>
|
||||
<module>deeplearning4j</module>
|
||||
<module>docker-modules</module>
|
||||
<module>drools</module>
|
||||
<module>drools</module>
|
||||
<module>guava-modules</module>
|
||||
<module>apache-httpclient-2</module>
|
||||
<module>kubernetes-modules/kubernetes-spring</module>
|
||||
|
@ -1118,13 +1118,13 @@
|
|||
<module>core-java-modules/core-java-networking-3</module>
|
||||
<module>core-java-modules/core-java-strings</module>
|
||||
<module>core-java-modules/core-java-httpclient</module>
|
||||
<module>custom-pmd</module>
|
||||
<module>custom-pmd</module>
|
||||
<module>spring-core-6</module>
|
||||
<module>data-structures</module>
|
||||
<module>ddd-contexts</module>
|
||||
<module>deeplearning4j</module>
|
||||
<module>docker-modules</module>
|
||||
<module>drools</module>
|
||||
<module>drools</module>
|
||||
<module>guava-modules</module>
|
||||
<module>apache-httpclient-2</module>
|
||||
<module>kubernetes-modules/kubernetes-spring</module>
|
||||
|
|
Loading…
Reference in New Issue