From ad1a4509c8abbf05aed3277f56f5b9e6bf08a825 Mon Sep 17 00:00:00 2001 From: leonbein Date: Wed, 21 Aug 2024 17:40:03 +0200 Subject: [PATCH] Rename package and artifact --- pom.xml | 4 ++-- .../plugin/sopa}/AbstractCostDriver.java | 2 +- .../plugin/sopa}/ConcreteCostDriver.java | 2 +- .../insm/scylla/plugin/sopa}/CostDriver.java | 2 +- .../CostDriverExecutionLoggingPlugin.java | 2 +- .../sopa}/CostDriverGCParserPlugin.java | 2 +- .../plugin/sopa}/CostDriverPluginUtils.java | 2 +- .../sopa}/CostDriverSCParserPlugin.java | 2 +- .../insm/scylla/plugin/sopa}/CostVariant.java | 2 +- .../sopa}/CostVariantConfiguration.java | 2 +- .../tum/insm/scylla/plugin/sopa}/Main.java | 2 +- .../sopa}/ExecutionLoggingPluginTest.java | 24 +++++++++---------- .../scylla/plugin/sopa}/GCParserTest.java | 11 ++++----- .../scylla/plugin/sopa}/SCParserTest.java | 17 +++++++------ .../scylla/plugin/sopa}/ScyllaScripts.java | 12 ++++------ .../tum/insm/scylla/plugin/sopa}/Utils.java | 3 +-- 16 files changed, 42 insertions(+), 49 deletions(-) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/AbstractCostDriver.java (97%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/ConcreteCostDriver.java (97%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/CostDriver.java (94%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/CostDriverExecutionLoggingPlugin.java (99%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/CostDriverGCParserPlugin.java (98%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/CostDriverPluginUtils.java (69%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/CostDriverSCParserPlugin.java (98%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/CostVariant.java (94%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/CostVariantConfiguration.java (98%) rename src/main/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/Main.java (88%) rename src/test/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/ExecutionLoggingPluginTest.java (82%) rename src/test/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/GCParserTest.java (87%) rename src/test/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/SCParserTest.java (88%) rename src/test/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/ScyllaScripts.java (88%) rename src/test/java/{cost_driver => de/tum/insm/scylla/plugin/sopa}/Utils.java (97%) diff --git a/pom.xml b/pom.xml index cf1f391..bb6f5a8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,8 +5,8 @@ 4.0.0 - de.hpi.bpt - cost_driver + de.tum.insm.scylla.plugin + sopa 0.1.2-SNAPSHOT jar diff --git a/src/main/java/cost_driver/AbstractCostDriver.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/AbstractCostDriver.java similarity index 97% rename from src/main/java/cost_driver/AbstractCostDriver.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/AbstractCostDriver.java index 2875ab4..3d5ca57 100644 --- a/src/main/java/cost_driver/AbstractCostDriver.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/AbstractCostDriver.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import org.springframework.lang.NonNull; diff --git a/src/main/java/cost_driver/ConcreteCostDriver.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/ConcreteCostDriver.java similarity index 97% rename from src/main/java/cost_driver/ConcreteCostDriver.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/ConcreteCostDriver.java index 7094cd0..ce23908 100644 --- a/src/main/java/cost_driver/ConcreteCostDriver.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/ConcreteCostDriver.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.exception.ScyllaValidationException; import org.springframework.lang.NonNull; diff --git a/src/main/java/cost_driver/CostDriver.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriver.java similarity index 94% rename from src/main/java/cost_driver/CostDriver.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriver.java index 0a9ef8f..679392f 100644 --- a/src/main/java/cost_driver/CostDriver.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriver.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import org.springframework.lang.NonNull; diff --git a/src/main/java/cost_driver/CostDriverExecutionLoggingPlugin.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverExecutionLoggingPlugin.java similarity index 99% rename from src/main/java/cost_driver/CostDriverExecutionLoggingPlugin.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverExecutionLoggingPlugin.java index 821d2fd..a546610 100644 --- a/src/main/java/cost_driver/CostDriverExecutionLoggingPlugin.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverExecutionLoggingPlugin.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.logger.ProcessNodeInfo; import de.hpi.bpt.scylla.logger.ProcessNodeTransitionType; diff --git a/src/main/java/cost_driver/CostDriverGCParserPlugin.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverGCParserPlugin.java similarity index 98% rename from src/main/java/cost_driver/CostDriverGCParserPlugin.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverGCParserPlugin.java index b107f8c..2bad7a5 100644 --- a/src/main/java/cost_driver/CostDriverGCParserPlugin.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverGCParserPlugin.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.exception.ScyllaValidationException; import de.hpi.bpt.scylla.model.global.GlobalConfiguration; diff --git a/src/main/java/cost_driver/CostDriverPluginUtils.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverPluginUtils.java similarity index 69% rename from src/main/java/cost_driver/CostDriverPluginUtils.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverPluginUtils.java index d48a83a..dbe606d 100644 --- a/src/main/java/cost_driver/CostDriverPluginUtils.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverPluginUtils.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; public class CostDriverPluginUtils { static final String PLUGIN_NAME = "cost_driver"; diff --git a/src/main/java/cost_driver/CostDriverSCParserPlugin.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverSCParserPlugin.java similarity index 98% rename from src/main/java/cost_driver/CostDriverSCParserPlugin.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverSCParserPlugin.java index 19aa877..21187e7 100644 --- a/src/main/java/cost_driver/CostDriverSCParserPlugin.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostDriverSCParserPlugin.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import java.util.*; diff --git a/src/main/java/cost_driver/CostVariant.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostVariant.java similarity index 94% rename from src/main/java/cost_driver/CostVariant.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/CostVariant.java index 9cd4b72..1e56f0d 100644 --- a/src/main/java/cost_driver/CostVariant.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostVariant.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import org.springframework.lang.NonNull; diff --git a/src/main/java/cost_driver/CostVariantConfiguration.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostVariantConfiguration.java similarity index 98% rename from src/main/java/cost_driver/CostVariantConfiguration.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/CostVariantConfiguration.java index 328eb1b..7dbd31e 100644 --- a/src/main/java/cost_driver/CostVariantConfiguration.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/CostVariantConfiguration.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.exception.ScyllaValidationException; import org.springframework.lang.NonNull; diff --git a/src/main/java/cost_driver/Main.java b/src/main/java/de/tum/insm/scylla/plugin/sopa/Main.java similarity index 88% rename from src/main/java/cost_driver/Main.java rename to src/main/java/de/tum/insm/scylla/plugin/sopa/Main.java index 07ae50b..4528705 100644 --- a/src/main/java/cost_driver/Main.java +++ b/src/main/java/de/tum/insm/scylla/plugin/sopa/Main.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.Scylla; import de.hpi.bpt.scylla.plugin_loader.PluginLoader; diff --git a/src/test/java/cost_driver/ExecutionLoggingPluginTest.java b/src/test/java/de/tum/insm/scylla/plugin/sopa/ExecutionLoggingPluginTest.java similarity index 82% rename from src/test/java/cost_driver/ExecutionLoggingPluginTest.java rename to src/test/java/de/tum/insm/scylla/plugin/sopa/ExecutionLoggingPluginTest.java index 2ef2bd4..6bacf78 100644 --- a/src/test/java/cost_driver/ExecutionLoggingPluginTest.java +++ b/src/test/java/de/tum/insm/scylla/plugin/sopa/ExecutionLoggingPluginTest.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.SimulationTest; import de.hpi.bpt.scylla.plugin_loader.PluginLoader; @@ -11,9 +11,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.*; -import static cost_driver.Utils.*; import static de.hpi.bpt.scylla.Scylla.normalizePath; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @@ -28,22 +26,22 @@ void testWriteToLog() throws IOException { PluginLoader.getDefaultPluginLoader().activateNone().loadPackage(Main.class.getPackageName()); setGlobalSeed(-7870005462812540457L); runSimpleSimulation( - GLOBAL_CONFIGURATION_FILE, - SIMULATION_MODEL_FILE, - SIMULATION_CONFIGURATION_FILE); + Utils.GLOBAL_CONFIGURATION_FILE, + Utils.SIMULATION_MODEL_FILE, + Utils.SIMULATION_CONFIGURATION_FILE); String expectedFileNameXML = normalizePath("./" + outputPath + "sustainability_global_information_statistic.xml"); - String expectedFileNameXES = normalizePath("./" + outputPath + SIMULATION_MODEL_FILE); + String expectedFileNameXES = normalizePath("./" + outputPath + Utils.SIMULATION_MODEL_FILE); Path filePathXML = Paths.get(expectedFileNameXML); Path filePathXES = Paths.get(expectedFileNameXES.substring(0, expectedFileNameXES.lastIndexOf('.')).concat(".xes")); // Read the content of both XML files as strings String actualXML = new String(Files.readAllBytes(filePathXML)); - String expectedXML = new String(Files.readAllBytes(Paths.get(normalizePath("./" + TEST_PATH + "/cost_driver_output/" + "sustainability_global_information_statistic.xml")))); + String expectedXML = new String(Files.readAllBytes(Paths.get(normalizePath("./" + Utils.TEST_PATH + "/cost_driver_output/" + "sustainability_global_information_statistic.xml")))); // Read the content of both XES files as strings String actualXES = new String(Files.readAllBytes(filePathXES)); - String expectedXES = new String(Files.readAllBytes(Paths.get(normalizePath("./" + TEST_PATH + "/cost_driver_output/" + "logistics_model_no_drivers.xes")))); + String expectedXES = new String(Files.readAllBytes(Paths.get(normalizePath("./" + Utils.TEST_PATH + "/cost_driver_output/" + "logistics_model_no_drivers.xes")))); // Compare the XML files Diff diffXML = DiffBuilder.compare(expectedXML).withTest(actualXML) @@ -73,13 +71,13 @@ void testCorrectFileExtensionXES() throws IOException { PluginLoader.getDefaultPluginLoader().activateNone().loadPackage(Main.class.getPackageName()); runSimpleSimulation( - GLOBAL_CONFIGURATION_FILE, - SIMULATION_MODEL_FILE, - SIMULATION_CONFIGURATION_FILE); + Utils.GLOBAL_CONFIGURATION_FILE, + Utils.SIMULATION_MODEL_FILE, + Utils.SIMULATION_CONFIGURATION_FILE); // By default is false EXECUTION_LOGGING_PLUGIN.gzipOn = false; - String expectedFileName = normalizePath("./" + outputPath + SIMULATION_MODEL_FILE); + String expectedFileName = normalizePath("./" + outputPath + Utils.SIMULATION_MODEL_FILE); Path filePath = Paths.get(expectedFileName.substring(0, expectedFileName.lastIndexOf('.')).concat(".xes")); assertTrue(Files.exists(filePath), "XES File does not exist: " + filePath); assertTrue(filePath.toString().endsWith(".xes"), "File extension is not .xes: " + filePath); diff --git a/src/test/java/cost_driver/GCParserTest.java b/src/test/java/de/tum/insm/scylla/plugin/sopa/GCParserTest.java similarity index 87% rename from src/test/java/cost_driver/GCParserTest.java rename to src/test/java/de/tum/insm/scylla/plugin/sopa/GCParserTest.java index 598efc2..a6842d9 100644 --- a/src/test/java/cost_driver/GCParserTest.java +++ b/src/test/java/de/tum/insm/scylla/plugin/sopa/GCParserTest.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.SimulationTest; import de.hpi.bpt.scylla.exception.ScyllaValidationException; @@ -12,7 +12,6 @@ import java.util.ArrayList; import java.util.List; -import static cost_driver.Utils.*; import static org.junit.jupiter.api.Assertions.fail; //@SuppressWarnings("unchecked") @@ -24,9 +23,9 @@ void testParse_GC() throws IOException, ScyllaValidationException, JDOMException PluginLoader.getDefaultPluginLoader().activateNone().loadPackage(Main.class.getPackageName()); runSimpleSimulation( - GLOBAL_CONFIGURATION_FILE, - SIMULATION_MODEL_FILE, - SIMULATION_CONFIGURATION_FILE); + Utils.GLOBAL_CONFIGURATION_FILE, + Utils.SIMULATION_MODEL_FILE, + Utils.SIMULATION_CONFIGURATION_FILE); // Integrate the ACDs Object obj = getGlobalConfiguration().getExtensionAttributes().get("cost_driver_costDrivers"); @@ -34,7 +33,7 @@ void testParse_GC() throws IOException, ScyllaValidationException, JDOMException if (obj instanceof ArrayList list) { if (list.stream().allMatch(element -> element instanceof AbstractCostDriver)) { List abstractCostDriverList = (ArrayList) list; - var expected = parseGC(); + var expected = Utils.parseGC(); for (int i = 0; i < abstractCostDriverList.size(); i++) { if (!abstractCostDriverList.get(i).equals(expected.get(i))) { fail("\nWrongly parsed ACD: " + diff --git a/src/test/java/cost_driver/SCParserTest.java b/src/test/java/de/tum/insm/scylla/plugin/sopa/SCParserTest.java similarity index 88% rename from src/test/java/cost_driver/SCParserTest.java rename to src/test/java/de/tum/insm/scylla/plugin/sopa/SCParserTest.java index 8e72b83..e38f77d 100644 --- a/src/test/java/cost_driver/SCParserTest.java +++ b/src/test/java/de/tum/insm/scylla/plugin/sopa/SCParserTest.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.SimulationTest; import de.hpi.bpt.scylla.exception.ScyllaValidationException; @@ -11,7 +11,6 @@ import java.io.IOException; import java.util.*; -import static cost_driver.Utils.*; import static org.junit.jupiter.api.Assertions.assertEquals; class SCParserTest extends SimulationTest { @@ -24,9 +23,9 @@ void testParsingActivityCostDrivers() throws IOException, ScyllaValidationExcept PluginLoader.getDefaultPluginLoader().activateNone().loadPackage(Main.class.getPackageName()); runSimpleSimulation( - GLOBAL_CONFIGURATION_FILE, - SIMULATION_MODEL_FILE, - SIMULATION_CONFIGURATION_FILE); + Utils.GLOBAL_CONFIGURATION_FILE, + Utils.SIMULATION_MODEL_FILE, + Utils.SIMULATION_CONFIGURATION_FILE); //TODO insert proper fixture Map identifiersToNodeIds = simulationManager.getProcessModels().get("Process_0vv8a1n").getIdentifiersToNodeIds(); @@ -51,7 +50,7 @@ void testParsingActivityCostDrivers() throws IOException, ScyllaValidationExcept void testParsingVariants() throws IOException, ScyllaValidationException, JDOMException { PluginLoader.getDefaultPluginLoader().activateNone().loadPackage(Main.class.getPackageName()); - setGlobalSeed(DEFAULT_SEED); + setGlobalSeed(Utils.DEFAULT_SEED); afterParsing(() -> { //Needs to be run directly after parsing, as stack of calculated variants is consumed during simulation SimulationConfiguration actualSimConfig = getSimulationConfiguration(); @@ -69,9 +68,9 @@ void testParsingVariants() throws IOException, ScyllaValidationException, JDOMEx }); runSimpleSimulation( - GLOBAL_CONFIGURATION_FILE, - SIMULATION_MODEL_FILE, - SIMULATION_CONFIGURATION_FILE); + Utils.GLOBAL_CONFIGURATION_FILE, + Utils.SIMULATION_MODEL_FILE, + Utils.SIMULATION_CONFIGURATION_FILE); } @Override diff --git a/src/test/java/cost_driver/ScyllaScripts.java b/src/test/java/de/tum/insm/scylla/plugin/sopa/ScyllaScripts.java similarity index 88% rename from src/test/java/cost_driver/ScyllaScripts.java rename to src/test/java/de/tum/insm/scylla/plugin/sopa/ScyllaScripts.java index 3d923fc..18bc643 100644 --- a/src/test/java/cost_driver/ScyllaScripts.java +++ b/src/test/java/de/tum/insm/scylla/plugin/sopa/ScyllaScripts.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.SimulationManager; import de.hpi.bpt.scylla.plugin_loader.PluginLoader; @@ -18,8 +18,6 @@ import java.util.List; import java.util.Objects; -import static cost_driver.Utils.*; - /** * This class contains various useful scripts for the programmatic usage of scylla.
* These are results from previous usages of the system @@ -41,9 +39,9 @@ public static void runMoockModels() throws IOException { int[] clerkCountsToTest = new int[]{4}; int numInstances = 10; - String globalConf = TEST_PATH + GLOBAL_CONFIGURATION_FILE; - String model = TEST_PATH + SIMULATION_MODEL_FILE; - String simConf = TEST_PATH + SIMULATION_CONFIGURATION_FILE; + String globalConf = Utils.TEST_PATH + Utils.GLOBAL_CONFIGURATION_FILE; + String model = Utils.TEST_PATH + Utils.SIMULATION_MODEL_FILE; + String simConf = Utils.TEST_PATH + Utils.SIMULATION_CONFIGURATION_FILE; try { SAXBuilder builder = new SAXBuilder(); @@ -83,7 +81,7 @@ public static void runMoockModels() throws IOException { globalConf, model, simConf, - TEST_PATH + numClerks + "_" + numInstances + "_" + new SimpleDateFormat("yy_MM_dd_HH_mm_ss_SSS").format(new Date()) + "/"); + Utils.TEST_PATH + numClerks + "_" + numInstances + "_" + new SimpleDateFormat("yy_MM_dd_HH_mm_ss_SSS").format(new Date()) + "/"); } } diff --git a/src/test/java/cost_driver/Utils.java b/src/test/java/de/tum/insm/scylla/plugin/sopa/Utils.java similarity index 97% rename from src/test/java/cost_driver/Utils.java rename to src/test/java/de/tum/insm/scylla/plugin/sopa/Utils.java index 0764dba..5527d67 100644 --- a/src/test/java/cost_driver/Utils.java +++ b/src/test/java/de/tum/insm/scylla/plugin/sopa/Utils.java @@ -1,4 +1,4 @@ -package cost_driver; +package de.tum.insm.scylla.plugin.sopa; import de.hpi.bpt.scylla.exception.ScyllaValidationException; import org.jdom2.Document; @@ -8,7 +8,6 @@ import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map;