From 1169bb65e1dafc99ab9698d2aac98322102e588e Mon Sep 17 00:00:00 2001 From: Timefold Release Bot Date: Mon, 14 Aug 2023 14:39:49 +0000 Subject: [PATCH] chore: release version 1.1.0 --- .github/dependabot.yml | 2 +- .github/workflows/release.yml | 5 +- .gitignore | 9 +- README.adoc | 2 - build/quickstarts-showcase/.gitignore | 13 -- build/quickstarts-showcase/pom.xml | 2 +- hello-world/.gitignore | 12 - hello-world/build.gradle | 2 +- hello-world/pom.xml | 10 +- pom.xml | 3 +- technology/java-activemq-quarkus/.gitignore | 12 - technology/java-activemq-quarkus/README.adoc | 142 ------------ .../java-activemq-quarkus/broker-00.xml | 23 -- .../java-activemq-quarkus/client/.gitignore | 12 - .../java-activemq-quarkus/client/pom.xml | 112 ---------- .../bootstrap/DemoDataGenerator.java | 205 ------------------ .../persistence/TimeTableRepository.java | 21 -- .../rest/TimeTableResource.java | 78 ------- .../main/resources/META-INF/resources/app.js | 189 ---------------- .../resources/META-INF/resources/index.html | 75 ------- .../src/main/resources/application.properties | 29 --- .../ActiveMQTestResourceLifecycleManager.java | 27 --- .../TimeTableResourceTest.java | 105 --------- .../java-activemq-quarkus/common/.gitignore | 12 - .../java-activemq-quarkus/common/pom.xml | 46 ---- .../acme/schooltimetabling/domain/Lesson.java | 80 ------- .../acme/schooltimetabling/domain/Room.java | 38 ---- .../schooltimetabling/domain/TimeTable.java | 69 ------ .../schooltimetabling/domain/Timeslot.java | 57 ----- .../message/SolverRequest.java | 28 --- .../message/SolverResponse.java | 80 ------- .../java-activemq-quarkus/docker-compose.yml | 18 -- technology/java-activemq-quarkus/pom.xml | 177 --------------- technology/java-activemq-quarkus/run.sh | 85 -------- .../java-activemq-quarkus/solver/.gitignore | 12 - .../java-activemq-quarkus/solver/pom.xml | 95 -------- .../messaging/TimeTableMessagingHandler.java | 95 -------- .../solver/TimeTableConstraintProvider.java | 104 --------- .../src/main/resources/application.properties | 45 ---- .../ActiveMQEmbeddedBroker.java | 52 ----- .../TimeTableMessagingHandlerIT.java | 10 - .../TimeTableMessagingHandlerTest.java | 144 ------------ .../TimeTableConstraintProviderTest.java | 100 --------- .../src/test/resources/application.properties | 21 -- .../solver/src/test/resources/broker.xml | 116 ---------- technology/java-spring-boot/.gitignore | 12 - technology/java-spring-boot/build.gradle | 2 +- technology/java-spring-boot/pom.xml | 8 +- technology/kotlin-quarkus/.gitignore | 12 - technology/kotlin-quarkus/pom.xml | 8 +- use-cases/call-center/.gitignore | 12 - use-cases/call-center/pom.xml | 6 +- use-cases/employee-scheduling/.gitignore | 12 - use-cases/employee-scheduling/pom.xml | 6 +- use-cases/facility-location/.gitignore | 12 - use-cases/facility-location/pom.xml | 6 +- use-cases/food-packaging/.gitignore | 12 - use-cases/food-packaging/pom.xml | 6 +- use-cases/maintenance-scheduling/.gitignore | 12 - use-cases/maintenance-scheduling/pom.xml | 6 +- use-cases/order-picking/.gitignore | 12 - use-cases/order-picking/pom.xml | 6 +- use-cases/school-timetabling/.gitignore | 12 - use-cases/school-timetabling/build.gradle | 2 +- use-cases/school-timetabling/pom.xml | 6 +- use-cases/vaccination-scheduling/.gitignore | 12 - use-cases/vaccination-scheduling/pom.xml | 8 +- use-cases/vehicle-routing-capacity/.gitignore | 12 - use-cases/vehicle-routing-capacity/pom.xml | 6 +- .../vehicle-routing-time-windows/.gitignore | 12 - .../vehicle-routing-time-windows/pom.xml | 6 +- 71 files changed, 58 insertions(+), 2742 deletions(-) delete mode 100644 build/quickstarts-showcase/.gitignore delete mode 100644 hello-world/.gitignore delete mode 100644 technology/java-activemq-quarkus/.gitignore delete mode 100644 technology/java-activemq-quarkus/README.adoc delete mode 100644 technology/java-activemq-quarkus/broker-00.xml delete mode 100644 technology/java-activemq-quarkus/client/.gitignore delete mode 100644 technology/java-activemq-quarkus/client/pom.xml delete mode 100644 technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/bootstrap/DemoDataGenerator.java delete mode 100644 technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java delete mode 100644 technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/rest/TimeTableResource.java delete mode 100644 technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/app.js delete mode 100644 technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/index.html delete mode 100644 technology/java-activemq-quarkus/client/src/main/resources/application.properties delete mode 100644 technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/ActiveMQTestResourceLifecycleManager.java delete mode 100644 technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/TimeTableResourceTest.java delete mode 100644 technology/java-activemq-quarkus/common/.gitignore delete mode 100644 technology/java-activemq-quarkus/common/pom.xml delete mode 100644 technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Lesson.java delete mode 100644 technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Room.java delete mode 100644 technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java delete mode 100644 technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java delete mode 100644 technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverRequest.java delete mode 100644 technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverResponse.java delete mode 100644 technology/java-activemq-quarkus/docker-compose.yml delete mode 100644 technology/java-activemq-quarkus/pom.xml delete mode 100755 technology/java-activemq-quarkus/run.sh delete mode 100644 technology/java-activemq-quarkus/solver/.gitignore delete mode 100644 technology/java-activemq-quarkus/solver/pom.xml delete mode 100644 technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/messaging/TimeTableMessagingHandler.java delete mode 100644 technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java delete mode 100644 technology/java-activemq-quarkus/solver/src/main/resources/application.properties delete mode 100644 technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/ActiveMQEmbeddedBroker.java delete mode 100644 technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerIT.java delete mode 100644 technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerTest.java delete mode 100644 technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java delete mode 100644 technology/java-activemq-quarkus/solver/src/test/resources/application.properties delete mode 100644 technology/java-activemq-quarkus/solver/src/test/resources/broker.xml delete mode 100644 technology/java-spring-boot/.gitignore delete mode 100644 technology/kotlin-quarkus/.gitignore delete mode 100644 use-cases/call-center/.gitignore delete mode 100644 use-cases/employee-scheduling/.gitignore delete mode 100644 use-cases/facility-location/.gitignore delete mode 100644 use-cases/food-packaging/.gitignore delete mode 100644 use-cases/maintenance-scheduling/.gitignore delete mode 100644 use-cases/order-picking/.gitignore delete mode 100644 use-cases/school-timetabling/.gitignore delete mode 100644 use-cases/vaccination-scheduling/.gitignore delete mode 100644 use-cases/vehicle-routing-capacity/.gitignore delete mode 100644 use-cases/vehicle-routing-time-windows/.gitignore diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f1eb0bd938..34a9e4fcd6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: open-pull-requests-limit: 10 target-branch: "development" commit-message: - prefix: "build: " + prefix: "deps: " - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4ee2cfff2..02c6a7b53a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,7 +83,10 @@ jobs: run: | git checkout ${{ github.event.inputs.stableBranch }} git checkout -B ${{ github.event.inputs.releaseBranch }}-bump - git merge -X theirs --squash ${{ github.event.inputs.releaseBranch }} + git checkout ${{ github.event.inputs.releaseBranch }} + git merge -s ours --no-edit ${{ github.event.inputs.stableBranch }} + git checkout ${{ github.event.inputs.releaseBranch }}-bump + git merge --squash ${{ github.event.inputs.releaseBranch }} git commit -m "chore: release version ${{ github.event.inputs.version }}" git push origin ${{ github.event.inputs.releaseBranch }}-bump gh pr create --reviewer triceo,ge0ffrey --base ${{ github.event.inputs.stableBranch }} --head ${{ github.event.inputs.releaseBranch }}-bump --title "chore: release version ${{ github.event.inputs.version }}" --body-file .github/workflows/release-pr-body-stable.md diff --git a/.gitignore b/.gitignore index b496e50691..d0fbf15f0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -/target -/local +target # Eclipse, Netbeans and IntelliJ files /.* @@ -8,9 +7,9 @@ !.gitattributes !/.mvn /nbproject -/*.ipr -/*.iws -/*.iml +*.ipr +*.iws +*.iml # Repository wide ignore mac DS_Store files .DS_Store diff --git a/README.adoc b/README.adoc index bf448fe50b..7150a4e640 100644 --- a/README.adoc +++ b/README.adoc @@ -20,7 +20,6 @@ a|* <> a|* link:use-cases/school-timetabling/README.adoc[Quarkus] (Java, Maven or Gradle, Quarkus, H2) * link:technology/java-spring-boot/README.adoc[Spring Boot] (Java, Maven or Gradle, Spring Boot, H2) -* link:technology/java-activemq-quarkus/README.adoc[ActiveMQ] (Java, ActiveMQ, Maven, Quarkus) * link:technology/kotlin-quarkus/README.adoc[Kotlin] (Kotlin, Maven, Quarkus, H2) 2+a|* <> @@ -59,7 +58,6 @@ image::build/quickstarts-showcase/src/main/resources/META-INF/resources/screensh * link:use-cases/school-timetabling/README.adoc[Run quarkus-school-timetabling] (Java, Maven or Gradle, Quarkus, H2) * link:technology/java-spring-boot/README.adoc[Run spring-boot-school-timetabling] (Java, Maven or Gradle, Spring Boot, H2) -* link:technology/java-activemq-quarkus/README.adoc[Run activemq-quarkus-school-timetabling] (Java, ActiveMQ, Maven, Quarkus) * link:technology/kotlin-quarkus/README.adoc[Run kotlin-quarkus-school-timetabling] (Kotlin, Maven, Quarkus, H2) * link:use-cases/vehicle-routing-capacity/README.adoc[Run quarkus-vehicle-routing-capacity] (Java, Maven or Gradle, Quarkus) diff --git a/build/quickstarts-showcase/.gitignore b/build/quickstarts-showcase/.gitignore deleted file mode 100644 index 8edd787369..0000000000 --- a/build/quickstarts-showcase/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.dockerignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/build/quickstarts-showcase/pom.xml b/build/quickstarts-showcase/pom.xml index c7e60f2b2b..5cfcfe47a2 100644 --- a/build/quickstarts-showcase/pom.xml +++ b/build/quickstarts-showcase/pom.xml @@ -5,7 +5,7 @@ ai.timefold.solver timefold-solver-quickstarts-parent - 1.0.0 + 1.1.0 ../../pom.xml diff --git a/hello-world/.gitignore b/hello-world/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/hello-world/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/hello-world/build.gradle b/hello-world/build.gradle index cd158d2625..2ab8d124c4 100644 --- a/hello-world/build.gradle +++ b/hello-world/build.gradle @@ -3,7 +3,7 @@ plugins { id "application" } -def timefoldVersion = "1.0.0" +def timefoldVersion = "1.1.0" def logbackVersion = "1.4.7" def junitJupiterVersion = "5.9.0" def assertjVersion = "3.24.2" diff --git a/hello-world/pom.xml b/hello-world/pom.xml index 205dccae85..3075932220 100644 --- a/hello-world/pom.xml +++ b/hello-world/pom.xml @@ -12,14 +12,14 @@ UTF-8 hello-world-run - 1.0.0 + 1.1.0 3.24.2 - 5.9.0 - 1.4.7 + 5.10.0 + 1.4.11 3.11.0 - 3.1.0 - 3.5.0 + 3.1.2 + 3.6.0 diff --git a/pom.xml b/pom.xml index b3330e7dfa..c1ad80ef24 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ ai.timefold.solver timefold-solver-build-parent - 1.0.0 + 1.1.0 @@ -22,7 +22,6 @@ hello-world technology/java-spring-boot - technology/java-activemq-quarkus technology/kotlin-quarkus use-cases/school-timetabling use-cases/facility-location diff --git a/technology/java-activemq-quarkus/.gitignore b/technology/java-activemq-quarkus/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/technology/java-activemq-quarkus/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/technology/java-activemq-quarkus/README.adoc b/technology/java-activemq-quarkus/README.adoc deleted file mode 100644 index 1d7da0ae2c..0000000000 --- a/technology/java-activemq-quarkus/README.adoc +++ /dev/null @@ -1,142 +0,0 @@ -= School Timetabling (Java, ActiveMQ, Quarkus, Maven) - -The quickstart consists of two modules: - -* Client runs the UI and sends requests to the Solver Server via ActiveMQ. -* Solver Server optimizes the requests sent via an ActiveMQ queue and sends results back to ActiveMQ broker. - -== Run the application with live coding - -. Git clone the timefold-quickstarts repo: -+ -[source, shell] ----- -$ git clone https://github.com/TimefoldAI/timefold-quickstarts.git -... -$ cd timefold-quickstarts/technology/java-activemq-quarkus ----- - -. Build the project: -+ -[source, shell] ----- -$ mvn clean install ----- -+ - -. Install https://docs.docker.com/get-docker/[docker] and https://docs.docker.com/compose/install/[docker-compose]. - -. Start the ActiveMQ broker, the Solver Server, and Client application with the `run.sh` script, which starts all 3 processes: -+ -[source, shell] ----- -$ ./run.sh ----- -+ - -. Visit http://localhost:8080 in your browser. - -. Click on the *Solve* button. - -In case of any error, please check the log files located in `java-activemq-quarkus/target`. - -Then try _live coding_: - -. Make some changes in the source code. -. Refresh your browser (F5). - -Notice that those changes are immediately in effect. - -== Package and run the application - -When you're done iterating in `quarkus:dev` mode, run the application as a conventional jar file. -Before running any application, start the ActiveMQ broker: - -[source, shell] ----- -$ docker-compose up ----- - -=== Package and run the Solver Server application - -. Compile it with Maven: -+ -[source, shell] ----- -$ cd solver -$ mvn package -DskipTests ----- -+ -. Run it: -+ -[source, shell] ----- -$ java -Dquarkus.http.port=8081 -jar ./target/quarkus-app/quarkus-run.jar ----- - -[NOTE] -Use the custom port to avoid conflict with the Client application. - -=== Package and run the Client application - -. Compile it with Maven: -+ -[source, shell] ----- -$ cd client -$ mvn package -DskipTests ----- -+ -. Run it: -+ -[source, shell] ----- -$ java -jar ./target/quarkus-app/quarkus-run.jar ----- -+ - -. Visit http://localhost:8080 in your browser. - -== Run a native executable - -First, https://quarkus.io/guides/building-native-image#configuring-graalvm[install GraalVM and gu install the native-image tool] - -=== Compile and run the Solver Server application natively - -. Compile the Solver Server application natively: -+ -[source, shell] ----- -$ cd solver -$ mvn package -Dnative -DskipTests ----- -+ -. Run the native executable: -+ -[source, shell] ----- -$ ./target/*-runner -Dquarkus.http.port=8081 ----- - -=== Compile and run the Client application natively - -. Compile the Client application natively: -+ -[source, shell] ----- -$ cd client -$ mvn package -Dnative -DskipTests ----- - -. Run the native executable: -+ -[source, shell] ----- -$ ./target/*-runner ----- - -. Visit http://localhost:8080 in your browser. - -== More information - -Visit https://timefold.ai[timefold.ai]. diff --git a/technology/java-activemq-quarkus/broker-00.xml b/technology/java-activemq-quarkus/broker-00.xml deleted file mode 100644 index 81f2bb0c8d..0000000000 --- a/technology/java-activemq-quarkus/broker-00.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - -
- - - true - - -
-
- - - true - - -
-
-
-
diff --git a/technology/java-activemq-quarkus/client/.gitignore b/technology/java-activemq-quarkus/client/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/technology/java-activemq-quarkus/client/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/technology/java-activemq-quarkus/client/pom.xml b/technology/java-activemq-quarkus/client/pom.xml deleted file mode 100644 index d66a5c0106..0000000000 --- a/technology/java-activemq-quarkus/client/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - 4.0.0 - - org.acme - timefold-solver-activemq-quarkus-school-timetabling - 1.0-SNAPSHOT - - - timefold-solver-activemq-quarkus-school-timetabling-client - ActiveMQ Quarkus School Timetabling Quickstart : Client - - - - org.acme - timefold-solver-activemq-quarkus-school-timetabling-common - - - - ai.timefold.solver - timefold-solver-quarkus - - - - - io.quarkus - quarkus-resteasy - - - io.quarkus - quarkus-resteasy-jackson - - - ai.timefold.solver - timefold-solver-quarkus-jackson - - - - io.quarkus - quarkus-smallrye-reactive-messaging - - - io.smallrye.reactive - smallrye-reactive-messaging-amqp - - - - - io.quarkus - quarkus-junit5 - test - - - io.smallrye.reactive - smallrye-reactive-messaging-in-memory - test - - - org.assertj - assertj-core - test - - - org.awaitility - awaitility - test - - - - - io.quarkus - quarkus-webjars-locator - - - ai.timefold.solver - timefold-solver-webui - runtime - - - org.webjars - bootstrap - runtime - - - org.webjars - jquery - runtime - - - org.webjars - font-awesome - runtime - - - org.webjars.npm - js-joda - runtime - - - - - - - io.quarkus - quarkus-maven-plugin - ${version.io.quarkus} - - - - diff --git a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/bootstrap/DemoDataGenerator.java b/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/bootstrap/DemoDataGenerator.java deleted file mode 100644 index 49f668312b..0000000000 --- a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/bootstrap/DemoDataGenerator.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.acme.schooltimetabling.bootstrap; - -import java.time.DayOfWeek; -import java.time.LocalTime; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicLong; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Inject; - -import org.acme.schooltimetabling.domain.Lesson; -import org.acme.schooltimetabling.domain.Room; -import org.acme.schooltimetabling.domain.TimeTable; -import org.acme.schooltimetabling.domain.Timeslot; -import org.acme.schooltimetabling.persistence.TimeTableRepository; -import org.eclipse.microprofile.config.inject.ConfigProperty; - -import io.quarkus.runtime.LaunchMode; -import io.quarkus.runtime.StartupEvent; - -@ApplicationScoped -public class DemoDataGenerator { - - private static final AtomicLong idGenerator = new AtomicLong(); - - @ConfigProperty(name = "timeTable.demoData", defaultValue = "SMALL") - DemoData demoData; - - @Inject - TimeTableRepository timeTableRepository; - - public void generateDemoData(@Observes StartupEvent startupEvent) { - if (LaunchMode.current() == LaunchMode.TEST) { - return; - } - if (demoData == DemoData.NONE) { - return; - } - - List timeslotList = new ArrayList<>(10); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(), DayOfWeek.MONDAY, LocalTime.of(8, 30), LocalTime.of(9, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(), DayOfWeek.MONDAY, LocalTime.of(9, 30), LocalTime.of(10, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.MONDAY, LocalTime.of(10, 30), LocalTime.of(11, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.MONDAY, LocalTime.of(13, 30), LocalTime.of(14, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.MONDAY, LocalTime.of(14, 30), LocalTime.of(15, 30))); - - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30))); - if (demoData == DemoData.LARGE) { - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(8, 30), LocalTime.of(9, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(9, 30), LocalTime.of(10, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(10, 30), LocalTime.of(11, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(13, 30), LocalTime.of(14, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(14, 30), LocalTime.of(15, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(8, 30), LocalTime.of(9, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(9, 30), LocalTime.of(10, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(10, 30), LocalTime.of(11, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(13, 30), LocalTime.of(14, 30))); - timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(14, 30), LocalTime.of(15, 30))); - } - - List roomList = new ArrayList<>(3); - roomList.add(new Room(idGenerator.incrementAndGet(), "Room A")); - roomList.add(new Room(idGenerator.incrementAndGet(), "Room B")); - roomList.add(new Room(idGenerator.incrementAndGet(), "Room C")); - if (demoData == DemoData.LARGE) { - roomList.add(new Room(idGenerator.incrementAndGet(), "Room D")); - roomList.add(new Room(idGenerator.incrementAndGet(), "Room E")); - roomList.add(new Room(idGenerator.incrementAndGet(), "Room F")); - } - - List lessonList = new ArrayList<>(); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Chemistry", "M. Curie", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Biology", "C. Darwin", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "I. Jones", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "I. Jones", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "9th grade")); - if (demoData == DemoData.LARGE) { - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "ICT", "A. Turing", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geography", "C. Darwin", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geology", "C. Darwin", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "I. Jones", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Drama", "I. Jones", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "9th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "9th grade")); - } - - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Chemistry", "M. Curie", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "French", "M. Curie", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geography", "C. Darwin", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "10th grade")); - if (demoData == DemoData.LARGE) { - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "ICT", "A. Turing", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Biology", "C. Darwin", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geology", "C. Darwin", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Drama", "I. Jones", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "10th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "10th grade")); - - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "ICT", "A. Turing", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Chemistry", "M. Curie", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "French", "M. Curie", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geography", "C. Darwin", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Biology", "C. Darwin", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geology", "C. Darwin", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Drama", "P. Cruz", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "11th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "11th grade")); - - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "ICT", "A. Turing", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Chemistry", "M. Curie", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "French", "M. Curie", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geography", "C. Darwin", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Biology", "C. Darwin", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geology", "C. Darwin", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Drama", "P. Cruz", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "12th grade")); - lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "12th grade")); - } - - Lesson lesson = lessonList.get(0); - lesson.setTimeslot(timeslotList.get(0)); - lesson.setRoom(roomList.get(0)); - - TimeTable timeTable = new TimeTable(timeslotList, roomList, lessonList); - timeTableRepository.update(timeTable); - } - - public enum DemoData { - NONE, - SMALL, - LARGE - } - -} diff --git a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java b/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java deleted file mode 100644 index 3fd2314c3c..0000000000 --- a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.acme.schooltimetabling.persistence; - -import java.util.Objects; - -import jakarta.enterprise.context.ApplicationScoped; - -import org.acme.schooltimetabling.domain.TimeTable; - -@ApplicationScoped -public class TimeTableRepository { - - private TimeTable timeTable; - - public TimeTable get() { - return timeTable; - } - - public void update(TimeTable timeTable) { - this.timeTable = Objects.requireNonNull(timeTable); - } -} diff --git a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/rest/TimeTableResource.java b/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/rest/TimeTableResource.java deleted file mode 100644 index 2e191fe53b..0000000000 --- a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/rest/TimeTableResource.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.acme.schooltimetabling.rest; - -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -import org.acme.schooltimetabling.domain.TimeTable; -import org.acme.schooltimetabling.message.SolverRequest; -import org.acme.schooltimetabling.message.SolverResponse; -import org.acme.schooltimetabling.persistence.TimeTableRepository; -import org.eclipse.microprofile.reactive.messaging.Acknowledgment; -import org.eclipse.microprofile.reactive.messaging.Channel; -import org.eclipse.microprofile.reactive.messaging.Emitter; -import org.eclipse.microprofile.reactive.messaging.Incoming; -import ai.timefold.solver.core.api.solver.SolverStatus; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Path("timeTable") -public class TimeTableResource { - - public static final Long SINGLETON_TIME_TABLE_ID = 1L; - - @Inject - TimeTableRepository timeTableRepository; - - @Inject - @Channel("solver_request") - Emitter solverRequestEmitter; - - @Inject - ObjectMapper objectMapper; - - @Incoming("solver_response") - @Acknowledgment(Acknowledgment.Strategy.POST_PROCESSING) - public void process(String solverResponseMessage) { - SolverResponse solverResponse; - try { - solverResponse = objectMapper.readValue(solverResponseMessage, SolverResponse.class); - } catch (JsonProcessingException ex) { - throw new IllegalStateException("Unable to deserialize the solver response.", ex); - } - - if (solverResponse.isSuccess()) { - TimeTable timeTable = solverResponse.getTimeTable(); - timeTable.setSolverStatus(SolverStatus.NOT_SOLVING); - timeTableRepository.update(timeTable); - } else { - timeTableRepository.get().setSolverStatus(SolverStatus.NOT_SOLVING); - throw new IllegalStateException("Solving failed with exception class (" - + solverResponse.getErrorInfo().getExceptionClassName() - + ") and message (" + solverResponse.getErrorInfo().getExceptionMessage() + ")."); - } - } - - // To try, open http://localhost:8080/timeTable - @GET - @Produces(MediaType.APPLICATION_JSON) - public TimeTable getTimeTable() { - TimeTable timeTable = timeTableRepository.get(); - return timeTable; - } - - @POST - @Path("solve") - public void solve() throws JsonProcessingException { - TimeTable timeTable = timeTableRepository.get(); - timeTable.setSolverStatus(SolverStatus.SOLVING_SCHEDULED); - - SolverRequest solverRequest = new SolverRequest(SINGLETON_TIME_TABLE_ID, timeTable); - String solverRequestJson = objectMapper.writeValueAsString(solverRequest); - solverRequestEmitter.send(solverRequestJson); - } -} diff --git a/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/app.js b/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/app.js deleted file mode 100644 index 0c52808c92..0000000000 --- a/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/app.js +++ /dev/null @@ -1,189 +0,0 @@ -var autoRefreshIntervalId = null; -const dateTimeFormatter = JSJoda.DateTimeFormatter.ofPattern('HH:mm') - -function refreshTimeTable() { - $.getJSON("/timeTable", function (timeTable) { - refreshSolvingButtons(timeTable.solverStatus != null && timeTable.solverStatus !== "NOT_SOLVING"); - $("#score").text("Score: " + (timeTable.score == null ? "?" : timeTable.score)); - - const timeTableByRoom = $("#timeTableByRoom"); - timeTableByRoom.children().remove(); - const timeTableByTeacher = $("#timeTableByTeacher"); - timeTableByTeacher.children().remove(); - const timeTableByStudentGroup = $("#timeTableByStudentGroup"); - timeTableByStudentGroup.children().remove(); - const unassignedLessons = $("#unassignedLessons"); - unassignedLessons.children().remove(); - - const theadByRoom = $("").appendTo(timeTableByRoom); - const headerRowByRoom = $("").appendTo(theadByRoom); - headerRowByRoom.append($("Timeslot")); - $.each(timeTable.roomList, (index, room) => { - headerRowByRoom - .append($("") - .append($("").text(room.name)) - .append($(` - - - Score: ? - -
- -
- -
-
- - -
-
-
- - -
-
-
- - -
-
-
- -

Unassigned lessons

-
- -
- - - - - - - - diff --git a/technology/java-activemq-quarkus/client/src/main/resources/application.properties b/technology/java-activemq-quarkus/client/src/main/resources/application.properties deleted file mode 100644 index fd661cfc6e..0000000000 --- a/technology/java-activemq-quarkus/client/src/main/resources/application.properties +++ /dev/null @@ -1,29 +0,0 @@ -######################## -# General properties -######################## -# Enable CORS for runQuickstartsFromSource.sh -quarkus.http.cors=true -# Allow all origins in dev-mode -%dev.quarkus.http.cors.origins=/.*/ - -######################## -# Demo properties -######################## - -# The demo dataset size: NONE, SMALL, LARGE -# timeTable.demoData=LARGE - -######################## -# Messaging -######################## - -amqp-username=quarkus -amqp-password=quarkus - -# Configure the Kafka sink to write to it -mp.messaging.outgoing.solver_request.connector=smallrye-amqp -mp.messaging.outgoing.solver_request.durable=true - -# Configure the Kafka source to read from it -mp.messaging.incoming.solver_response.connector=smallrye-amqp -mp.messaging.incoming.solver_response.durable=true diff --git a/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/ActiveMQTestResourceLifecycleManager.java b/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/ActiveMQTestResourceLifecycleManager.java deleted file mode 100644 index abb025182e..0000000000 --- a/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/ActiveMQTestResourceLifecycleManager.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.acme.schooltimetabling; - -import java.util.HashMap; -import java.util.Map; - -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import io.smallrye.reactive.messaging.memory.InMemoryConnector; - -public class ActiveMQTestResourceLifecycleManager implements QuarkusTestResourceLifecycleManager { - - @Override - public Map start() { - Map env = new HashMap<>(); - Map solverRequestSinkProperties = InMemoryConnector.switchOutgoingChannelsToInMemory("solver_request"); - Map solverResponseSourceProperties = - InMemoryConnector.switchIncomingChannelsToInMemory("solver_response"); - env.putAll(solverRequestSinkProperties); - env.putAll(solverResponseSourceProperties); - return env; - } - - @Override - public void stop() { - InMemoryConnector.clear(); - } -} diff --git a/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/TimeTableResourceTest.java b/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/TimeTableResourceTest.java deleted file mode 100644 index a8a14d2e03..0000000000 --- a/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/TimeTableResourceTest.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.acme.schooltimetabling; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.awaitility.Awaitility.await; - -import java.time.DayOfWeek; -import java.time.Duration; -import java.time.LocalTime; -import java.time.temporal.ChronoUnit; -import java.util.Collections; -import java.util.List; - -import io.smallrye.reactive.messaging.memory.InMemoryConnector; -import jakarta.enterprise.inject.Any; -import jakarta.inject.Inject; - -import org.acme.schooltimetabling.domain.Lesson; -import org.acme.schooltimetabling.domain.Room; -import org.acme.schooltimetabling.domain.TimeTable; -import org.acme.schooltimetabling.domain.Timeslot; -import org.acme.schooltimetabling.message.SolverRequest; -import org.acme.schooltimetabling.message.SolverResponse; -import org.acme.schooltimetabling.persistence.TimeTableRepository; -import org.acme.schooltimetabling.rest.TimeTableResource; -import org.eclipse.microprofile.reactive.messaging.Message; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; -import io.smallrye.reactive.messaging.memory.InMemorySink; -import io.smallrye.reactive.messaging.memory.InMemorySource; - -@QuarkusTest -@QuarkusTestResource(ActiveMQTestResourceLifecycleManager.class) -public class TimeTableResourceTest { - - private static final Duration AWAIT_TIMEOUT = Duration.of(20L, ChronoUnit.SECONDS); - - @Inject - @Any - InMemoryConnector connector; - - @Inject - TimeTableResource timeTableResource; - - @Inject - TimeTableRepository timeTableRepository; - - @Inject - ObjectMapper objectMapper; - - private InMemorySink solverRequestSink; - private InMemorySource solverResponseSource; - - @BeforeEach - void setupChannels() { - solverRequestSink = connector.sink("solver_request"); - solverResponseSource = connector.source("solver_response"); - prepareTestTimeTable(); - } - - @Test - @Timeout(60L) - void solveAndRetrieve() throws JsonProcessingException { - timeTableResource.solve(); - - await() - .timeout(AWAIT_TIMEOUT) - .until(solverRequestSink::received, messages -> messages.size() == 1); - - Message solverRequestMessage = solverRequestSink.received().get(0); - SolverRequest solverRequest = objectMapper.readValue(solverRequestMessage.getPayload(), SolverRequest.class); - - // Assign one lesson to simulate solving. - TimeTable requestTimeTable = solverRequest.getTimeTable(); - Lesson firstLesson = requestTimeTable.getLessonList().get(0); - firstLesson.setRoom(requestTimeTable.getRoomList().get(0)); - firstLesson.setTimeslot(requestTimeTable.getTimeslotList().get(0)); - - SolverResponse solverResponse = new SolverResponse(solverRequest.getProblemId(), requestTimeTable); - solverResponseSource.send(objectMapper.writeValueAsString(solverResponse)); - - // Wait until the client receives the message and saves the new timetable to a database. - await() - .timeout(AWAIT_TIMEOUT) - .until(timeTableResource::getTimeTable, timeTable -> timeTable.getLessonList().get(0).getRoom() != null); - - Lesson solvedFirstLesson = timeTableResource.getTimeTable().getLessonList().get(0); - assertThat(solvedFirstLesson.getRoom()).isNotNull(); - assertThat(solvedFirstLesson.getTimeslot()).isNotNull(); - } - - private void prepareTestTimeTable() { - List rooms = Collections.singletonList(new Room(1L, "room-A")); - List timeslots = - Collections.singletonList(new Timeslot(1L, DayOfWeek.WEDNESDAY, LocalTime.NOON, LocalTime.NOON)); - List lessons = Collections.singletonList(new Lesson(1L, "Physics", "M. Curie", "12th grade")); - timeTableRepository.update(new TimeTable(timeslots, rooms, lessons)); - } -} diff --git a/technology/java-activemq-quarkus/common/.gitignore b/technology/java-activemq-quarkus/common/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/technology/java-activemq-quarkus/common/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/technology/java-activemq-quarkus/common/pom.xml b/technology/java-activemq-quarkus/common/pom.xml deleted file mode 100644 index 38b7a11db8..0000000000 --- a/technology/java-activemq-quarkus/common/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - org.acme - timefold-solver-activemq-quarkus-school-timetabling - 1.0-SNAPSHOT - - - timefold-solver-activemq-quarkus-school-timetabling-common - ActiveMQ Quarkus School Timetabling Quickstart : Common - - - - io.quarkus - quarkus-core - - - com.fasterxml.jackson.core - jackson-annotations - - - ai.timefold.solver - timefold-solver-quarkus - - - - - - - org.jboss.jandex - jandex-maven-plugin - - - - jandex - - - - - - - - diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Lesson.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Lesson.java deleted file mode 100644 index 83aaf455c8..0000000000 --- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Lesson.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.acme.schooltimetabling.domain; - -import ai.timefold.solver.core.api.domain.entity.PlanningEntity; -import ai.timefold.solver.core.api.domain.lookup.PlanningId; -import ai.timefold.solver.core.api.domain.variable.PlanningVariable; - -@PlanningEntity -public class Lesson { - - @PlanningId - private Long id; - - private String subject; - private String teacher; - private String studentGroup; - - @PlanningVariable - private Timeslot timeslot; - @PlanningVariable - private Room room; - - Lesson() { - // Required for JSON deserialization. - } - - public Lesson(Long id, String subject, String teacher, String studentGroup) { - this.id = id; - this.subject = subject; - this.teacher = teacher; - this.studentGroup = studentGroup; - } - - public Lesson(long id, String subject, String teacher, String studentGroup, Timeslot timeslot, Room room) { - this(id, subject, teacher, studentGroup); - this.timeslot = timeslot; - this.room = room; - } - - @Override - public String toString() { - return subject + "(" + id + ")"; - } - - // ************************************************************************ - // Getters and setters - // ************************************************************************ - - public Long getId() { - return id; - } - - public String getSubject() { - return subject; - } - - public String getTeacher() { - return teacher; - } - - public String getStudentGroup() { - return studentGroup; - } - - public Timeslot getTimeslot() { - return timeslot; - } - - public void setTimeslot(Timeslot timeslot) { - this.timeslot = timeslot; - } - - public Room getRoom() { - return room; - } - - public void setRoom(Room room) { - this.room = room; - } - -} diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Room.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Room.java deleted file mode 100644 index 749c5deefb..0000000000 --- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Room.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.acme.schooltimetabling.domain; - -import ai.timefold.solver.core.api.domain.lookup.PlanningId; - -public class Room { - - @PlanningId - private Long id; - - private String name; - - Room() { - // Required for JSON deserialization. - } - - public Room(long id, String name) { - this.name = name; - this.id = id; - } - - @Override - public String toString() { - return name; - } - - // ************************************************************************ - // Getters - // ************************************************************************ - - public Long getId() { - return id; - } - - public String getName() { - return name; - } - -} diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java deleted file mode 100644 index 72fe3323f0..0000000000 --- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.acme.schooltimetabling.domain; - -import java.util.List; - -import ai.timefold.solver.core.api.domain.solution.PlanningEntityCollectionProperty; -import ai.timefold.solver.core.api.domain.solution.PlanningScore; -import ai.timefold.solver.core.api.domain.solution.PlanningSolution; -import ai.timefold.solver.core.api.domain.solution.ProblemFactCollectionProperty; -import ai.timefold.solver.core.api.domain.valuerange.ValueRangeProvider; -import ai.timefold.solver.core.api.score.buildin.hardsoft.HardSoftScore; -import ai.timefold.solver.core.api.solver.SolverStatus; - -@PlanningSolution -public class TimeTable { - - @ProblemFactCollectionProperty - @ValueRangeProvider - private List timeslotList; - @ProblemFactCollectionProperty - @ValueRangeProvider - private List roomList; - @PlanningEntityCollectionProperty - private List lessonList; - - @PlanningScore - private HardSoftScore score; - - // Ignored by Timefold, used by the UI to display solve or stop solving button. - private SolverStatus solverStatus; - - - public TimeTable() { - // No-arg constructor required for Timefold and for JSON deserialization. - } - - public TimeTable(List timeslotList, List roomList, List lessonList) { - this.timeslotList = timeslotList; - this.roomList = roomList; - this.lessonList = lessonList; - } - - // ************************************************************************ - // Getters and setters - // ************************************************************************ - - public List getTimeslotList() { - return timeslotList; - } - - public List getRoomList() { - return roomList; - } - - public List getLessonList() { - return lessonList; - } - - public HardSoftScore getScore() { - return score; - } - - public SolverStatus getSolverStatus() { - return solverStatus; - } - - public void setSolverStatus(SolverStatus solverStatus) { - this.solverStatus = solverStatus; - } -} diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java deleted file mode 100644 index 57d45f4b2e..0000000000 --- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.acme.schooltimetabling.domain; - -import java.time.DayOfWeek; -import java.time.LocalTime; - -import ai.timefold.solver.core.api.domain.lookup.PlanningId; - -public class Timeslot { - - @PlanningId - private Long id; - - private DayOfWeek dayOfWeek; - private LocalTime startTime; - private LocalTime endTime; - - Timeslot() { - // Required for JSON deserialization. - } - - public Timeslot(long id, DayOfWeek dayOfWeek, LocalTime startTime, LocalTime endTime) { - this.dayOfWeek = dayOfWeek; - this.startTime = startTime; - this.endTime = endTime; - this.id = id; - } - - public Timeslot(long id, DayOfWeek dayOfWeek, LocalTime startTime) { - this(id, dayOfWeek, startTime, startTime.plusMinutes(50)); - } - - @Override - public String toString() { - return dayOfWeek + " " + startTime; - } - - // ************************************************************************ - // Getters - // ************************************************************************ - - public Long getId() { - return id; - } - - public DayOfWeek getDayOfWeek() { - return dayOfWeek; - } - - public LocalTime getStartTime() { - return startTime; - } - - public LocalTime getEndTime() { - return endTime; - } - -} diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverRequest.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverRequest.java deleted file mode 100644 index 9a92e575a2..0000000000 --- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverRequest.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.acme.schooltimetabling.message; - -import org.acme.schooltimetabling.domain.TimeTable; - -import io.quarkus.runtime.annotations.RegisterForReflection; - -@RegisterForReflection -public class SolverRequest { - private Long problemId; - private TimeTable timeTable; - - SolverRequest() { - // Required for JSON deserialization. - } - - public SolverRequest(Long problemId, TimeTable timeTable) { - this.problemId = problemId; - this.timeTable = timeTable; - } - - public Long getProblemId() { - return problemId; - } - - public TimeTable getTimeTable() { - return timeTable; - } -} diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverResponse.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverResponse.java deleted file mode 100644 index ab233dbf03..0000000000 --- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverResponse.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.acme.schooltimetabling.message; - -import org.acme.schooltimetabling.domain.TimeTable; - -import com.fasterxml.jackson.annotation.JsonIgnore; - -import io.quarkus.runtime.annotations.RegisterForReflection; - -@RegisterForReflection -public class SolverResponse { - - private Long problemId; - private TimeTable timeTable; - private ResponseStatus responseStatus; - private ErrorInfo errorInfo; - - SolverResponse() { - // Required for JSON deserialization. - } - - public SolverResponse(Long problemId, TimeTable timeTable) { - this.problemId = problemId; - this.timeTable = timeTable; - this.responseStatus = ResponseStatus.SUCCESS; - } - - public SolverResponse(Long problemId, ErrorInfo errorInfo) { - this.problemId = problemId; - this.errorInfo = errorInfo; - this.responseStatus = ResponseStatus.FAILURE; - } - - public Long getProblemId() { - return problemId; - } - - public TimeTable getTimeTable() { - return timeTable; - } - - public ErrorInfo getErrorInfo() { - return errorInfo; - } - - public ResponseStatus getResponseStatus() { - return responseStatus; - } - - @JsonIgnore - public boolean isSuccess() { - return ResponseStatus.SUCCESS == responseStatus; - } - - public enum ResponseStatus { - SUCCESS, - FAILURE - } - - public static class ErrorInfo { - private String exceptionClassName; - private String exceptionMessage; - - ErrorInfo() { - // Required for JSON deserialization. - } - - public ErrorInfo(String exceptionClassName, String exceptionMessage) { - this.exceptionClassName = exceptionClassName; - this.exceptionMessage = exceptionMessage; - } - - public String getExceptionClassName() { - return exceptionClassName; - } - - public String getExceptionMessage() { - return exceptionMessage; - } - } -} diff --git a/technology/java-activemq-quarkus/docker-compose.yml b/technology/java-activemq-quarkus/docker-compose.yml deleted file mode 100644 index 3e9464d83f..0000000000 --- a/technology/java-activemq-quarkus/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -# A docker compose file to start the ActiveMQ Artemis broker. -# more details on https://github.com/vromero/activemq-artemis-docker. -version: '2' - -services: - - artemis: - image: quay.io/artemiscloud/activemq-artemis-broker:latest - ports: - - "8161:8161" - - "61616:61616" - - "5672:5672" - volumes: - - .:/var/lib/artemis/etc-override - environment: - AMQ_USER: quarkus - AMQ_PASSWORD: quarkus - diff --git a/technology/java-activemq-quarkus/pom.xml b/technology/java-activemq-quarkus/pom.xml deleted file mode 100644 index 3f68185958..0000000000 --- a/technology/java-activemq-quarkus/pom.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - 4.0.0 - - org.acme - timefold-solver-activemq-quarkus-school-timetabling - 1.0-SNAPSHOT - pom - - - 17 - UTF-8 - - 1.0.0 - 3.0.3.Final - 2.28.0 - - 3.8.1 - 3.0.0-M8 - - - - common - client - solver - - - - - - io.quarkus - - quarkus-bom - ${version.io.quarkus} - pom - import - - - ai.timefold.solver - timefold-solver-bom - ${version.ai.timefold.solver} - pom - import - - - io.quarkiverse.artemis - quarkus-artemis-jms - - 3.0.0.CR1 - - - org.acme - timefold-solver-activemq-quarkus-school-timetabling-common - ${project.version} - - - org.apache.activemq - artemis-amqp-protocol - ${version.org.apache.activemq} - - - org.apache.activemq - artemis-server - ${version.org.apache.activemq} - - - org.awaitility - awaitility - 4.2.0 - - - org.webjars - bootstrap - 5.2.3 - - - org.webjars - jquery - 3.6.4 - - - org.webjars - font-awesome - 5.15.1 - - - org.webjars.npm - js-joda - 1.11.0 - - - org.assertj - assertj-core - 3.24.2 - - - - - - - - - maven-compiler-plugin - ${version.compiler.plugin} - - - io.quarkus - quarkus-maven-plugin - ${version.io.quarkus} - - - - build - - - - - - org.jboss.jandex - jandex-maven-plugin - 1.0.8 - - - maven-surefire-plugin - ${version.surefire.plugin} - - - org.jboss.logmanager.LogManager - - - - - - - - - - native - - - native - - - - - - maven-failsafe-plugin - ${version.surefire.plugin} - - - - integration-test - verify - - - - org.jboss.logmanager.LogManager - ${project.build.directory}/${project.build.finalName}-runner - - - - - - - - - native - - native - - - - - diff --git a/technology/java-activemq-quarkus/run.sh b/technology/java-activemq-quarkus/run.sh deleted file mode 100755 index 803bf2d336..0000000000 --- a/technology/java-activemq-quarkus/run.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -trap ctrl_c INT - -function ctrl_c() { - terminate "$PID_CLIENT" "$PID_SOLVER" "$PID_DOCKER_AMQ" - exit 0 -} - -function terminate() { - for pid in "$@" - do - echo "Stopping a process ($pid)" - kill "$pid" - done -} - -function wait_for_url() { - local _application_url=$1 - local _timeout_seconds=$2 - local _increment=1 - - local _spent=0 - echo "Waiting up to ${_timeout_seconds} seconds for ${_application_url} to become available." - while [[ "200" != $(curl -LI "${_application_url}" -o /dev/null -w '%{http_code}' -s) && ${_spent} -lt ${_timeout_seconds} ]] - do - sleep ${_increment} - _spent=$((_spent + _increment)) - done -} - -function check_directory_exists() { - local _directory=$1 - local _hint=$2 - if [ ! -d "$_directory" ]; then - echo "The directory $_directory does not exist. $_hint" - exit 1 -fi -} - -readonly solverModule=solver -readonly clientModule=client - -check_directory_exists $solverModule/target "Maybe build the project by running \"mvn clean install\"." -check_directory_exists $clientModule/target "Maybe build the project by running \"mvn clean install\"." - -if [ ! -d target ]; then - mkdir target -fi - -# Check if docker-compose is available. -if ! docker-compose --version &> /dev/null ; then - echo "docker-compose was not detected. Please make sure that docker-compose has been properly installed." - exit 1 -fi - -# Run docker-compose to start ActiveMQ broker. -docker-compose up > target/activemq.log 2>&1 & -readonly PID_DOCKER_AMQ=$! -echo "Running the ActiveMQ broker via docker." - -# Run the solver. -mvn clean quarkus:dev -f $solverModule -Dquarkus.http.port="$SOLVER_PORT" -Ddebug=8180 > target/solver.log 2>&1 & -readonly PID_SOLVER=$! -echo "Running the solver." - -# Run the client. -mvn clean quarkus:dev -f $clientModule > target/client.log 2>&1 & -readonly PID_CLIENT=$! -echo "Running the client." - -# Wait for the application to start up. -readonly URL="http://localhost:8080" -wait_for_url "$URL" 60 -echo "Application available at $URL" -echo "Press [Ctrl+C] to exit." - -echo -if [ "$1" = "-v" ]; then - echo "--------------- SOLVER output ---------------" - tail -f target/solver.log -else - echo "To display output of the solver, invoke this script with the '-v' option. Complete logs are available in the 'target' directory." -fi -wait diff --git a/technology/java-activemq-quarkus/solver/.gitignore b/technology/java-activemq-quarkus/solver/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/technology/java-activemq-quarkus/solver/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/technology/java-activemq-quarkus/solver/pom.xml b/technology/java-activemq-quarkus/solver/pom.xml deleted file mode 100644 index 5894396fac..0000000000 --- a/technology/java-activemq-quarkus/solver/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - 4.0.0 - - org.acme - timefold-solver-activemq-quarkus-school-timetabling - 1.0-SNAPSHOT - - - timefold-solver-activemq-quarkus-school-timetabling-solver - ActiveMQ Quarkus School Timetabling Quickstart : Solver Server - - - - org.acme - timefold-solver-activemq-quarkus-school-timetabling-common - - - ai.timefold.solver - timefold-solver-quarkus - - - ai.timefold.solver - timefold-solver-quarkus-jackson - - - - io.quarkus - quarkus-smallrye-reactive-messaging - - - io.smallrye.reactive - smallrye-reactive-messaging-amqp - - - - - io.quarkus - quarkus-junit5 - test - - - org.assertj - assertj-core - test - - - org.apache.activemq - artemis-server - test - - - org.jboss.logmanager - jboss-logmanager - - - commons-logging - commons-logging - - - - - org.apache.activemq - artemis-amqp-protocol - test - - - io.quarkiverse.artemis - quarkus-artemis-jms - test - - - org.awaitility - awaitility - test - - - ai.timefold.solver - timefold-solver-test - test - - - - - - - io.quarkus - quarkus-maven-plugin - ${version.io.quarkus} - - - - diff --git a/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/messaging/TimeTableMessagingHandler.java b/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/messaging/TimeTableMessagingHandler.java deleted file mode 100644 index 0e6dbd3ea7..0000000000 --- a/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/messaging/TimeTableMessagingHandler.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.acme.schooltimetabling.messaging; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -import java.util.function.Consumer; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - -import org.acme.schooltimetabling.domain.TimeTable; -import org.acme.schooltimetabling.message.SolverRequest; -import org.acme.schooltimetabling.message.SolverResponse; -import org.eclipse.microprofile.reactive.messaging.Channel; -import org.eclipse.microprofile.reactive.messaging.Emitter; -import org.eclipse.microprofile.reactive.messaging.Incoming; -import org.eclipse.microprofile.reactive.messaging.Message; -import ai.timefold.solver.core.api.solver.Solver; -import ai.timefold.solver.core.api.solver.SolverFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@ApplicationScoped -public class TimeTableMessagingHandler { - - private static final Logger LOGGER = LoggerFactory.getLogger(TimeTableMessagingHandler.class); - public static final String SOLVER_REQUEST_CHANNEL = "solver_request"; - public static final String SOLVER_RESPONSE_CHANNEL = "solver_response"; - - Solver solver; - - @Inject - ObjectMapper objectMapper; - - @Inject - @Channel(SOLVER_RESPONSE_CHANNEL) - Emitter solverResponseEmitter; - - @Inject - TimeTableMessagingHandler(SolverFactory solverFactory) { - solver = solverFactory.buildSolver(); - } - - @Incoming(SOLVER_REQUEST_CHANNEL) - public CompletionStage solve(Message solverRequestMessage) { - return CompletableFuture.runAsync(() -> { - SolverRequest solverRequest; - try { - solverRequest = objectMapper.readValue(solverRequestMessage.getPayload(), SolverRequest.class); - } catch (Throwable throwable) { - LOGGER.warn("Unable to deserialize solver request from JSON.", throwable); - /* Usually a bad request, which should be immediately rejected. No error response can be sent back - as the problemId is unknown. Such a NACKed message is redirected to the DLQ (Dead letter queue). - Catching the Throwable to make sure no unchecked exceptions are missed. */ - solverRequestMessage.nack(throwable); - return; - } - - TimeTable solution; - try { - solution = solver.solve(solverRequest.getTimeTable()); - replySuccess(solverRequestMessage, solverRequest.getProblemId(), solution); - } catch (Throwable throwable) { - LOGGER.warn("Error during processing a solver request ({}).", solverRequest.getProblemId(), throwable); - replyFailure(solverRequestMessage, solverRequest.getProblemId(), throwable); - } - }); - } - - private void replySuccess(Message solverRequestMessage, Long problemId, TimeTable solution) { - SolverResponse solverResponse = new SolverResponse(problemId, solution); - reply(solverRequestMessage, solverResponse, exception -> replyFailure(solverRequestMessage, problemId, exception)); - } - - private void replyFailure(Message solverRequestMessage, Long problemId, Throwable throwable) { - SolverResponse solverResponse = - new SolverResponse(problemId, - new SolverResponse.ErrorInfo(throwable.getClass().getName(), throwable.getMessage())); - reply(solverRequestMessage, solverResponse, serializationException -> { - throw new IllegalStateException("Unable to serialize error response.", serializationException); - }); - } - - private void reply(Message solverRequestMessage, SolverResponse solverResponse, - Consumer onFailure) { - try { - String jsonResponse = objectMapper.writeValueAsString(solverResponse); - solverResponseEmitter.send(jsonResponse).thenAccept(x -> solverRequestMessage.ack()); - } catch (JsonProcessingException ex) { - onFailure.accept(ex); - } - } -} diff --git a/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java b/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java deleted file mode 100644 index 78626e45d3..0000000000 --- a/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.acme.schooltimetabling.solver; - -import java.time.Duration; - -import org.acme.schooltimetabling.domain.Lesson; -import ai.timefold.solver.core.api.score.buildin.hardsoft.HardSoftScore; -import ai.timefold.solver.core.api.score.stream.Constraint; -import ai.timefold.solver.core.api.score.stream.ConstraintFactory; -import ai.timefold.solver.core.api.score.stream.ConstraintProvider; -import ai.timefold.solver.core.api.score.stream.Joiners; - -public class TimeTableConstraintProvider implements ConstraintProvider { - - @Override - public Constraint[] defineConstraints(ConstraintFactory constraintFactory) { - return new Constraint[] { - // Hard constraints - roomConflict(constraintFactory), - teacherConflict(constraintFactory), - studentGroupConflict(constraintFactory), - // Soft constraints - teacherRoomStability(constraintFactory), - teacherTimeEfficiency(constraintFactory), - studentGroupSubjectVariety(constraintFactory) - }; - } - - Constraint roomConflict(ConstraintFactory constraintFactory) { - // A room can accommodate at most one lesson at the same time. - return constraintFactory - // Select each pair of 2 different lessons ... - .forEachUniquePair(Lesson.class, - // ... in the same timeslot ... - Joiners.equal(Lesson::getTimeslot), - // ... in the same room ... - Joiners.equal(Lesson::getRoom)) - // ... and penalize each pair with a hard weight. - .penalize(HardSoftScore.ONE_HARD) - .asConstraint("Room conflict"); - } - - Constraint teacherConflict(ConstraintFactory constraintFactory) { - // A teacher can teach at most one lesson at the same time. - return constraintFactory - .forEachUniquePair(Lesson.class, - Joiners.equal(Lesson::getTimeslot), - Joiners.equal(Lesson::getTeacher)) - .penalize(HardSoftScore.ONE_HARD) - .asConstraint("Teacher conflict"); - } - - Constraint studentGroupConflict(ConstraintFactory constraintFactory) { - // A student can attend at most one lesson at the same time. - return constraintFactory - .forEachUniquePair(Lesson.class, - Joiners.equal(Lesson::getTimeslot), - Joiners.equal(Lesson::getStudentGroup)) - .penalize(HardSoftScore.ONE_HARD) - .asConstraint("Student group conflict"); - } - - Constraint teacherRoomStability(ConstraintFactory constraintFactory) { - // A teacher prefers to teach in a single room. - return constraintFactory - .forEachUniquePair(Lesson.class, - Joiners.equal(Lesson::getTeacher)) - .filter((lesson1, lesson2) -> lesson1.getRoom() != lesson2.getRoom()) - .penalize(HardSoftScore.ONE_SOFT) - .asConstraint("Teacher room stability"); - } - - Constraint teacherTimeEfficiency(ConstraintFactory constraintFactory) { - // A teacher prefers to teach sequential lessons and dislikes gaps between lessons. - return constraintFactory - .forEach(Lesson.class) - .join(Lesson.class, Joiners.equal(Lesson::getTeacher), - Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek())) - .filter((lesson1, lesson2) -> { - Duration between = Duration.between(lesson1.getTimeslot().getEndTime(), - lesson2.getTimeslot().getStartTime()); - return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0; - }) - .reward(HardSoftScore.ONE_SOFT) - .asConstraint("Teacher time efficiency"); - } - - Constraint studentGroupSubjectVariety(ConstraintFactory constraintFactory) { - // A student group dislikes sequential lessons on the same subject. - return constraintFactory - .forEach(Lesson.class) - .join(Lesson.class, - Joiners.equal(Lesson::getSubject), - Joiners.equal(Lesson::getStudentGroup), - Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek())) - .filter((lesson1, lesson2) -> { - Duration between = Duration.between(lesson1.getTimeslot().getEndTime(), - lesson2.getTimeslot().getStartTime()); - return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0; - }) - .penalize(HardSoftScore.ONE_SOFT) - .asConstraint("Student group subject variety"); - } - -} diff --git a/technology/java-activemq-quarkus/solver/src/main/resources/application.properties b/technology/java-activemq-quarkus/solver/src/main/resources/application.properties deleted file mode 100644 index fb8d443dd6..0000000000 --- a/technology/java-activemq-quarkus/solver/src/main/resources/application.properties +++ /dev/null @@ -1,45 +0,0 @@ -######################## -# Timefold properties -######################## - -# The solver runs for 10 seconds. To run for 5 minutes use "5m" and for 2 hours use "2h". -quarkus.timefold.solver.termination.spent-limit=10s - -# To change how many solvers to run in parallel -# timefold.solver-manager.parallel-solver-count=4 -# To run increase CPU cores usage per solver -# quarkus.timefold.solver.move-thread-count=2 - -# Temporary comment this out to detect bugs in your code (lowers performance) -# quarkus.timefold.solver.environment-mode=FULL_ASSERT -# To see what Timefold is doing, turn on DEBUG or TRACE logging. -quarkus.log.category."ai.timefold.solver".level=DEBUG -%test.quarkus.log.category."ai.timefold.solver".level=INFO -%prod.quarkus.log.category."ai.timefold.solver".level=INFO - -# XML file for power tweaking, defaults to solverConfig.xml (directly under src/main/resources) -# quarkus.timefold.solver-config-xml=org/.../timeTableSolverConfig.xml - -######################## -# Test overrides -######################## - -# Effectively disable spent-time termination in favor of the best-score-limit -%test.quarkus.timefold.solver.termination.spent-limit=1h -%test.quarkus.timefold.solver.termination.best-score-limit=0hard/*soft - -######################## -# Messaging -######################## - -amqp-username=quarkus -amqp-password=quarkus - -# Configure the ActiveMQ source to read from it -mp.messaging.incoming.solver_request.connector=smallrye-amqp -mp.messaging.incoming.solver_request.durable=true -mp.messaging.incoming.solver_request.failure-strategy=reject - -# Configure the ActiveMQ sink to write to it -mp.messaging.outgoing.solver_response.connector=smallrye-amqp -mp.messaging.outgoing.solver_response.durable=true diff --git a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/ActiveMQEmbeddedBroker.java b/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/ActiveMQEmbeddedBroker.java deleted file mode 100644 index bcdca4be18..0000000000 --- a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/ActiveMQEmbeddedBroker.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.acme.schooltimetabling; - -import static org.awaitility.Awaitility.await; - -import java.util.Collections; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -import org.apache.activemq.artemis.core.security.CheckType; -import org.apache.activemq.artemis.core.security.Role; -import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ; -import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager; - -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -public class ActiveMQEmbeddedBroker implements QuarkusTestResourceLifecycleManager { - - private final EmbeddedActiveMQ server = new EmbeddedActiveMQ(); - - public Map start() { - try { - server.setSecurityManager(new ActiveMQSecurityManager() { - @Override - public boolean validateUser(String user, String password) { - return true; - } - - @Override - public boolean validateUserAndRole(String user, String password, Set roles, CheckType checkType) { - return true; - } - }); - server.start(); - await().timeout(30, TimeUnit.SECONDS).until(() -> server.getActiveMQServer().isStarted()); - } catch (Exception e) { - throw new IllegalStateException("Unable to start embedded ActiveMQ broker.", e); - } - return Collections.emptyMap(); - } - - public void stop() { - try { - if (server != null) { - server.stop(); - } - } catch (Exception e) { - throw new IllegalStateException("Unable to stop embedded ActiveMQ broker.", e); - } - } - -} diff --git a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerIT.java b/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerIT.java deleted file mode 100644 index c24178241f..0000000000 --- a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerIT.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.acme.schooltimetabling; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import org.junit.jupiter.api.Disabled; - -@Disabled("The native test hangs after starting the native image and before entering the first test method.") -@QuarkusIntegrationTest -public class TimeTableMessagingHandlerIT extends TimeTableMessagingHandlerTest { - -} diff --git a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerTest.java b/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerTest.java deleted file mode 100644 index c25fd4e1dc..0000000000 --- a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerTest.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.acme.schooltimetabling; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.time.DayOfWeek; -import java.time.LocalTime; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import jakarta.jms.ConnectionFactory; -import jakarta.jms.Destination; -import jakarta.jms.JMSConsumer; -import jakarta.jms.JMSContext; -import jakarta.jms.JMSException; -import jakarta.jms.JMSProducer; -import jakarta.jms.Session; - -import ai.timefold.solver.jackson.api.TimefoldJacksonModule; -import org.acme.schooltimetabling.domain.Lesson; -import org.acme.schooltimetabling.domain.Room; -import org.acme.schooltimetabling.domain.TimeTable; -import org.acme.schooltimetabling.domain.Timeslot; -import org.acme.schooltimetabling.message.SolverRequest; -import org.acme.schooltimetabling.message.SolverResponse; -import org.acme.schooltimetabling.messaging.TimeTableMessagingHandler; -import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; - -@QuarkusTest -@QuarkusTestResource(ActiveMQEmbeddedBroker.class) -public class TimeTableMessagingHandlerTest { - - private static final long TEST_TIMEOUT_SECONDS = 60L; - private static final int MESSAGE_RECEIVE_TIMEOUT_SECONDS = 10; - - private ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616"); - - // Native test does not support @Inject. - private ObjectMapper objectMapper = new ObjectMapper() - .registerModule(new JavaTimeModule()) - .registerModule(TimefoldJacksonModule.createModule()); - - @Test - @Timeout(TEST_TIMEOUT_SECONDS) - void solve() { - long problemId = 1L; - TimeTable unsolvedTimeTable = createTestTimeTable(); - sendSolverRequest(new SolverRequest(problemId, unsolvedTimeTable)); - SolverResponse solverResponse = receiveSolverResponse(MESSAGE_RECEIVE_TIMEOUT_SECONDS); - - assertThat(SolverResponse.ResponseStatus.SUCCESS == solverResponse.getResponseStatus()); - assertThat(problemId == solverResponse.getProblemId()); - assertThat(solverResponse.getTimeTable().getLessonList()).hasSameSizeAs(unsolvedTimeTable.getLessonList()); - assertThat(solverResponse.getTimeTable().getScore().isFeasible()).isTrue(); - } - - @Test - @Timeout(TEST_TIMEOUT_SECONDS) - void solvingThrowsException() { - long problemId = 10L; - - // Timefold doesn't tolerate a null planningId. - TimeTable timeTableWithIncorrectLesson = new TimeTable( - Arrays.asList(new Timeslot(1L, DayOfWeek.MONDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(30))), - Arrays.asList(new Room(1L, "room-A")), - Arrays.asList(new Lesson(null, "Math", "A. Touring", "10th grade"))); - - sendSolverRequest(new SolverRequest(problemId, timeTableWithIncorrectLesson)); - - SolverResponse solverResponse = receiveSolverResponse(MESSAGE_RECEIVE_TIMEOUT_SECONDS); - assertThat(SolverResponse.ResponseStatus.FAILURE == solverResponse.getResponseStatus()); - assertThat(problemId == solverResponse.getProblemId()); - assertThat(solverResponse.getErrorInfo().getExceptionClassName()).isEqualTo(IllegalArgumentException.class.getName()); - assertThat(solverResponse.getErrorInfo().getExceptionMessage()).startsWith("The planningId (null)"); - } - - @Test - @Timeout(TEST_TIMEOUT_SECONDS) - void badRequest_DLQ() { - final String wrongMessage = "Bad request!"; - sendMessage(wrongMessage); - String messageFromDLQ = receiveMessage("DLQ", 10); - assertThat(messageFromDLQ).isEqualTo(wrongMessage); - } - - private SolverResponse receiveSolverResponse(int timeoutSeconds) { - String solverResponsePayload = receiveMessage(TimeTableMessagingHandler.SOLVER_RESPONSE_CHANNEL, timeoutSeconds); - try { - return objectMapper.readValue(solverResponsePayload, SolverResponse.class); - } catch (JsonProcessingException e) { - throw new RuntimeException(e); - } - - } - - private String receiveMessage(String queueName, int timeoutSeconds) { - try (JMSContext context = connectionFactory.createContext("quarkus", "quarkus", Session.AUTO_ACKNOWLEDGE)) { - JMSConsumer consumer = context.createConsumer(context.createQueue(queueName)); - jakarta.jms.Message message = consumer.receive(timeoutSeconds * 1_000); - return message.getBody(String.class); - } catch (JMSException e) { - throw new RuntimeException(e); - } - } - - private void sendSolverRequest(SolverRequest solverRequest) { - try { - String message = objectMapper.writeValueAsString(solverRequest); - sendMessage(message); - } catch (JsonProcessingException e) { - throw new RuntimeException(e); - } - } - - private void sendMessage(String message) { - try (JMSContext context = connectionFactory.createContext("quarkus", "quarkus", Session.AUTO_ACKNOWLEDGE)) { - JMSProducer producer = context.createProducer(); - Destination solverRequestQueue = context.createQueue(TimeTableMessagingHandler.SOLVER_REQUEST_CHANNEL); - producer.send(solverRequestQueue, message); - } - } - - private TimeTable createTestTimeTable() { - List rooms = Collections.singletonList(new Room(1L, "room-A")); - List timeslots = Arrays.asList( - new Timeslot(1L, DayOfWeek.MONDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(30)), - new Timeslot(2L, DayOfWeek.TUESDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(30)), - new Timeslot(3L, DayOfWeek.WEDNESDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(30))); - List lessons = Arrays.asList( - new Lesson(1L, "Math", "A. Touring", "10th grade"), - new Lesson(2L, "Biology", "C. Darwin", "11th grade"), - new Lesson(3L, "Physics", "M. Curie", "12th grade")); - return new TimeTable(timeslots, rooms, lessons); - } -} diff --git a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java b/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java deleted file mode 100644 index 4237440c4e..0000000000 --- a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.acme.schooltimetabling.solver; - -import java.time.DayOfWeek; -import java.time.LocalTime; - -import jakarta.inject.Inject; - -import org.acme.schooltimetabling.domain.Lesson; -import org.acme.schooltimetabling.domain.Room; -import org.acme.schooltimetabling.domain.TimeTable; -import org.acme.schooltimetabling.domain.Timeslot; -import org.junit.jupiter.api.Test; -import ai.timefold.solver.test.api.score.stream.ConstraintVerifier; - -import io.quarkus.test.junit.QuarkusTest; - -@QuarkusTest -class TimeTableConstraintProviderTest { - - private static final Room ROOM1 = new Room(1, "Room1"); - private static final Room ROOM2 = new Room(2, "Room2"); - private static final Timeslot TIMESLOT1 = new Timeslot(1, DayOfWeek.MONDAY, LocalTime.NOON); - private static final Timeslot TIMESLOT2 = new Timeslot(2, DayOfWeek.TUESDAY, LocalTime.NOON); - private static final Timeslot TIMESLOT3 = new Timeslot(3, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(1)); - private static final Timeslot TIMESLOT4 = new Timeslot(4, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(3)); - - @Inject - ConstraintVerifier constraintVerifier; - - @Test - void roomConflict() { - Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", "Group1", TIMESLOT1, ROOM1); - Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", "Group2", TIMESLOT1, ROOM1); - Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1); - constraintVerifier.verifyThat(TimeTableConstraintProvider::roomConflict) - .given(firstLesson, conflictingLesson, nonConflictingLesson) - .penalizesBy(1); - } - - @Test - void teacherConflict() { - String conflictingTeacher = "Teacher1"; - Lesson firstLesson = new Lesson(1, "Subject1", conflictingTeacher, "Group1", TIMESLOT1, ROOM1); - Lesson conflictingLesson = new Lesson(2, "Subject2", conflictingTeacher, "Group2", TIMESLOT1, ROOM2); - Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher2", "Group3", TIMESLOT2, ROOM1); - constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherConflict) - .given(firstLesson, conflictingLesson, nonConflictingLesson) - .penalizesBy(1); - } - - @Test - void studentGroupConflict() { - String conflictingGroup = "Group1"; - Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", conflictingGroup, TIMESLOT1, ROOM1); - Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", conflictingGroup, TIMESLOT1, ROOM2); - Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1); - constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupConflict) - .given(firstLesson, conflictingLesson, nonConflictingLesson) - .penalizesBy(1); - } - - @Test - void teacherRoomStability() { - String teacher = "Teacher1"; - Lesson lessonInFirstRoom = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1); - Lesson lessonInSameRoom = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT1, ROOM1); - Lesson lessonInDifferentRoom = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT1, ROOM2); - constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherRoomStability) - .given(lessonInFirstRoom, lessonInDifferentRoom, lessonInSameRoom) - .penalizesBy(2); - } - - @Test - void teacherTimeEfficiency() { - String teacher = "Teacher1"; - Lesson singleLessonOnMonday = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1); - Lesson firstTuesdayLesson = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT2, ROOM1); - Lesson secondTuesdayLesson = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT3, ROOM1); - Lesson thirdTuesdayLessonWithGap = new Lesson(4, "Subject4", teacher, "Group4", TIMESLOT4, ROOM1); - constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherTimeEfficiency) - .given(singleLessonOnMonday, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithGap) - .rewardsWith(1); // Second tuesday lesson immediately follows the first. - } - - @Test - void studentGroupSubjectVariety() { - String studentGroup = "Group1"; - String repeatedSubject = "Subject1"; - Lesson mondayLesson = new Lesson(1, repeatedSubject, "Teacher1", studentGroup, TIMESLOT1, ROOM1); - Lesson firstTuesdayLesson = new Lesson(2, repeatedSubject, "Teacher2", studentGroup, TIMESLOT2, ROOM1); - Lesson secondTuesdayLesson = new Lesson(3, repeatedSubject, "Teacher3", studentGroup, TIMESLOT3, ROOM1); - Lesson thirdTuesdayLessonWithDifferentSubject = new Lesson(4, "Subject2", "Teacher4", studentGroup, TIMESLOT4, ROOM1); - Lesson lessonInAnotherGroup = new Lesson(5, repeatedSubject, "Teacher5", "Group2", TIMESLOT1, ROOM1); - constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupSubjectVariety) - .given(mondayLesson, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithDifferentSubject, - lessonInAnotherGroup) - .penalizesBy(1); // Second tuesday lesson immediately follows the first. - } - -} diff --git a/technology/java-activemq-quarkus/solver/src/test/resources/application.properties b/technology/java-activemq-quarkus/solver/src/test/resources/application.properties deleted file mode 100644 index a84db92220..0000000000 --- a/technology/java-activemq-quarkus/solver/src/test/resources/application.properties +++ /dev/null @@ -1,21 +0,0 @@ -######################## -# Timefold properties -######################## - -%test.quarkus.timefold.solver.termination.spent-limit=1h -%test.quarkus.timefold.solver.termination.best-score-limit=0hard/*soft - -######################## -# Messaging -######################## - -quarkus.artemis.url=tcp://localhost:61616 - -# Configure the ActiveMQ source (we read from it) -mp.messaging.incoming.solver_request.connector=smallrye-amqp -mp.messaging.incoming.solver_request.durable=true -mp.messaging.incoming.solver_request.failure-strategy=reject - -# Configure the ActiveMQ sink (we write to it) -mp.messaging.outgoing.solver_response.connector=smallrye-amqp -mp.messaging.outgoing.solver_response.durable=true \ No newline at end of file diff --git a/technology/java-activemq-quarkus/solver/src/test/resources/broker.xml b/technology/java-activemq-quarkus/solver/src/test/resources/broker.xml deleted file mode 100644 index 034d080bb6..0000000000 --- a/technology/java-activemq-quarkus/solver/src/test/resources/broker.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - 0.0.0.0 - - false - NIO - target/data/paging - target/data/bindings - target/data/journal - target/data/large-messages - true - 2 - 10 - 4096 - 10M - 48000 - 1 - - 5000 - 99 - false - 120000 - 60000 - HALT - 48000 - - - - tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true - - - tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true - - - - - - - - - - - - - - - - - - - - - - DLQ - ExpiryQueue - 0 - - -1 - 10 - PAGE - true - true - true - true - - - - DLQ - ExpiryQueue - 0 - - -1 - 10 - PAGE - true - true - true - true - - - - -
- - - -
-
- - - -
-
- - - true - - -
-
- - - true - - -
- -
-
-
diff --git a/technology/java-spring-boot/.gitignore b/technology/java-spring-boot/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/technology/java-spring-boot/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/technology/java-spring-boot/build.gradle b/technology/java-spring-boot/build.gradle index 30ccaa51ea..e9fa441206 100644 --- a/technology/java-spring-boot/build.gradle +++ b/technology/java-spring-boot/build.gradle @@ -4,7 +4,7 @@ plugins { id "java" } -def timefoldVersion = "1.0.0" +def timefoldVersion = "1.1.0" def assertjVersion = "3.24.2" group = "org.acme" diff --git a/technology/java-spring-boot/pom.xml b/technology/java-spring-boot/pom.xml index e73f2a62cf..fcbe1e4c52 100644 --- a/technology/java-spring-boot/pom.xml +++ b/technology/java-spring-boot/pom.xml @@ -11,11 +11,11 @@ 17 UTF-8 - 1.0.0 - 3.0.6 + 1.1.0 + 3.1.2 3.11.0 - 3.1.0 + 3.1.2 @@ -91,7 +91,7 @@ org.webjars webjars-locator - 0.37 + 0.47 runtime diff --git a/technology/kotlin-quarkus/.gitignore b/technology/kotlin-quarkus/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/technology/kotlin-quarkus/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/technology/kotlin-quarkus/pom.xml b/technology/kotlin-quarkus/pom.xml index 907f1fd25f..2b18483760 100644 --- a/technology/kotlin-quarkus/pom.xml +++ b/technology/kotlin-quarkus/pom.xml @@ -11,12 +11,12 @@ 17 UTF-8 - 3.0.3.Final - 1.8.20 - 1.0.0 + 3.2.4.Final + 1.9.0 + 1.1.0 3.11.0 - 3.1.0 + 3.1.2 diff --git a/use-cases/call-center/.gitignore b/use-cases/call-center/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/call-center/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/call-center/pom.xml b/use-cases/call-center/pom.xml index 85a262200d..838172cab2 100644 --- a/use-cases/call-center/pom.xml +++ b/use-cases/call-center/pom.xml @@ -11,11 +11,11 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 - 3.1.0 + 3.1.2 diff --git a/use-cases/employee-scheduling/.gitignore b/use-cases/employee-scheduling/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/employee-scheduling/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/employee-scheduling/pom.xml b/use-cases/employee-scheduling/pom.xml index 20216a7a56..6096c7018f 100644 --- a/use-cases/employee-scheduling/pom.xml +++ b/use-cases/employee-scheduling/pom.xml @@ -11,11 +11,11 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 - 3.1.0 + 3.1.2 diff --git a/use-cases/facility-location/.gitignore b/use-cases/facility-location/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/facility-location/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/facility-location/pom.xml b/use-cases/facility-location/pom.xml index 1467e28bf7..525af9d4ab 100644 --- a/use-cases/facility-location/pom.xml +++ b/use-cases/facility-location/pom.xml @@ -11,11 +11,11 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 - 3.1.0 + 3.1.2 diff --git a/use-cases/food-packaging/.gitignore b/use-cases/food-packaging/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/food-packaging/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/food-packaging/pom.xml b/use-cases/food-packaging/pom.xml index da52b7ed52..53ee580a2e 100644 --- a/use-cases/food-packaging/pom.xml +++ b/use-cases/food-packaging/pom.xml @@ -11,11 +11,11 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 - 3.1.0 + 3.1.2 diff --git a/use-cases/maintenance-scheduling/.gitignore b/use-cases/maintenance-scheduling/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/maintenance-scheduling/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/maintenance-scheduling/pom.xml b/use-cases/maintenance-scheduling/pom.xml index f2549de204..d316f314be 100644 --- a/use-cases/maintenance-scheduling/pom.xml +++ b/use-cases/maintenance-scheduling/pom.xml @@ -11,11 +11,11 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 - 3.1.0 + 3.1.2 diff --git a/use-cases/order-picking/.gitignore b/use-cases/order-picking/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/order-picking/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/order-picking/pom.xml b/use-cases/order-picking/pom.xml index 61bfa66739..c91586be84 100644 --- a/use-cases/order-picking/pom.xml +++ b/use-cases/order-picking/pom.xml @@ -11,11 +11,11 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 - 3.1.0 + 3.1.2 diff --git a/use-cases/school-timetabling/.gitignore b/use-cases/school-timetabling/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/school-timetabling/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/school-timetabling/build.gradle b/use-cases/school-timetabling/build.gradle index 9a09085bee..0e2ddcc9c1 100644 --- a/use-cases/school-timetabling/build.gradle +++ b/use-cases/school-timetabling/build.gradle @@ -4,7 +4,7 @@ plugins { } def quarkusVersion = "3.0.3.Final" -def timefoldVersion = "1.0.0" +def timefoldVersion = "1.1.0" def assertjVersion = "3.24.2" group = "org.acme" diff --git a/use-cases/school-timetabling/pom.xml b/use-cases/school-timetabling/pom.xml index 1dbc509cec..56bf6832ff 100644 --- a/use-cases/school-timetabling/pom.xml +++ b/use-cases/school-timetabling/pom.xml @@ -11,12 +11,12 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 3.3.1 - 3.1.0 + 3.1.2 diff --git a/use-cases/vaccination-scheduling/.gitignore b/use-cases/vaccination-scheduling/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/vaccination-scheduling/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/vaccination-scheduling/pom.xml b/use-cases/vaccination-scheduling/pom.xml index 8d2b5ba89c..cee5d7d4d2 100644 --- a/use-cases/vaccination-scheduling/pom.xml +++ b/use-cases/vaccination-scheduling/pom.xml @@ -11,11 +11,11 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 - 3.1.0 + 3.1.2 @@ -59,7 +59,7 @@ org.apache.commons commons-lang3 - 3.12.0 + 3.13.0 diff --git a/use-cases/vehicle-routing-capacity/.gitignore b/use-cases/vehicle-routing-capacity/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/vehicle-routing-capacity/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/vehicle-routing-capacity/pom.xml b/use-cases/vehicle-routing-capacity/pom.xml index 60647e3ffe..6f4e058e4c 100644 --- a/use-cases/vehicle-routing-capacity/pom.xml +++ b/use-cases/vehicle-routing-capacity/pom.xml @@ -11,12 +11,12 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 3.3.1 - 3.1.0 + 3.1.2 diff --git a/use-cases/vehicle-routing-time-windows/.gitignore b/use-cases/vehicle-routing-time-windows/.gitignore deleted file mode 100644 index 0fc97d47a4..0000000000 --- a/use-cases/vehicle-routing-time-windows/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/target -/build -/local - -# Eclipse, Netbeans and IntelliJ files -/.* -!.gitignore -!.mvn -/nbproject -/*.ipr -/*.iws -/*.iml diff --git a/use-cases/vehicle-routing-time-windows/pom.xml b/use-cases/vehicle-routing-time-windows/pom.xml index c6baa1f8c0..c07f36c242 100644 --- a/use-cases/vehicle-routing-time-windows/pom.xml +++ b/use-cases/vehicle-routing-time-windows/pom.xml @@ -11,12 +11,12 @@ 17 UTF-8 - 3.0.3.Final - 1.0.0 + 3.2.4.Final + 1.1.0 3.11.0 3.3.1 - 3.1.0 + 3.1.2