diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2106bf620..f0836db1b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -8,6 +8,7 @@ jobs:
with:
use-display-output: true
no-caching: true
+ skip-branch-deploy: false
deploy-updatesite: 'releng/org.palladiosimulator.simulizar.updatesite/target/repository'
secrets:
SERVER_SSH_KEY: ${{ secrets.DEPLOYMENT_SERVER_SSH_KEY }}
diff --git a/releng/org.palladiosimulator.simulizar.targetplatform/tp.target b/releng/org.palladiosimulator.simulizar.targetplatform/tp.target
index 6f3efc505..2599d42cb 100644
--- a/releng/org.palladiosimulator.simulizar.targetplatform/tp.target
+++ b/releng/org.palladiosimulator.simulizar.targetplatform/tp.target
@@ -247,6 +247,14 @@
+
+
+
+
+
+
+
+
diff --git a/tests/org.palladiosimulator.simulizar.tests/.classpath b/tests/org.palladiosimulator.simulizar.tests/.classpath
new file mode 100644
index 000000000..9099bea15
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/.classpath
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/org.palladiosimulator.simulizar.tests/.enable_dagger_annotation_processing b/tests/org.palladiosimulator.simulizar.tests/.enable_dagger_annotation_processing
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/org.palladiosimulator.simulizar.tests/.gitignore b/tests/org.palladiosimulator.simulizar.tests/.gitignore
new file mode 100644
index 000000000..e674f805b
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/.gitignore
@@ -0,0 +1,2 @@
+/bin/
+*.html
\ No newline at end of file
diff --git a/tests/org.palladiosimulator.simulizar.tests/.project b/tests/org.palladiosimulator.simulizar.tests/.project
new file mode 100644
index 000000000..04cf5fc68
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/.project
@@ -0,0 +1,34 @@
+
+
+ org.palladiosimulator.simulizar.tests
+
+
+
+
+
+ org.eclipse.xtext.ui.shared.xtextBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.xtext.ui.shared.xtextNature
+
+
diff --git a/tests/org.palladiosimulator.simulizar.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.palladiosimulator.simulizar.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..6558ab78f
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=17
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=17
diff --git a/tests/org.palladiosimulator.simulizar.tests/META-INF/MANIFEST.MF b/tests/org.palladiosimulator.simulizar.tests/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..f28f1cb08
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,41 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SimuLizar Tests
+Bundle-SymbolicName: org.palladiosimulator.simulizar.tests;singleton:=true
+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.2.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",
+ de.uka.ipd.sdq.errorhandling;bundle-version="4.3.0",
+ 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,
+ org.palladiosimulator.simulizar.test.commons;bundle-version="5.2.0",
+ org.palladiosimulator.simulizar.events,
+ org.palladiosimulator.simulizar.monitorrepository.feedthrough;bundle-version="5.2.0"
+Import-Package: com.google.common.util.concurrent.internal;version="1.0.1",
+ net.bytebuddy.dynamic.loading;version="1.6.0",
+ org.hamcrest;version="2.2.0",
+ org.hamcrest.collection;version="2.2.0",
+ org.hamcrest.core;version="2.2.0",
+ org.junit.jupiter.api;version="5.4.2",
+ org.junit.jupiter.api.extension;version="5.4.2",
+ org.junit.jupiter.api.function;version="5.4.2",
+ org.junit.jupiter.api.io;version="5.4.2",
+ org.junit.jupiter.params;version="5.4.2",
+ org.junit.jupiter.params.provider;version="5.4.2",
+ org.junit.platform.commons;version="1.4.0",
+ org.junit.platform.commons.support;version="1.4.0",
+ org.mockito,
+ org.mockito.invocation,
+ org.mockito.junit.jupiter,
+ org.mockito.stubbing,
+ org.objenesis;version="2.6.0"
diff --git a/tests/org.palladiosimulator.simulizar.tests/build.properties b/tests/org.palladiosimulator.simulizar.tests/build.properties
new file mode 100644
index 000000000..c867a950d
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/build.properties
@@ -0,0 +1,7 @@
+source.. = src/,\
+ xtend-gen/,\
+ src-gen/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ testmodels/
diff --git a/tests/org.palladiosimulator.simulizar.tests/org.palladiosimulator.simulizar.tests.launch b/tests/org.palladiosimulator.simulizar.tests/org.palladiosimulator.simulizar.tests.launch
new file mode 100644
index 000000000..a4cda0730
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/org.palladiosimulator.simulizar.tests.launch
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/GenericExtensionComponentTest.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/GenericExtensionComponentTest.java
new file mode 100644
index 000000000..89e7ba8f3
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/GenericExtensionComponentTest.java
@@ -0,0 +1,160 @@
+package org.palladiosimulator.simulizar.di.extension;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsEmptyCollection.empty;
+import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
+
+import java.util.Set;
+
+import org.junit.jupiter.api.Test;
+import org.palladiosimulator.simulizar.modelobserver.IModelObserver;
+import org.palladiosimulator.simulizar.runtimestate.RuntimeStateEntityObserver;
+
+import com.google.common.collect.ImmutableSet;
+
+class GenericExtensionComponentTest {
+
+ @Test
+ void testComponentWithoutExtension() {
+ var underTest = new GenericExtensionComponent(new ExtensionComponent() {
+ });
+ assertThat(underTest.getExtensions(IModelObserver.class).get(), is(empty()));
+ }
+
+ @Test
+ void testSingleExtension() {
+ var observer = new IModelObserver() {
+ };
+
+ var underTest = new GenericExtensionComponent(new ExtensionComponent() {
+ @SuppressWarnings("unused")
+ public IModelObserver provideObserver() {
+ return observer;
+ }
+ });
+
+ assertThat(underTest.getExtensions(IModelObserver.class).get(), containsInAnyOrder(observer));
+ }
+
+ @Test
+ void testMultipleSingleExtension() {
+ var observer = new IModelObserver() {
+ };
+ var observer2 = new IModelObserver() {
+ };
+ var observer3 = new IModelObserver() {
+ };
+
+ var underTest = new GenericExtensionComponent(new ExtensionComponent() {
+ @SuppressWarnings("unused")
+ public IModelObserver provideObserver1() {
+ return observer;
+ }
+
+ @SuppressWarnings("unused")
+ public IModelObserver provideObserver2() {
+ return observer2;
+ }
+
+ @SuppressWarnings("unused")
+ public IModelObserver provideObserver3() {
+ return observer3;
+ }
+ });
+
+ assertThat(underTest.getExtensions(IModelObserver.class).get(), containsInAnyOrder(observer, observer2, observer3));
+ }
+
+ @Test
+ void testSetExtension() {
+ var observer = new IModelObserver() {
+ };
+ var observer2 = new IModelObserver() {
+ };
+ var observer3 = new IModelObserver() {
+ };
+
+ var underTest = new GenericExtensionComponent(new ExtensionComponent() {
+ @SuppressWarnings("unused")
+ public Set provideObservers() {
+ return ImmutableSet.of(observer, observer2, observer3);
+ }
+ });
+
+ assertThat(underTest.getExtensions(IModelObserver.class).get(), containsInAnyOrder(observer, observer2, observer3));
+ }
+
+
+ @Test
+ void testCombineSingleAndSetExtension() {
+ var observer = new IModelObserver() {
+ };
+ var observer2 = new IModelObserver() {
+ };
+ var observer3 = new IModelObserver() {
+ };
+ var observer4 = new IModelObserver() {
+ };
+ var observer5 = new IModelObserver() {
+ };
+
+ var underTest = new GenericExtensionComponent(new ExtensionComponent() {
+ @SuppressWarnings("unused")
+ public Set provideObservers() {
+ return ImmutableSet.of(observer, observer2);
+ }
+
+ @SuppressWarnings("unused")
+ public Set provideObservers2() {
+ return ImmutableSet.of(observer3);
+ }
+
+ @SuppressWarnings("unused")
+ public IModelObserver provideObserver4() {
+ return observer4;
+ }
+
+ @SuppressWarnings("unused")
+ public IModelObserver provideObserver5() {
+ return observer5;
+ }
+ });
+
+ assertThat(underTest.getExtensions(IModelObserver.class).get(), containsInAnyOrder(observer, observer2, observer3, observer4, observer5));
+ }
+
+ static class MergedExtensionType implements IModelObserver, RuntimeStateEntityObserver {
+ @Override
+ public void initialize() {
+ }
+ }
+
+ @Test
+ void testExtentionWithTwoTypesAdheresToStaticTypeSignature() {
+ var mergedExtension = new MergedExtensionType();
+
+ var underTest = new GenericExtensionComponent(new ExtensionComponent() {
+ @SuppressWarnings("unused")
+ public MergedExtensionType provide() {
+ return mergedExtension;
+ }
+ });
+
+ assertThat(underTest.getExtensions(IModelObserver.class).get(), containsInAnyOrder(mergedExtension));
+ assertThat(underTest.getExtensions(RuntimeStateEntityObserver.class).get(), containsInAnyOrder(mergedExtension));
+
+ underTest = new GenericExtensionComponent(new ExtensionComponent() {
+ @SuppressWarnings("unused")
+ public IModelObserver provide() {
+ return mergedExtension;
+ }
+ });
+
+ assertThat(underTest.getExtensions(IModelObserver.class).get(), containsInAnyOrder(mergedExtension));
+ assertThat(underTest.getExtensions(RuntimeStateEntityObserver.class).get(), is(empty()));
+
+
+ }
+
+}
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/TestExtensionComponentDepencencyResolution.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/TestExtensionComponentDepencencyResolution.java
new file mode 100644
index 000000000..804c459f1
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/TestExtensionComponentDepencencyResolution.java
@@ -0,0 +1,88 @@
+package org.palladiosimulator.simulizar.di.extension;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsEmptyCollection.empty;
+import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
+import static org.hamcrest.collection.IsIterableWithSize.iterableWithSize;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.palladiosimulator.simulizar.di.extension.sample.ComponentA;
+import org.palladiosimulator.simulizar.di.extension.sample.ComponentB;
+import org.palladiosimulator.simulizar.di.extension.sample.ComponentC;
+import org.palladiosimulator.simulizar.di.extension.sample.DaggerComponentA;
+import org.palladiosimulator.simulizar.di.extension.sample.DaggerComponentB;
+import org.palladiosimulator.simulizar.di.extension.sample.DaggerComponentC;
+import org.palladiosimulator.simulizar.di.extension.sample.ModuleA;
+
+import com.google.common.collect.ImmutableSet;
+
+import dagger.Component;
+
+class TestExtensionComponentDepencencyResolution {
+
+ @Test
+ void testNoExtensionNoErrors() {
+ var underTest = new ExtensionComponentDependencyResolution(ImmutableSet.of(), ImmutableSet.of());
+ assertThat(underTest.getExtensionComponents(), is(empty()));
+ }
+
+ @Test
+ void testSingleComponentNoDependencies() throws Exception {
+ var underTest = new ExtensionComponentDependencyResolution(ImmutableSet.of(),
+ ImmutableSet.of(DaggerComponentA.factory()));
+ var result = underTest.getExtensionComponents();
+ assertThat(result, containsInAnyOrder(instanceOf(ComponentA.class)));
+ }
+
+ @Test
+ void testSimpleComponentDependencies() throws Exception {
+ var underTest = new ExtensionComponentDependencyResolution(ImmutableSet.of(),
+ ImmutableSet.of(DaggerComponentA.factory(), DaggerComponentB.factory()));
+ var result = underTest.getExtensionComponents();
+ assertThat(result, containsInAnyOrder(instanceOf(ComponentA.class), instanceOf(ComponentB.class)));
+ }
+
+ @Test
+ void testBootstrappedComponentDependencies() throws Exception {
+ var underTest = new ExtensionComponentDependencyResolution(ImmutableSet.of(DaggerComponentA.create()),
+ ImmutableSet.of(DaggerComponentB.factory(), DaggerComponentC.factory()));
+ var result = underTest.getExtensionComponents();
+ assertThat(result, containsInAnyOrder(instanceOf(ComponentB.class), instanceOf(ComponentC.class)));
+ }
+
+ @Test
+ void testMissingDependenciesDoNotCauseErrors() throws Exception {
+ var underTest = new ExtensionComponentDependencyResolution(ImmutableSet.of(),
+ ImmutableSet.of(DaggerComponentB.factory(), DaggerComponentC.factory()));
+ var result = underTest.getExtensionComponents();
+ assertThat(result, is(iterableWithSize(0)));
+
+ underTest = new ExtensionComponentDependencyResolution(ImmutableSet.of(),
+ ImmutableSet.of(DaggerComponentA.factory(), DaggerComponentC.factory()));
+ result = underTest.getExtensionComponents();
+ assertThat(result, containsInAnyOrder(instanceOf(ComponentA.class)));
+ }
+
+ // We need to introduce the dependency in a subclass, as otherwise dagger will detect the cycle during compile-time
+ @Component(dependencies = ComponentB.class, modules = ModuleA.class)
+ public static interface AWithDependencyToB extends ComponentA {
+ @Component.Factory
+ public static interface Factory extends ExtensionComponent.Factory {
+ AWithDependencyToB create(ComponentB b);
+ }
+ }
+
+ @Test
+ void testCyclesAreDetected() throws Exception {
+ var underTest = new ExtensionComponentDependencyResolution(ImmutableSet.of(),
+ ImmutableSet.of(DaggerComponentB.factory(), DaggerTestExtensionComponentDepencencyResolution_AWithDependencyToB.factory()));
+
+ Assertions.assertThrows(IllegalStateException.class, () -> {
+ underTest.getExtensionComponents();
+ });
+ }
+
+}
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/TestGenericComponentFactory.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/TestGenericComponentFactory.java
new file mode 100644
index 000000000..88b0731e6
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/TestGenericComponentFactory.java
@@ -0,0 +1,73 @@
+package org.palladiosimulator.simulizar.di.extension;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.isA;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
+import static org.junit.jupiter.api.Assertions.assertIterableEquals;
+
+import org.junit.jupiter.api.Test;
+import org.palladiosimulator.simulizar.di.extension.sample.ComponentA;
+import org.palladiosimulator.simulizar.di.extension.sample.ComponentB;
+import org.palladiosimulator.simulizar.di.extension.sample.ComponentC;
+import org.palladiosimulator.simulizar.di.extension.sample.DaggerComponentA;
+import org.palladiosimulator.simulizar.di.extension.sample.DaggerComponentA2;
+import org.palladiosimulator.simulizar.di.extension.sample.DaggerComponentB;
+import org.palladiosimulator.simulizar.di.extension.sample.DaggerComponentC;
+
+import com.google.common.collect.ImmutableList;
+
+class TestGenericComponentFactory {
+
+ @Test
+ void testNoDependencies() {
+ var factory = DaggerComponentA.factory();
+ var underTest = new GenericComponentFactory(factory);
+ assertIterableEquals(underTest.getUnfullfilledRequirements(), ImmutableList.of());
+ }
+
+ @Test
+ void testDependenciesToOneComponent() {
+ var factory = DaggerComponentB.factory();
+ var underTest = new GenericComponentFactory(factory);
+ assertIterableEquals(underTest.getUnfullfilledRequirements(), ImmutableList.of(ComponentA.class));
+ var componentA = DaggerComponentA.factory().create();
+ underTest.fulfillRequirement(() -> componentA);
+ assertIterableEquals(underTest.getUnfullfilledRequirements(), ImmutableList.of());
+ var created = underTest.get();
+ assertThat(created, isA(ComponentB.class));
+ }
+
+ @Test
+ void testMultipleDependencies() {
+ var factory = DaggerComponentC.factory();
+ var underTest = new GenericComponentFactory(factory);
+ assertThat(underTest.getUnfullfilledRequirements(), containsInAnyOrder(ComponentA.class, ComponentB.class));
+ var componentA = DaggerComponentA.factory().create();
+ underTest.fulfillRequirement(() -> componentA);
+ assertIterableEquals(underTest.getUnfullfilledRequirements(), ImmutableList.of(ComponentB.class));
+ underTest.fulfillRequirement(() -> DaggerComponentB.factory().create(componentA));
+ assertIterableEquals(underTest.getUnfullfilledRequirements(), ImmutableList.of());
+ var created = underTest.get();
+ assertThat(created, isA(ComponentC.class));
+ assertThat(created.name(), is("A"));
+ }
+
+ @Test
+ void testDependencyToSuperComponent() {
+ var factory = DaggerComponentC.factory();
+ var underTest = new GenericComponentFactory(factory);
+ assertThat(underTest.getUnfullfilledRequirements(), containsInAnyOrder(ComponentA.class, ComponentB.class));
+ var componentA = DaggerComponentA2.factory().create();
+ underTest.fulfillRequirement(() -> componentA);
+ assertIterableEquals(underTest.getUnfullfilledRequirements(), ImmutableList.of(ComponentB.class));
+ underTest.fulfillRequirement(() -> DaggerComponentB.factory().create(componentA));
+ assertIterableEquals(underTest.getUnfullfilledRequirements(), ImmutableList.of());
+ var created = underTest.get();
+ assertThat(created, isA(ComponentC.class));
+ assertThat(created.name(), is("A2"));
+ }
+
+
+
+}
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentA.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentA.java
new file mode 100644
index 000000000..689edd5be
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentA.java
@@ -0,0 +1,19 @@
+package org.palladiosimulator.simulizar.di.extension.sample;
+
+import javax.inject.Named;
+
+import org.palladiosimulator.simulizar.di.extension.ExtensionComponent;
+
+import dagger.Component;
+
+@Component(modules = ModuleA.class)
+public interface ComponentA extends ExtensionComponent {
+
+ @Named("name") String name();
+
+ @Component.Factory
+ public static interface Factory extends ExtensionComponent.Factory {
+ ComponentA create();
+ }
+
+}
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentA2.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentA2.java
new file mode 100644
index 000000000..cd5e4346a
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentA2.java
@@ -0,0 +1,27 @@
+package org.palladiosimulator.simulizar.di.extension.sample;
+
+import javax.inject.Named;
+
+import org.palladiosimulator.simulizar.di.extension.ExtensionComponent;
+
+import dagger.Component;
+import dagger.Provides;
+
+@Component(modules = ComponentA2.Module.class)
+public interface ComponentA2 extends ComponentA {
+
+ @Component.Factory
+ public static interface Factory extends ExtensionComponent.Factory {
+ ComponentA2 create();
+ }
+
+ @dagger.Module
+ public static interface Module {
+ @Named("name")
+ @Provides
+ static String provideName() {
+ return "A2";
+ }
+ }
+
+}
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentB.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentB.java
new file mode 100644
index 000000000..9afa19ef3
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentB.java
@@ -0,0 +1,15 @@
+package org.palladiosimulator.simulizar.di.extension.sample;
+
+import org.palladiosimulator.simulizar.di.extension.ExtensionComponent;
+
+import dagger.Component;
+
+@Component(dependencies = ComponentA.class)
+public interface ComponentB extends ExtensionComponent{
+
+ @Component.Factory
+ public static interface Factory extends ExtensionComponent.Factory {
+ ComponentB create(ComponentA compA);
+ }
+
+}
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentC.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentC.java
new file mode 100644
index 000000000..da677b715
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ComponentC.java
@@ -0,0 +1,19 @@
+package org.palladiosimulator.simulizar.di.extension.sample;
+
+import javax.inject.Named;
+
+import org.palladiosimulator.simulizar.di.extension.ExtensionComponent;
+
+import dagger.Component;
+
+@Component(dependencies = { ComponentA.class, ComponentB.class} )
+public interface ComponentC extends ExtensionComponent {
+
+ @Named("name") String name();
+
+ @Component.Factory
+ public static interface Factory extends ExtensionComponent.Factory {
+ ComponentC create(ComponentA a, ComponentB b);
+ }
+
+}
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ModuleA.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ModuleA.java
new file mode 100644
index 000000000..c8e40b9b7
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/di/extension/sample/ModuleA.java
@@ -0,0 +1,17 @@
+package org.palladiosimulator.simulizar.di.extension.sample;
+
+import javax.inject.Named;
+
+import dagger.Module;
+import dagger.Provides;
+
+@Module
+public interface ModuleA {
+
+ @Named("name")
+ @Provides
+ static String provideName() {
+ return "A";
+ }
+
+}
diff --git a/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/interpreter/linking/impl/DemandCalculatorTestBase.java b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/interpreter/linking/impl/DemandCalculatorTestBase.java
new file mode 100644
index 000000000..a1039948b
--- /dev/null
+++ b/tests/org.palladiosimulator.simulizar.tests/src/org/palladiosimulator/simulizar/interpreter/linking/impl/DemandCalculatorTestBase.java
@@ -0,0 +1,98 @@
+package org.palladiosimulator.simulizar.interpreter.linking.impl;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.util.function.Supplier;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
+import org.palladiosimulator.simulizar.interpreter.linking.ITransmissionPayloadDemandCalculator;
+
+import de.uka.ipd.sdq.probfunction.math.IRandomGenerator;
+import de.uka.ipd.sdq.probfunction.math.impl.ProbabilityFunctionFactoryImpl;
+import de.uka.ipd.sdq.simucomframework.variables.EvaluationProxy;
+import de.uka.ipd.sdq.simucomframework.variables.cache.StoExCache;
+import de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe;
+import tools.mdsd.junit5utils.extensions.PlatformStandaloneExtension;
+
+@ExtendWith(PlatformStandaloneExtension.class)
+abstract class DemandCalculatorTestBase {
+ protected enum TestCases {
+ EMPTY(() -> new SimulatedStackframe<>()),
+
+ STACKFRAME_WITH_SINGLE_ELEMENT_WITH_BYTESIZE_100(() -> {
+ var res = new SimulatedStackframe<>();
+ res.addValue("some.variable.with.BYTESIZE", 100);
+ return res;
+ }),
+
+ STACKFRAME_WITH_THREE_ELEMENTS_WITH_BYTESIZE_100_200_NONE(() -> {
+ var res = new SimulatedStackframe<>();
+ res.addValue("some.variable.with.BYTESIZE", 100);
+ res.addValue("some.variable.with.another.BYTESIZE", new EvaluationProxy("200", res));
+ res.addValue("some.value.without.bytesize.characterization", 300);
+ return res;
+ }),
+
+ STACKFRAME_WITH_THREE_ELEMENTS_WITH_INNER_BYTESIZES(() -> {
+ var res = new SimulatedStackframe<>();
+ res.addValue("some.variable.with.BYTESIZE", 100);
+ res.addValue("some.variable.with.another.INNER.BYTESIZE", 100);
+ res.addValue("some.value.without.bytesize.characterization", 100);
+ res.addValue("some.value.without.bytesize.characterization.BYTESIZE", 100);
+ return res;
+ }),
+
+ STACKFRAME_WITH_THREE_ELEMENTS_WITH_INNER_BYTESIZES_WITH_STREAM(() -> {
+ var res = new SimulatedStackframe<>();
+ res.addValue("some.variable.with.BYTESIZE", 100);
+ res.addValue("some.variable.with.another.INNER.BYTESIZE", 100);
+ res.addValue("some.value.without.bytesize.characterization", 100);
+ res.addValue("some.value.without.bytesize.characterization.BYTESIZE", 100);
+ res.addValue("stream.BYTESIZE", 100);
+ return res;
+ });
+
+
+ private SimulatedStackframe