Search in sources :

Example 1 with HostRequirement

use of org.opentosca.toscana.model.requirement.HostRequirement in project TOSCAna by StuPro-TOSCAna.

the class LinkResolverTest method resolveRequirementLink.

@Test
public void resolveRequirementLink() {
    EffectiveModel model = new EffectiveModelFactory().create(REQUIREMENT, logMock());
    WebServer node = (WebServer) model.getNodeMap().get("test-node1");
    HostRequirement requirement = node.getHost();
    assertNotNull(requirement);
    Set<Compute> fulfillers = requirement.getFulfillers();
    assertEquals(1, fulfillers.size());
    Compute fulfiller = fulfillers.iterator().next();
    assertEquals("test-node2", fulfiller.getEntityName());
}
Also used : WebServer(org.opentosca.toscana.model.node.WebServer) HostRequirement(org.opentosca.toscana.model.requirement.HostRequirement) Compute(org.opentosca.toscana.model.node.Compute) EffectiveModel(org.opentosca.toscana.model.EffectiveModel) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)1 EffectiveModel (org.opentosca.toscana.model.EffectiveModel)1 EffectiveModelFactory (org.opentosca.toscana.model.EffectiveModelFactory)1 Compute (org.opentosca.toscana.model.node.Compute)1 WebServer (org.opentosca.toscana.model.node.WebServer)1 HostRequirement (org.opentosca.toscana.model.requirement.HostRequirement)1