From b23b964ae96b8678fef74adbb20cc89293434587 Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Wed, 2 Jun 2021 22:00:24 +0200 Subject: [PATCH] Sort resources and load values correctly --- .../theodolite/execution/TheodoliteExecutor.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt index d38b50b70..c73aaae08 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt @@ -68,6 +68,18 @@ class TheodoliteExecutor( afterTeardownDelay = config.execution.afterTeardownDelay ) + if (config.load.loadValues != config.load.loadValues.sorted()) { + config.load.loadValues = config.load.loadValues.sorted() + logger.info { "Load values are not sorted correctly, Theodolite sorts them in ascending order." + + "New order is: ${config.load.loadValues}" } + } + + if (config.resources.resourceValues != config.resources.resourceValues.sorted()) { + config.resources.resourceValues = config.resources.resourceValues.sorted() + logger.info { "Load values are not sorted correctly, Theodolite sorts them in ascending order." + + "New order is: ${config.resources.resourceValues}" } + } + return Config( loads = config.load.loadValues.map { load -> LoadDimension(load, loadDimensionPatcherDefinition) }, resources = config.resources.resourceValues.map { resource -> -- GitLab