Search in sources :

Example 1 with DatabaseEndpointCapability

use of org.opentosca.toscana.model.capability.DatabaseEndpointCapability in project TOSCAna by StuPro-TOSCAna.

the class ServiceGraphTest method requirementTest.

@Test
public void requirementTest() {
    currentFile = REQUIREMENT;
    Optional<Entity> fulfiller = getGraph().getEntity(Lists.newArrayList("topology_template", "node_templates", "test-node", "requirements", "test-requirement1", "node"));
    assertTrue(fulfiller.isPresent());
    Optional<Entity> fulfiller2 = getGraph().getEntity(Lists.newArrayList("topology_template", "node_templates", "test-node", "requirements", "test-requirement2", "node"));
    assertTrue(fulfiller2.isPresent());
    MappingEntity capabilityEntity = (MappingEntity) getGraph().getEntity(new EntityId(Lists.newArrayList("topology_template", "node_templates", "test-node", "requirements", "test-requirement2", "capability"))).get();
    DatabaseEndpointCapability capability = TypeWrapper.wrapTypedElement(capabilityEntity);
    assertNotNull(capability);
    MappingEntity relationshipEntity = (MappingEntity) getGraph().getEntity(new EntityId(Lists.newArrayList("topology_template", "node_templates", "test-node", "requirements", "test-requirement2", "relationship"))).get();
    ConnectsTo relationship = TypeWrapper.wrapTypedElement(relationshipEntity);
    assertNotNull(relationship);
    assertEquals(Lists.newArrayList("1", "2"), getList("topology_template", "node_templates", "test-node", "requirements", "test-requirement2", "occurrences"));
}
Also used : EntityId(org.opentosca.toscana.model.EntityId) ConnectsTo(org.opentosca.toscana.model.relation.ConnectsTo) DatabaseEndpointCapability(org.opentosca.toscana.model.capability.DatabaseEndpointCapability) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)1 EntityId (org.opentosca.toscana.model.EntityId)1 DatabaseEndpointCapability (org.opentosca.toscana.model.capability.DatabaseEndpointCapability)1 ConnectsTo (org.opentosca.toscana.model.relation.ConnectsTo)1