package org.opentosca.toscana.plugins.testdata;

import org.opentosca.toscana.model.EffectiveModel;
import org.opentosca.toscana.model.capability.DockerContainerCapability;
import org.opentosca.toscana.model.capability.EndpointCapability;
import org.opentosca.toscana.model.capability.Requirement;
import org.opentosca.toscana.model.capability.ScalableCapability;
import org.opentosca.toscana.model.datatype.Port;
import org.opentosca.toscana.model.datatype.Range;
import org.opentosca.toscana.model.node.ContainerRuntime;
import org.opentosca.toscana.model.node.DockerApplication;
import org.opentosca.toscana.model.node.RootNode;
import org.opentosca.toscana.model.relation.HostedOn;
import org.opentosca.toscana.model.relation.RootRelationship;

import com.google.common.collect.Sets;

public class TestEffectiveModels {

    public static EffectiveModel getMinimalDockerModel() {
        DockerContainerCapability containerCapability = DockerContainerCapability.builder().name("host").build();
        ScalableCapability scalableCapability = ScalableCapability.builder(Range.EXACTLY_ONCE).build();
        ContainerRuntime dockerRuntime
            = ContainerRuntime.builder("dockerRuntime", containerCapability, scalableCapability).build();
        HostedOn hostedOn = HostedOn.builder().build();
        Requirement<DockerContainerCapability, ContainerRuntime, HostedOn> host
            = Requirement.<DockerContainerCapability, ContainerRuntime, HostedOn>builder(containerCapability, hostedOn)
            .fulfiller(dockerRuntime)
            .build();
        EndpointCapability endpointCapability = EndpointCapability.builder("127.0.0.1", new Port(80)).build();
        Requirement<EndpointCapability, RootNode, RootRelationship> network
            = Requirement.<EndpointCapability, RootNode, RootRelationship>builder(endpointCapability, hostedOn).build();
        DockerApplication simpleTaskApp
            = DockerApplication.builder(host, "simpleTaskApp", network).build();

        return new EffectiveModel(Sets.newHashSet(simpleTaskApp, dockerRuntime));
    }
}

@@ -349,32 +349,97 @@
 ableCapability;%0A
+import org.opentosca.toscana.model.capability.StorageCapability;%0A
 import org.opent
@@ -690,16 +690,72 @@
 otNode;%0A
+import org.opentosca.toscana.model.relation.AttachesTo;%0A
 import o
@@ -1977,32 +1977,376 @@
 tedOn).build();%0A
+        StorageCapability storageCapability = StorageCapability.builder().build();%0A        AttachesTo attachesTo = AttachesTo.builder(%22/%22).build();%0A        Requirement%3CStorageCapability, RootNode, RootRelationship%3E storage%0A            = Requirement.%3CStorageCapability, RootNode, RootRelationship%3Ebuilder(storageCapability, attachesTo).build();%0A
         DockerAp
@@ -2439,16 +2439,25 @@
  network
+, storage
 ).build(

Fix minimal docker effective model (#302)