JAVA-18133 fix optaplanner test
This commit is contained in:
parent
1bba7257a4
commit
583bde3f6a
|
@ -1,6 +1,8 @@
|
|||
<?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>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?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>
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue