Search in sources :

Example 6 with ComplianceCheckingException

use of org.eclipse.winery.compliance.checking.ComplianceCheckingException in project winery by eclipse.

the class ComplianceRuleCheckerTests method completeRule.

@Test
public void completeRule() {
    ComplianceRuleChecker checker = new ComplianceRuleChecker(null, null, null);
    checker.setToCheckTemplate(topologyTemplateToSearchIn);
    checker.setIdentifierTemplate(unrelatedTopology);
    checker.setRequiredStructureTemplate(requiredStructure);
    ComplianceCheckingException expected = null;
    try {
        checker.checkComplianceRule();
    } catch (ComplianceCheckingException e) {
        expected = e;
    }
    assertNotNull(expected);
    assertTrue(StringUtils.equals(ComplianceCheckingException.IDENTIFIER_NOT_IN_REQUIREDSTRUCTURE, expected.getMessage()));
}
Also used : ComplianceCheckingException(org.eclipse.winery.compliance.checking.ComplianceCheckingException) ComplianceRuleChecker(org.eclipse.winery.compliance.checking.ComplianceRuleChecker) Test(org.junit.jupiter.api.Test)

Aggregations

ComplianceCheckingException (org.eclipse.winery.compliance.checking.ComplianceCheckingException)6 ComplianceRuleChecker (org.eclipse.winery.compliance.checking.ComplianceRuleChecker)6 Test (org.junit.jupiter.api.Test)5 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 QName (javax.xml.namespace.QName)1 DefinitionsChildId (org.eclipse.winery.common.ids.definitions.DefinitionsChildId)1 NodeTypeId (org.eclipse.winery.common.ids.definitions.NodeTypeId)1 RelationshipTypeId (org.eclipse.winery.common.ids.definitions.RelationshipTypeId)1 TOSCAModelHelper.createNodeTypeId (org.eclipse.winery.compliance.TOSCAModelHelper.createNodeTypeId)1 TOSCAModelHelper.createTComplianceRule (org.eclipse.winery.compliance.TOSCAModelHelper.createTComplianceRule)1 TOSCAModelHelper.createTNodeTemplate (org.eclipse.winery.compliance.TOSCAModelHelper.createTNodeTemplate)1 TOSCAModelHelper.createTNodeType (org.eclipse.winery.compliance.TOSCAModelHelper.createTNodeType)1 TOSCAModelHelper.createTTopologyTemplate (org.eclipse.winery.compliance.TOSCAModelHelper.createTTopologyTemplate)1 TOSCAEdge (org.eclipse.winery.compliance.model.TOSCAEdge)1 TOSCANode (org.eclipse.winery.compliance.model.TOSCANode)1 TComplianceRule (org.eclipse.winery.model.tosca.TComplianceRule)1 TExtensibleElements (org.eclipse.winery.model.tosca.TExtensibleElements)1 TNodeTemplate (org.eclipse.winery.model.tosca.TNodeTemplate)1