From ffeb6ed1e433acdbb948b41b147918f5d1d656d2 Mon Sep 17 00:00:00 2001 From: Ralf Sieger Date: Fri, 27 Sep 2024 17:22:41 +0200 Subject: [PATCH 1/2] removed xtext settings and failing tests --- pom.xml | 1 + .../.classpath | 1 - .../.project | 6 -- .../META-INF/MANIFEST.MF | 6 +- .../build.properties | 1 - .../tests/BaseMediaStoreSimulationTest.java | 47 -------------- .../simulation/tests/EventExtensionTest.java | 51 --------------- .../tests/LinkingResourceSimulationTest.java | 63 ------------------- .../simulation/tests/SubsystemTest.java | 61 ------------------ 9 files changed, 2 insertions(+), 235 deletions(-) delete mode 100644 tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/BaseMediaStoreSimulationTest.java delete mode 100644 tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/EventExtensionTest.java delete mode 100644 tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/LinkingResourceSimulationTest.java delete mode 100644 tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/SubsystemTest.java diff --git a/pom.xml b/pom.xml index a42ba9f4..42a1a3d5 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ bundles + tests features releng diff --git a/tests/org.palladiosimulator.simulizar.tests/.classpath b/tests/org.palladiosimulator.simulizar.tests/.classpath index 9099bea1..7359b62f 100644 --- a/tests/org.palladiosimulator.simulizar.tests/.classpath +++ b/tests/org.palladiosimulator.simulizar.tests/.classpath @@ -7,7 +7,6 @@ - diff --git a/tests/org.palladiosimulator.simulizar.tests/.project b/tests/org.palladiosimulator.simulizar.tests/.project index 04cf5fc6..b2d79d4d 100644 --- a/tests/org.palladiosimulator.simulizar.tests/.project +++ b/tests/org.palladiosimulator.simulizar.tests/.project @@ -5,11 +5,6 @@ - - org.eclipse.xtext.ui.shared.xtextBuilder - - - org.eclipse.jdt.core.javabuilder @@ -29,6 +24,5 @@ org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature diff --git a/tests/org.palladiosimulator.simulizar.tests/META-INF/MANIFEST.MF b/tests/org.palladiosimulator.simulizar.tests/META-INF/MANIFEST.MF index 83aa0241..84085a2e 100644 --- a/tests/org.palladiosimulator.simulizar.tests/META-INF/MANIFEST.MF +++ b/tests/org.palladiosimulator.simulizar.tests/META-INF/MANIFEST.MF @@ -6,10 +6,7 @@ Bundle-Version: 5.2.0.qualifier Bundle-Vendor: palladiosimulator.org Bundle-RequiredExecutionEnvironment: JavaSE-17 Fragment-Host: org.palladiosimulator.simulizar -Require-Bundle: org.eclipse.xtext.xbase.lib, - org.eclipse.xtend.lib, - org.eclipse.xtend.lib.macro, - org.palladiosimulator.simulizar.reconfiguration.qvto;bundle-version="5.1.0", +Require-Bundle: org.palladiosimulator.simulizar.reconfiguration.qvto;bundle-version="5.1.0", org.palladiosimulator.edp2.repository.local;bundle-version="4.3.0", org.palladiosimulator.pcm.resources;bundle-version="4.3.0", de.uka.ipd.sdq.simulation.abstractsimengine.desmoj;bundle-version="4.3.0", @@ -17,7 +14,6 @@ Require-Bundle: org.eclipse.xtext.xbase.lib, tools.mdsd.library.standalone.initialization;bundle-version="0.1.0", de.desmoj;bundle-version="2.3.3", tools.mdsd.junit5utils;bundle-version="0.1.0", - org.palladiosimulator.examples.package;bundle-version="4.3.0", org.palladiosimulator.simulizar.test.commons;bundle-version="5.1.0", org.palladiosimulator.simulizar.events, org.palladiosimulator.simulizar.monitorrepository.feedthrough;bundle-version="5.1.0" diff --git a/tests/org.palladiosimulator.simulizar.tests/build.properties b/tests/org.palladiosimulator.simulizar.tests/build.properties index c867a950..6dafdff7 100644 --- a/tests/org.palladiosimulator.simulizar.tests/build.properties +++ b/tests/org.palladiosimulator.simulizar.tests/build.properties @@ -1,5 +1,4 @@ source.. = src/,\ - xtend-gen/,\ src-gen/ output.. = bin/ bin.includes = META-INF/,\ diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/BaseMediaStoreSimulationTest.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/BaseMediaStoreSimulationTest.java deleted file mode 100644 index 1267ef40..00000000 --- a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/BaseMediaStoreSimulationTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.palladiosimulator.simulizar.simulation.tests; - -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.palladiosimulator.simulizar.test.commons.hamcrest.Matchers.*; -import static org.palladiosimulator.simulizar.test.commons.util.MeasurementTestUtils.allMeasurementsOfMetric; - -import javax.measure.unit.SI; - -import org.junit.jupiter.api.Test; -import org.palladiosimulator.edp2.models.ExperimentData.ExperimentRun; -import org.palladiosimulator.metricspec.constants.MetricDescriptionConstants; -import org.palladiosimulator.pcm.usagemodel.UsageScenario; -import org.palladiosimulator.simulizar.test.commons.annotation.LoadPCMInstanceFromBundle; -import org.palladiosimulator.simulizar.test.commons.annotation.RunSimuLizar; -import org.palladiosimulator.simulizar.test.commons.annotation.SimulationConfig; -import org.palladiosimulator.simulizar.test.commons.util.MeasurementTestUtils; - -import de.uka.ipd.sdq.workflow.jobs.JobFailedException; -import de.uka.ipd.sdq.workflow.jobs.UserCanceledException; -import tools.mdsd.junit5utils.annotations.PluginTestOnly; - -@PluginTestOnly -class BaseMediaStoreSimulationTest { - - /** - * Tests simulation of case: https://palladio-simulator.atlassian.net/browse/SIMULIZAR-110 - * Tests fix of https://palladio-simulator.atlassian.net/browse/SIMULIZAR-166 - */ - @Test - @LoadPCMInstanceFromBundle(bundleName = "org.palladiosimulator.examples.package", basePath = "initiatorTemplates/MediaStore3_Model", modelFiles = { - "ms_cache.allocation", "ms_cache_usage_all.usagemodel" }) - @SimulationConfig(maxMeasurements = "1000", simulateReliability = false) - @RunSimuLizar - void testMSCacheAll1k(UsageScenario scenario, ExperimentRun expRun) - throws JobFailedException, UserCanceledException { - var measurement = MeasurementTestUtils.getMeasurementOfAt(expRun.getMeasurement(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC_TUPLE, scenario); - assertTrue(measurement.isPresent()); - - assertThat(allMeasurementsOfMetric(measurement.get(), MetricDescriptionConstants.RESPONSE_TIME_METRIC), - match(withProbability(lessThan(0.1), asDoubleIn(SI.SECOND, is(anyOf(lessThan(14000.0), greaterThan(32000.0))))), - withProbability(closeTo(1.0, 0.1), asDoubleIn(SI.SECOND, is(both(greaterThan(14000.0)).and(lessThan(32000.0))))))); - } - -} diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/EventExtensionTest.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/EventExtensionTest.java deleted file mode 100644 index 9f5db3d0..00000000 --- a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/EventExtensionTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.palladiosimulator.simulizar.simulation.tests; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.palladiosimulator.simulizar.test.commons.hamcrest.Matchers.*; -import static org.palladiosimulator.simulizar.test.commons.util.MeasurementTestUtils.*; - -import javax.measure.unit.SI; -import org.junit.jupiter.api.Test; -import org.palladiosimulator.analyzer.workflow.ConstantsContainer; -import org.palladiosimulator.edp2.models.ExperimentData.ExperimentRun; -import org.palladiosimulator.metricspec.constants.MetricDescriptionConstants; -import org.palladiosimulator.pcm.usagemodel.UsageScenario; -import org.palladiosimulator.simulizar.events.DaggerEventExtensionComponent; -import org.palladiosimulator.simulizar.events.EventsTransformationConfiguration; -import org.palladiosimulator.simulizar.test.commons.annotation.LoadPCMInstanceFromBundle; -import org.palladiosimulator.simulizar.test.commons.annotation.RunSimuLizar; -import org.palladiosimulator.simulizar.test.commons.annotation.SetConfigProperty; -import org.palladiosimulator.simulizar.test.commons.annotation.SimulationConfig; -import org.palladiosimulator.simulizar.test.commons.annotation.UseSimuLizarExtension; - -import de.uka.ipd.sdq.workflow.jobs.JobFailedException; -import de.uka.ipd.sdq.workflow.jobs.UserCanceledException; -import tools.mdsd.junit5utils.annotations.PluginTestOnly; - -@PluginTestOnly -class EventExtensionTest { - - @Test - @LoadPCMInstanceFromBundle(bundleName = "org.palladiosimulator.examples.package", basePath = "initiatorTemplates/MinimumEvent_Example", modelFiles = { - "default.allocation", "default.usagemodel" }) - @UseSimuLizarExtension(DaggerEventExtensionComponent.class) - @SimulationConfig(maxMeasurements = "1000") - @SetConfigProperty(id = EventsTransformationConfiguration.SIMULATE_EVENTS, value = "true") - @SetConfigProperty(id = EventsTransformationConfiguration.EVENT_MIDDLEWARE_FILE, value = ConstantsContainer.DEFAULT_EVENT_MIDDLEWARE_FILE) - @SetConfigProperty(id = EventsTransformationConfiguration.STORE_TRANSFORMED_MODELS, value = "false") - @RunSimuLizar - void testEventExtension(UsageScenario scenario, ExperimentRun expRun) - throws JobFailedException, UserCanceledException { - var measurement = getMeasurementOfAt(expRun.getMeasurement(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC_TUPLE, scenario); - assertTrue(measurement.isPresent()); - - assertThat(allMeasurementsOfMetric(measurement.get(), MetricDescriptionConstants.RESPONSE_TIME_METRIC), - match(withProbability(closeTo(0.5, 0.1), asDoubleIn(SI.SECOND, is(closeTo(5, 0.0001)))), - withProbability(closeTo(0.5, 0.1), asDoubleIn(SI.SECOND, is(closeTo(4, 0.0001)))), - withProbability(lessThan(0.05), asDoubleIn(SI.SECOND, is(lessThan(3.999)))))); - } - -} diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/LinkingResourceSimulationTest.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/LinkingResourceSimulationTest.java deleted file mode 100644 index 6beffc9c..00000000 --- a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/LinkingResourceSimulationTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.palladiosimulator.simulizar.simulation.tests; - -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.lessThan; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import javax.measure.unit.SI; - -import org.junit.jupiter.api.Test; -import org.palladiosimulator.edp2.models.ExperimentData.ExperimentRun; -import org.palladiosimulator.metricspec.constants.MetricDescriptionConstants; -import org.palladiosimulator.pcm.usagemodel.UsageScenario; -import org.palladiosimulator.simulizar.test.commons.annotation.LoadPCMInstanceFromBundle; -import org.palladiosimulator.simulizar.test.commons.annotation.RunSimuLizar; -import org.palladiosimulator.simulizar.test.commons.annotation.SimulationConfig; -import org.palladiosimulator.simulizar.test.commons.util.MeasurementTestUtils; - -import de.uka.ipd.sdq.workflow.jobs.JobFailedException; -import de.uka.ipd.sdq.workflow.jobs.UserCanceledException; -import tools.mdsd.junit5utils.annotations.PluginTestOnly; - -@PluginTestOnly -class LinkingResourceSimulationTest { - - @Test - @LoadPCMInstanceFromBundle(bundleName = "org.palladiosimulator.examples.package", basePath = "initiatorTemplates/LinkingResource_Test", modelFiles = { - "default.allocation", "default.measuringpoint", "default.monitorrepository", "default.repository", - "default.resourceenvironment", "default.slo", "default.system", "default.usagemodel" }) - @SimulationConfig(simulateLinkThroughput = true, maxMeasurements = "100") - @RunSimuLizar - void testLinkingResourceThroughputSimulation(UsageScenario scenario, ExperimentRun expRun) - throws JobFailedException, UserCanceledException { - var measurement = MeasurementTestUtils.getMeasurementOfAt(expRun.getMeasurement(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC_TUPLE, scenario); - assertTrue(measurement.isPresent()); - - MeasurementTestUtils.allDoubleMeasurementValuesMatch(measurement.get(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC, SI.SECOND, - is(allOf(greaterThan(184.0), lessThan(185.0)))); - - } - - @Test - @LoadPCMInstanceFromBundle(bundleName = "org.palladiosimulator.examples.package", basePath = "initiatorTemplates/LinkingResource_Test", modelFiles = { - "default.allocation", "default.measuringpoint", "default.monitorrepository", "default.repository", - "default.resourceenvironment", "default.slo", "default.system", "default.usagemodel" }) - @SimulationConfig(simulateLinkThroughput = false, maxMeasurements = "100") - @RunSimuLizar - void testNoLinkingResourceSimulation(UsageScenario scenario, ExperimentRun expRun) - throws JobFailedException, UserCanceledException { - var measurement = MeasurementTestUtils.getMeasurementOfAt(expRun.getMeasurement(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC_TUPLE, scenario); - assertTrue(measurement.isPresent()); - - MeasurementTestUtils.allDoubleMeasurementValuesMatch(measurement.get(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC, SI.SECOND, - is(allOf(greaterThan(1.0), lessThan(2.0)))); - - } - -} diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/SubsystemTest.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/SubsystemTest.java deleted file mode 100644 index d7a1be67..00000000 --- a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/simulation/tests/SubsystemTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.palladiosimulator.simulizar.simulation.tests; - -import static org.hamcrest.Matchers.anyOf; -import static org.hamcrest.Matchers.closeTo; -import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import javax.measure.unit.SI; - -import org.junit.jupiter.api.Test; -import org.palladiosimulator.edp2.models.ExperimentData.ExperimentRun; -import org.palladiosimulator.metricspec.constants.MetricDescriptionConstants; -import org.palladiosimulator.pcm.usagemodel.UsageScenario; -import org.palladiosimulator.simulizar.test.commons.annotation.LoadPCMInstanceFromBundle; -import org.palladiosimulator.simulizar.test.commons.annotation.RunSimuLizar; -import org.palladiosimulator.simulizar.test.commons.annotation.SimulationConfig; -import org.palladiosimulator.simulizar.test.commons.util.MeasurementTestUtils; - -import de.uka.ipd.sdq.workflow.jobs.JobFailedException; -import de.uka.ipd.sdq.workflow.jobs.UserCanceledException; -import tools.mdsd.junit5utils.annotations.PluginTestOnly; - -@PluginTestOnly -class SubsystemTest { - - @Test - @LoadPCMInstanceFromBundle(bundleName = "org.palladiosimulator.examples.package", basePath = "initiatorTemplates/Subsystem_Test", modelFiles = { - "nestedSubsystems.allocation", "nestedSubsystems.monitorrepository", "nestedSubSystem.usagemodel" }) - @SimulationConfig(maxMeasurements = "100") - @RunSimuLizar - void testNestedSubsystemAllocation(UsageScenario scenario, ExperimentRun expRun) - throws JobFailedException, UserCanceledException { - var measurement = MeasurementTestUtils.getMeasurementOfAt(expRun.getMeasurement(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC_TUPLE, scenario); - assertTrue(measurement.isPresent()); - - MeasurementTestUtils.allDoubleMeasurementValuesMatch(measurement.get(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC, SI.SECOND, - is(anyOf(closeTo(0.1, 0.0001), closeTo(0.2, 0.0001)))); - - } - - - @Test - @LoadPCMInstanceFromBundle(bundleName = "org.palladiosimulator.examples.package", basePath = "initiatorTemplates/Subsystem_Test", modelFiles = { - "default.allocation", "default.monitorrepository", "default.usagemodel" }) - @SimulationConfig(maxMeasurements = "100") - @RunSimuLizar - void testDefault(UsageScenario scenario, ExperimentRun expRun) - throws JobFailedException, UserCanceledException { - var measurement = MeasurementTestUtils.getMeasurementOfAt(expRun.getMeasurement(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC_TUPLE, scenario); - assertTrue(measurement.isPresent()); - - MeasurementTestUtils.allDoubleMeasurementValuesMatch(measurement.get(), - MetricDescriptionConstants.RESPONSE_TIME_METRIC, SI.SECOND, - is(anyOf(closeTo(0.1, 0.0001), closeTo(0.2, 0.0001)))); - - } - -} From 948738b22bab296671bbd27257ea8f449e6f1a78 Mon Sep 17 00:00:00 2001 From: Ralf Sieger Date: Fri, 27 Sep 2024 17:24:02 +0200 Subject: [PATCH 2/2] enhanced test name --- .../META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/org.palladiosimulator.simulizar.monitorrepository.map.tests/META-INF/MANIFEST.MF b/tests/org.palladiosimulator.simulizar.monitorrepository.map.tests/META-INF/MANIFEST.MF index dff7b79d..113c8d17 100644 --- a/tests/org.palladiosimulator.simulizar.monitorrepository.map.tests/META-INF/MANIFEST.MF +++ b/tests/org.palladiosimulator.simulizar.monitorrepository.map.tests/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: Tests +Bundle-Name: Simulizar Monitor Repository Map Tests Bundle-SymbolicName: org.palladiosimulator.simulizar.monitorrepository.map.tests Bundle-Version: 5.2.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-17