Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/TTCN3Validator.xtend +76 −4 Original line number Diff line number Diff line Loading @@ -1630,9 +1630,6 @@ class TTCN3Validator extends AbstractTTCN3Validator { return false } /** * END: Test Suite Modularization ------------------------------------------------------------------------------ */ @Check def checkModuleSize(TTCN3Module module) { if (!activeProfile.checkModuleSize) { Loading @@ -1647,7 +1644,7 @@ class TTCN3Validator extends AbstractTTCN3Validator { " bytes) than the maximum allowed module size (" + referenceSize + " bytes)!" warning( message, null, //TODO: EStructuralFeature TTCN3Package.eINSTANCE.TTCN3Reference_Name, MessageClass.MODULARIZATION.toString, node.startLine.toString, node.endLine.toString, Loading @@ -1656,6 +1653,81 @@ class TTCN3Validator extends AbstractTTCN3Validator { } } @Check def checkTypesAndValuesModuleImportsLibNames(TTCN3Module module) { if (!activeProfile.checkTypesAndValuesModuleImportsLibNames) return; val Pattern typesAndValuesImportsLibNamesExcludedPattern = Pattern.compile( activeProfile.getTypesAndValuesImportsLibNamesExcludedRegExp()) val Matcher typesAndValuesImportsLibNamesExcludedMatcher = typesAndValuesImportsLibNamesExcludedPattern. matcher(module.name) if (!module.name.contains(ModuleContentHelper.TypesAndValuesModuleIDSubstring) || typesAndValuesImportsLibNamesExcludedMatcher.matches()) return; val Pattern typesAndValuesImportsLibNamesPattern = Pattern.compile( activeProfile.getTypesAndValuesImportsLibNamesRegExp()); var Matcher typesAndValuesImportsLibNamesMatcher = null; var libCommonReferenceFound = false; for (i : module.getAllContentsOfType(ImportDef)) { typesAndValuesImportsLibNamesMatcher = typesAndValuesImportsLibNamesPattern.matcher(i.moduleNamespace) if (typesAndValuesImportsLibNamesMatcher.matches()) { libCommonReferenceFound = true } } if (!libCommonReferenceFound) { val message = "Required import from \"" + activeProfile.getTypesAndValuesImportsLibNamesRegExp() + "\" not found!!" val INode node = NodeModelUtils.getNode(module) warning( message, TTCN3Package.eINSTANCE.TTCN3Reference_Name, MessageClass.MODULARIZATION.toString, node.startLine.toString, node.endLine.toString, "7.3, " + MiscTools.getMethodName() ); } } @Check def checkTestcasesModuleImportsLibCommon_Sync(TTCN3Module module) { if (!activeProfile.checkTestcasesModuleImportsLibCommon_Sync) return; if ((!module.name.contains("Testcases")) || module.name.contains("LibCommon_Sync")) { return } var libCommonReferenceFound = false; for (i : module.getAllContentsOfType(ImportDef)) { if (i.moduleNamespace.contains("LibCommon_Sync")) { libCommonReferenceFound = true } } if (!libCommonReferenceFound) { val message = "Required import from \"LibCommon_Sync\" not found!" val INode node = NodeModelUtils.getNode(module) warning( message, TTCN3Package.eINSTANCE.TTCN3Reference_Name, MessageClass.MODULARIZATION.toString, node.startLine.toString, node.endLine.toString, "7.11, " + MiscTools.getMethodName() ); } } /** * END: Test Suite Modularization ------------------------------------------------------------------------------ */ //TODO: update error parameters /* Loading Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/TTCN3Validator.xtend +76 −4 Original line number Diff line number Diff line Loading @@ -1630,9 +1630,6 @@ class TTCN3Validator extends AbstractTTCN3Validator { return false } /** * END: Test Suite Modularization ------------------------------------------------------------------------------ */ @Check def checkModuleSize(TTCN3Module module) { if (!activeProfile.checkModuleSize) { Loading @@ -1647,7 +1644,7 @@ class TTCN3Validator extends AbstractTTCN3Validator { " bytes) than the maximum allowed module size (" + referenceSize + " bytes)!" warning( message, null, //TODO: EStructuralFeature TTCN3Package.eINSTANCE.TTCN3Reference_Name, MessageClass.MODULARIZATION.toString, node.startLine.toString, node.endLine.toString, Loading @@ -1656,6 +1653,81 @@ class TTCN3Validator extends AbstractTTCN3Validator { } } @Check def checkTypesAndValuesModuleImportsLibNames(TTCN3Module module) { if (!activeProfile.checkTypesAndValuesModuleImportsLibNames) return; val Pattern typesAndValuesImportsLibNamesExcludedPattern = Pattern.compile( activeProfile.getTypesAndValuesImportsLibNamesExcludedRegExp()) val Matcher typesAndValuesImportsLibNamesExcludedMatcher = typesAndValuesImportsLibNamesExcludedPattern. matcher(module.name) if (!module.name.contains(ModuleContentHelper.TypesAndValuesModuleIDSubstring) || typesAndValuesImportsLibNamesExcludedMatcher.matches()) return; val Pattern typesAndValuesImportsLibNamesPattern = Pattern.compile( activeProfile.getTypesAndValuesImportsLibNamesRegExp()); var Matcher typesAndValuesImportsLibNamesMatcher = null; var libCommonReferenceFound = false; for (i : module.getAllContentsOfType(ImportDef)) { typesAndValuesImportsLibNamesMatcher = typesAndValuesImportsLibNamesPattern.matcher(i.moduleNamespace) if (typesAndValuesImportsLibNamesMatcher.matches()) { libCommonReferenceFound = true } } if (!libCommonReferenceFound) { val message = "Required import from \"" + activeProfile.getTypesAndValuesImportsLibNamesRegExp() + "\" not found!!" val INode node = NodeModelUtils.getNode(module) warning( message, TTCN3Package.eINSTANCE.TTCN3Reference_Name, MessageClass.MODULARIZATION.toString, node.startLine.toString, node.endLine.toString, "7.3, " + MiscTools.getMethodName() ); } } @Check def checkTestcasesModuleImportsLibCommon_Sync(TTCN3Module module) { if (!activeProfile.checkTestcasesModuleImportsLibCommon_Sync) return; if ((!module.name.contains("Testcases")) || module.name.contains("LibCommon_Sync")) { return } var libCommonReferenceFound = false; for (i : module.getAllContentsOfType(ImportDef)) { if (i.moduleNamespace.contains("LibCommon_Sync")) { libCommonReferenceFound = true } } if (!libCommonReferenceFound) { val message = "Required import from \"LibCommon_Sync\" not found!" val INode node = NodeModelUtils.getNode(module) warning( message, TTCN3Package.eINSTANCE.TTCN3Reference_Name, MessageClass.MODULARIZATION.toString, node.startLine.toString, node.endLine.toString, "7.11, " + MiscTools.getMethodName() ); } } /** * END: Test Suite Modularization ------------------------------------------------------------------------------ */ //TODO: update error parameters /* Loading