Search in sources :

Example 1 with BaseToscaElement

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

the class TypeResolverTest method supportForAllWineryNodeTypes.

@Test
public void supportForAllWineryNodeTypes() {
    Set<String> wineryNodeTypes = getWineryNodeTypes();
    for (String nodeType : wineryNodeTypes) {
        logger.info("Testing conversion of type '{}'", nodeType);
        ServiceGraph graph = new ServiceGraph(logMock());
        MappingEntity nodeEntity = new MappingEntity(ToscaStructure.NODE_TEMPLATES.descend("my-node"), graph);
        graph.addEntity(nodeEntity);
        ScalarEntity typeEntity = new ScalarEntity(nodeType, nodeEntity.getId().descend("type"), graph);
        graph.addEntity(typeEntity);
        BaseToscaElement node = TypeWrapper.wrapTypedElement(nodeEntity);
        assertNotNull(node);
        logger.info("Node Type '{}': known", nodeType);
        System.out.println();
    }
// successful if no exception thrown
}
Also used : BaseToscaElement(org.opentosca.toscana.model.BaseToscaElement) ServiceGraph(org.opentosca.toscana.core.parse.model.ServiceGraph) ScalarEntity(org.opentosca.toscana.core.parse.model.ScalarEntity) MappingEntity(org.opentosca.toscana.core.parse.model.MappingEntity) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)1 MappingEntity (org.opentosca.toscana.core.parse.model.MappingEntity)1 ScalarEntity (org.opentosca.toscana.core.parse.model.ScalarEntity)1 ServiceGraph (org.opentosca.toscana.core.parse.model.ServiceGraph)1 BaseToscaElement (org.opentosca.toscana.model.BaseToscaElement)1