Search in sources :

Example 61 with NodeTypeId

use of org.eclipse.winery.model.ids.definitions.NodeTypeId in project winery by eclipse.

the class ConsistencyCheckerTest method openToscaNamespaceIsNotLowerCaseErrorNotRaisedAtQNameHavingCasedLocalName.

@ParameterizedTest()
@MethodSource("getCamelCasedOpenToscaQNames")
public void openToscaNamespaceIsNotLowerCaseErrorNotRaisedAtQNameHavingCasedLocalName(QName qname) {
    NodeTypeId id = new NodeTypeId(qname);
    ConsistencyErrorCollector errorLogger = new ConsistencyErrorCollector();
    consistencyChecker.checkNamespaceUri(id);
    assertEquals(Collections.emptyMap(), errorLogger.getErrorList());
}
Also used : NodeTypeId(org.eclipse.winery.model.ids.definitions.NodeTypeId) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 62 with NodeTypeId

use of org.eclipse.winery.model.ids.definitions.NodeTypeId in project winery by eclipse.

the class Ec2AmiRefinementPlugin method getDetectorGraphs.

@Override
protected List<TTopologyTemplate> getDetectorGraphs() {
    IRepository repository = RepositoryFactory.getRepository();
    TNodeType computeType = repository.getElement(new NodeTypeId(COMPUTE_QNAME));
    TNodeTemplate compute = ModelUtilities.instantiateNodeTemplate(computeType);
    LinkedHashMap<String, String> computeKvProperties = new LinkedHashMap<>();
    String detectorPropertyRegex = typeByAmi.keySet().stream().collect(Collectors.joining("|", "(", ")"));
    computeKvProperties.put(PROPERTY_EC2_AMI, detectorPropertyRegex);
    TEntityTemplate.WineryKVProperties computeProperties = new TEntityTemplate.WineryKVProperties();
    computeProperties.setKVProperties(computeKvProperties);
    compute.setProperties(computeProperties);
    return Collections.singletonList(new TTopologyTemplate.Builder().addNodeTemplate(compute).build());
}
Also used : TEntityTemplate(org.eclipse.winery.model.tosca.TEntityTemplate) TTopologyTemplate(org.eclipse.winery.model.tosca.TTopologyTemplate) NodeTypeId(org.eclipse.winery.model.ids.definitions.NodeTypeId) IRepository(org.eclipse.winery.repository.backend.IRepository) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate) TNodeType(org.eclipse.winery.model.tosca.TNodeType) LinkedHashMap(java.util.LinkedHashMap)

Example 63 with NodeTypeId

use of org.eclipse.winery.model.ids.definitions.NodeTypeId in project winery by eclipse.

the class MySqlDbRefinementPlugin method getDetectorGraphs.

@Override
protected List<TTopologyTemplate> getDetectorGraphs() {
    IRepository repository = RepositoryFactory.getRepository();
    TNodeType mySQLType = repository.getElement(new NodeTypeId(mySqlDbQName));
    TNodeTemplate mySQL_DBMS = ModelUtilities.instantiateNodeTemplate(mySQLType);
    return Collections.singletonList(new TTopologyTemplate.Builder().addNodeTemplate(mySQL_DBMS).build());
}
Also used : TTopologyTemplate(org.eclipse.winery.model.tosca.TTopologyTemplate) NodeTypeId(org.eclipse.winery.model.ids.definitions.NodeTypeId) IRepository(org.eclipse.winery.repository.backend.IRepository) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate) TNodeType(org.eclipse.winery.model.tosca.TNodeType)

Example 64 with NodeTypeId

use of org.eclipse.winery.model.ids.definitions.NodeTypeId in project winery by eclipse.

the class MySqlDbmsRefinementPlugin method getDetectorGraphs.

@Override
protected List<TTopologyTemplate> getDetectorGraphs() {
    IRepository repository = RepositoryFactory.getRepository();
    TNodeType mySQLType = repository.getElement(new NodeTypeId(mySqlName));
    TNodeTemplate mySQL_DBMS = ModelUtilities.instantiateNodeTemplate(mySQLType);
    return Collections.singletonList(new TTopologyTemplate.Builder().addNodeTemplate(mySQL_DBMS).build());
}
Also used : TTopologyTemplate(org.eclipse.winery.model.tosca.TTopologyTemplate) NodeTypeId(org.eclipse.winery.model.ids.definitions.NodeTypeId) IRepository(org.eclipse.winery.repository.backend.IRepository) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate) TNodeType(org.eclipse.winery.model.tosca.TNodeType)

Example 65 with NodeTypeId

use of org.eclipse.winery.model.ids.definitions.NodeTypeId in project winery by eclipse.

the class SpringWebAppRefinementPlugin method createPetClinicDetector.

private TTopologyTemplate createPetClinicDetector(IRepository repository) {
    TNodeType petClinicType = repository.getElement(new NodeTypeId(petClinic));
    TNodeTemplate petClinic = ModelUtilities.instantiateNodeTemplate(petClinicType);
    return new TTopologyTemplate.Builder().addNodeTemplate(petClinic).build();
}
Also used : NodeTypeId(org.eclipse.winery.model.ids.definitions.NodeTypeId) TNodeTemplate(org.eclipse.winery.model.tosca.TNodeTemplate) TNodeType(org.eclipse.winery.model.tosca.TNodeType)

Aggregations

NodeTypeId (org.eclipse.winery.model.ids.definitions.NodeTypeId)67 TNodeType (org.eclipse.winery.model.tosca.TNodeType)36 TNodeTemplate (org.eclipse.winery.model.tosca.TNodeTemplate)28 Test (org.junit.jupiter.api.Test)27 DefinitionsChildId (org.eclipse.winery.model.ids.definitions.DefinitionsChildId)23 QName (javax.xml.namespace.QName)21 IRepository (org.eclipse.winery.repository.backend.IRepository)20 RelationshipTypeId (org.eclipse.winery.model.ids.definitions.RelationshipTypeId)15 TTopologyTemplate (org.eclipse.winery.model.tosca.TTopologyTemplate)15 WineryVersion (org.eclipse.winery.common.version.WineryVersion)14 Response (javax.ws.rs.core.Response)13 IOException (java.io.IOException)12 LinkedHashMap (java.util.LinkedHashMap)12 ServiceTemplateId (org.eclipse.winery.model.ids.definitions.ServiceTemplateId)11 TServiceTemplate (org.eclipse.winery.model.tosca.TServiceTemplate)11 ArtifactTemplateId (org.eclipse.winery.model.ids.definitions.ArtifactTemplateId)10 TRelationshipTemplate (org.eclipse.winery.model.tosca.TRelationshipTemplate)10 ArrayList (java.util.ArrayList)9 TDefinitions (org.eclipse.winery.model.tosca.TDefinitions)9 TEntityTemplate (org.eclipse.winery.model.tosca.TEntityTemplate)9