-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...imefold/solver/benchmark/quarkus/TimefoldBenchmarkProcessorBenchmarkCustomConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package ai.timefold.solver.benchmark.quarkus; | ||
|
||
import java.util.concurrent.ExecutionException; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.IntStream; | ||
|
||
import jakarta.inject.Inject; | ||
|
||
import ai.timefold.solver.benchmark.api.PlannerBenchmarkFactory; | ||
import ai.timefold.solver.benchmark.quarkus.testdata.normal.constraints.TestdataQuarkusConstraintProvider; | ||
import ai.timefold.solver.benchmark.quarkus.testdata.normal.domain.TestdataQuarkusEntity; | ||
import ai.timefold.solver.benchmark.quarkus.testdata.normal.domain.TestdataQuarkusSolution; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
class TimefoldBenchmarkProcessorBenchmarkCustomConfigTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.overrideConfigKey("quarkus.timefold.benchmark.solver.termination.best-score-limit", "0") | ||
.overrideConfigKey("quarkus.timefold.benchmark.solver-benchmark-config-xml", "customSolverBenchmarkConfig.xml") | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addAsResource("customSolverBenchmarkConfig.xml") | ||
.addClasses(TestdataQuarkusEntity.class, | ||
TestdataQuarkusSolution.class, TestdataQuarkusConstraintProvider.class)); | ||
|
||
@Inject | ||
PlannerBenchmarkFactory benchmarkFactory; | ||
|
||
@Test | ||
void benchmark() throws ExecutionException, InterruptedException { | ||
TestdataQuarkusSolution problem = new TestdataQuarkusSolution(); | ||
problem.setValueList(IntStream.range(1, 3) | ||
.mapToObj(i -> "v" + i) | ||
.collect(Collectors.toList())); | ||
problem.setEntityList(IntStream.range(1, 3) | ||
.mapToObj(i -> new TestdataQuarkusEntity()) | ||
.collect(Collectors.toList())); | ||
benchmarkFactory.buildPlannerBenchmark(problem).benchmark(); | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...tegration/quarkus-benchmark/deployment/src/test/resources/customSolverBenchmarkConfig.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plannerBenchmark xmlns="https://timefold.ai/xsd/benchmark" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://timefold.ai/xsd/benchmark https://timefold.ai/xsd/benchmark/benchmark.xsd"> | ||
|
||
<solverBenchmarkBluePrint> | ||
<solverBenchmarkBluePrintType>EVERY_LOCAL_SEARCH_TYPE</solverBenchmarkBluePrintType> | ||
</solverBenchmarkBluePrint> | ||
</plannerBenchmark> |