Commit 06f414bb authored by Saad bin Abid's avatar Saad bin Abid
Browse files

review ready

parent 5e7697ba
......@@ -21,6 +21,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.fortiss.af3.mira.constraints.AuthorConstraint;
import org.fortiss.af3.mira.constraints.CheckListReviewConstraint;
import org.fortiss.af3.mira.constraints.ComponentExistsConstraint;
import org.fortiss.af3.mira.constraints.ComponentNameMeaningfulConstraint;
import org.fortiss.af3.mira.constraints.ComponentToRequirementTraceExistsConstraint;
import org.fortiss.af3.mira.constraints.DescriptionAndOrConstraint;
import org.fortiss.af3.mira.constraints.DescriptionConstraint;
......@@ -43,6 +44,7 @@ import org.fortiss.af3.mira.constraints.TraceNotEmptyConstraint;
import org.fortiss.af3.mira.ui.constraints.AuthorConstraintUI;
import org.fortiss.af3.mira.ui.constraints.CheckListReviewConstraintUI;
import org.fortiss.af3.mira.ui.constraints.ComponentExistsConstraintUI;
import org.fortiss.af3.mira.ui.constraints.ComponentNameMeaningfulConstraintUI;
import org.fortiss.af3.mira.ui.constraints.ComponentToRequirementTraceExistsConstraintUI;
import org.fortiss.af3.mira.ui.constraints.DescriptionAndOrConstraintUI;
import org.fortiss.af3.mira.ui.constraints.DescriptionConstraintUI;
......@@ -148,6 +150,8 @@ public class AF3MiraUIActivator extends AbstractUIPlugin {
IConstraintUIService.getInstance().registerConstraintUI(
RequirementImplementedCorrectlyConstraintUI.class,
RequirementImplementedCorrectlyConstraint.class);
IConstraintUIService.getInstance().registerConstraintUI(
ComponentNameMeaningfulConstraintUI.class, ComponentNameMeaningfulConstraint.class);
}
/** {@inheritDoc} */
......
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author abid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 6F29232CC159E38AACDBAFDD48EA0A62
* @ConQAT.Rating YELLOW Hash: 0AA21487F5DBCAEDD91B5BBFF9E5F73C
*/
public class AuthorConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -25,7 +25,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.ConstraintUIBases.Constraint
* @author abid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 6F29232CC159E38AACDBAFDD48EA0A62
* @ConQAT.Rating YELLOW Hash: CE98FE275FE032C0601D47D994ABA632
*/
public class CheckListReviewConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -25,7 +25,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.ConstraintUIBases.Constraint
* @author abid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 6F29232CC159E38AACDBAFDD48EA0A62
* @ConQAT.Rating YELLOW Hash: 09ED5CBD472EA91717BA4B6CA2CC96D9
*/
public class ComponentExistsConstraintUI extends ConstraintUIBaseAutocheck {
......
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.ui.constraints;
import org.fortiss.tooling.kernel.ui.extension.base.ConstraintUIBases.ConstraintUIBaseAutocheck;
/**
* UI part of {@link org.fortiss.af3.mira.constraints.ComponentNameMeaningfulConstraint}
*
* @author abid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 09ED5CBD472EA91717BA4B6CA2CC96D9
*/
public class ComponentNameMeaningfulConstraintUI extends ConstraintUIBaseAutocheck {
/** {@inheritDoc} */
@Override
public String getDescription() {
return "All components should have a meaningful name";
}
/** {@inheritDoc} */
@Override
public boolean shouldBeManuallyActivated() {
return true;
}
}
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author abid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 6F29232CC159E38AACDBAFDD48EA0A62
* @ConQAT.Rating YELLOW Hash: 0DD3310CB649C9A2F308E032AE8A7715
*/
public class ComponentToRequirementTraceExistsConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author saadbinabid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 9374180DADC17533C8947691F94DB7F0
* @ConQAT.Rating YELLOW Hash: 0B0F6EECF90A754DA6453476DFD04516
*/
public class DescriptionAndOrConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author saadbinabid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: B4D0F1406EAD59F5E04D95F54912F6DF
* @ConQAT.Rating YELLOW Hash: DF99BC4CFE7C4636B4734792A6BF6C3A
*/
public class DescriptionConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -38,7 +38,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author saadbinabid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 869F03936709C6F2B2502F44F17E3D7C
* @ConQAT.Rating YELLOW Hash: CED9688D46C5C555F4F71198159B2C71
*/
public class GlossaryTermDefinitionConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author saadbinabid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 568D89650BF1E9DF8F215896E3E60F8F
* @ConQAT.Rating YELLOW Hash: D24200404D15BE5DAFC72DBC60548FE2
*/
public class IDConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author saadbinabid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: B33F3C332C541E7647CA951E4610A583
* @ConQAT.Rating YELLOW Hash: CF42A3931472C3D3F22E9BAD606FEB15
*/
public class ParameterTypeConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: BD13EC9A3710B76880C5F72FEF143793
* @ConQAT.Rating YELLOW Hash: 5402C50AD265D363859A06642B3F98EB
*/
public class RationaleConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author abid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 6F29232CC159E38AACDBAFDD48EA0A62
* @ConQAT.Rating YELLOW Hash: 3607C37E23C3A11B764E52A0F217C777
*/
public class RequirementImplementedCorrectlyConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -44,7 +44,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 86A1D4160055D05AA4E827E3F0DC0D7C
* @ConQAT.Rating YELLOW Hash: 2DFC9F1DC3094D901AF66C100F57ED0D
*/
public class SignalConstraintsUI {
......
......@@ -34,7 +34,7 @@ import org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 6135C85E7436CE68826A5D323C7D3C0C
* @ConQAT.Rating YELLOW Hash: B2E10039849437AFE28A9824D4BD187F
*/
public class SourceConstraintUI extends ConstraintUIBaseAutocheck {
......
......@@ -44,7 +44,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.ConstraintUIBases;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: A7C4A32EB03DF2DBE7BA9D1AD67944A4
* @ConQAT.Rating YELLOW Hash: 5F64F9EE7425202233F01AAE7933EB3B
*/
public class TraceConstraintUI extends ConstraintUIBases.ConstraintUIBase {
......
......@@ -21,6 +21,7 @@ import org.eclipse.core.runtime.Plugin;
import org.fortiss.af3.mira.constraints.AuthorConstraint;
import org.fortiss.af3.mira.constraints.CheckListReviewConstraint;
import org.fortiss.af3.mira.constraints.ComponentExistsConstraint;
import org.fortiss.af3.mira.constraints.ComponentNameMeaningfulConstraint;
import org.fortiss.af3.mira.constraints.ComponentToRequirementTraceExistsConstraint;
import org.fortiss.af3.mira.constraints.DescriptionAndOrConstraint;
import org.fortiss.af3.mira.constraints.DescriptionConstraint;
......@@ -97,6 +98,8 @@ public class AF3MiraActivator extends Plugin {
ComponentToRequirementTraceExistsConstraint.class);
IConstraintService.getInstance().registerConstraint(
RequirementImplementedCorrectlyConstraint.class);
IConstraintService.getInstance()
.registerConstraint(ComponentNameMeaningfulConstraint.class);
}
/** {@inheritDoc} */
......
......@@ -49,7 +49,7 @@ import org.fortiss.tooling.kernel.extension.data.Prototype;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 2A0F884220BBF4BA763D8F3C83D2123A
* @ConQAT.Rating YELLOW Hash: DC5D72B1575077D74A4F43D24565312D
*/
public class RequirementCompositor extends HierarchicElementCompositorBase<Requirement> {
......
......@@ -30,7 +30,7 @@ import org.fortiss.tooling.kernel.model.constraints.IConstraintInstanceStatus;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 2A820473075B7F39CA1DE608EF283391
* @ConQAT.Rating YELLOW Hash: FDEBC9B06EC5621F99F0C2F4E9099374
*/
public class AuthorConstraint extends AF3ProjectConstraintCheckerBase {
......
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.constraints;
import static org.fortiss.tooling.kernel.utils.ConstraintsUtils.successIfTrue;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.project.utils.ConstraintsProjectUtils.AF3ProjectConstraintCheckerBase;
import org.fortiss.tooling.kernel.model.constraints.IConstrained;
import org.fortiss.tooling.kernel.model.constraints.IConstraintInstanceStatus;
/**
* Constraint to ensure that the of a component has a meaningful name.
*
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash: 74D2099F2FAEC95FEFD0DDE738E699EC
*/
public class ComponentNameMeaningfulConstraint extends AF3ProjectConstraintCheckerBase {
/** {@inheritDoc} */
@Override
public IConstraintInstanceStatus verify(IConstrained constrained) {
boolean meaningfulName = true;
Component comp = (Component)constrained;
if(comp.getName().equalsIgnoreCase("Component Architecture Root")) {
// if top component node is available. don't do anything but make the traceAvailable
// to true
meaningfulName = true;
return successIfTrue(meaningfulName == true);
}
// check for default pattern
if(comp.getName().contains("Component") || comp.getName().trim().isEmpty() ||
comp.getName().length() == 1 || comp.getName().equalsIgnoreCase("component")) {
meaningfulName = false;
}
return successIfTrue(meaningfulName == true);
}
/** {@inheritDoc} */
@Override
public boolean isApplicable(IConstrained constrained) {
return constrained instanceof Component;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment