Commit d48c8871 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Merge branch '3816' into 'master'

3816: Adding a platform architecture results into an NPE

See merge request af3/af3!234
parents a694c0b8 0b5ae69d
......@@ -3,7 +3,7 @@ ComponentArchitectureTransformationBase.java ad6f06093cb813a05d13e87bbd0d620b43d
ComponentArchitectureUtils.java bb7964823a64af71d55a1bdf430c79792ad3edb0 GREEN
ComponentLibraryModelElementFactory.java b6c854e91d431fa3bc42fafdcf618a2040d23ab4 GREEN
ComponentLibraryUtils.java bab1cd340e2e724eedaabb4d2b455cba111b511b GREEN
ComponentModelElementFactory.java e64448ecd2185db90608862276d68bea23be9452 GREEN
ComponentModelElementFactory.java 962a6d69ba7d5b45dbbf046e9f51af53a835898a RED
ComponentProgramUtils.java 71faad6256159ee2d59843fcde83ac6995dff0fe GREEN
ComponentUtils.java d4aa3db08fafafaa937b976c85762f1009fa8dc7 GREEN
FormalAnalysisTransformationUtils.java 9c70f8b562f3861f3554157cc96bf2cd91767c4b GREEN
......
......@@ -67,7 +67,7 @@ public final class ComponentModelElementFactory {
public static ComponentArchitecture createComponentArchitecture() {
ComponentArchitecture arch = AF3ComponentFactory.eINSTANCE.createComponentArchitecture();
arch.setName("Component Architecture");
Component hiddenRoot = createComponent("Component Architecture Root", "");
Component hiddenRoot = createComponent("Component Architecture", "");
arch.getContainedElements().add(hiddenRoot);
return arch;
}
......
......@@ -582,7 +582,7 @@ public class EditorTest {
/** Create a component. */
private void canCreateComponent(SWTBotTreeItem treeItemAF3Project) throws Exception {
treeItemAF3Project.contextMenu("Component Architecture").click();
treeItemAF3Project.getNode("Component Architecture Root").contextMenu("Component").click();
treeItemAF3Project.getNode("Component Architecture").contextMenu("Component").click();
bot.activeEditor().save();
}
......@@ -592,7 +592,7 @@ public class EditorTest {
editor.show();
editor.bot().button(1).click();
SWTBotShell shell = bot.activeShell();
shell.bot().tree().expandNode("Component Architecture Root").select("Component");
shell.bot().tree().expandNode("Component Architecture").select("Component");
shell.bot().button("OK").click();
}
......
......@@ -743,7 +743,7 @@ public class MiraHelpTest {
editor.bot().buttonWithTooltip("Assign target").click();
shell = bot.activeShell();
shell.bot().tree().expandNode("Component Architecture Root").select("Component");
shell.bot().tree().expandNode("Component Architecture").select("Component");
shell.bot().button("OK").click();
}
......@@ -759,7 +759,7 @@ public class MiraHelpTest {
editor.bot().buttonWithTooltip("Assign target").click();
SWTBotShell shell = bot.activeShell();
shell.bot().tree().expandNode("Component Architecture Root").select("Component");
shell.bot().tree().expandNode("Component Architecture").select("Component");
shell.bot().button("OK").click();
editor.bot().button("Add refinement specification", 1).click();
......@@ -887,7 +887,7 @@ public class MiraHelpTest {
/** Create a component. */
private void canCreateComponent(SWTBotTreeItem treeItemAF3Project) throws Exception {
treeItemAF3Project.contextMenu("Component Architecture").click();
treeItemAF3Project.getNode("Component Architecture Root").contextMenu("Component").click();
treeItemAF3Project.getNode("Component Architecture").contextMenu("Component").click();
bot.activeEditor().save();
}
......@@ -897,7 +897,7 @@ public class MiraHelpTest {
editor.show();
editor.bot().buttonWithTooltip("Assign Scope").click();
SWTBotShell shell = bot.activeShell();
shell.bot().tree().expandNode("Component Architecture Root").select("Component");
shell.bot().tree().expandNode("Component Architecture").select("Component");
shell.bot().button("OK").click();
}
......
......@@ -298,7 +298,7 @@ public class MiraRelationTest {
// In the external traces editor.
editor.bot().buttonWithTooltip("Assign target").click();
shell = bot.activeShell();
shell.bot().tree(0).expandNode("Component Architecture Root").select("Component");
shell.bot().tree(0).expandNode("Component Architecture").select("Component");
bot.button("OK").click();
// Check refinement specification.
......@@ -327,7 +327,7 @@ public class MiraRelationTest {
/** Create a component. */
private void canCreateComponent(SWTBotTreeItem treeItemAF3Project) throws Exception {
treeItemAF3Project.contextMenu("Component Architecture").click();
treeItemAF3Project.getNode("Component Architecture Root").contextMenu("Component").click();
treeItemAF3Project.getNode("Component Architecture").contextMenu("Component").click();
bot.activeEditor().save();
}
......@@ -337,7 +337,7 @@ public class MiraRelationTest {
editor.show();
editor.bot().buttonWithTooltip("Assign Scope").click();
SWTBotShell shell = bot.activeShell();
shell.bot().tree().expandNode("Component Architecture Root").select("Component");
shell.bot().tree().expandNode("Component Architecture").select("Component");
shell.bot().button("OK").click();
}
......
AuthorConstraint.java 388bf883f2d3c1d0d2b062a5c698914d0570b8b7 GREEN
ComponentExistsConstraint.java 9e0048c7452adcea6d8424722b4a2622289bcec7 GREEN
ComponentNameMeaningfulConstraint.java 8a023a0360f3d4e062da5b20b1ca3d91972e871d GREEN
ComponentNameMeaningfulConstraint.java cb187db98094a1c34845311952e161e1bb13c22c GREEN
ComponentPackageExistsConstraint.java a9046afa399d1064f00daf5c374deaf5967d271b GREEN
ComponentToRequirementTraceExistsConstraint.java 0d48c8ca5a223df9710a483f2d6d1a814011bd71 GREEN
ComponentToRequirementTraceExistsConstraint.java aa30b5454e8be7dcbb64e5439b8c103fe8e75259 GREEN
DescriptionAndOrConstraint.java 8e55d44b4f447bdc1e181e5100a03095db707526 GREEN
DescriptionConstraint.java d939aa5b55ac78f104dcc3fc1b503ef9bc8c1f29 GREEN
EveryDefinedSignalIsUsed.java 622900d37785bafe5da7edc2f45576559efd6a70 GREEN
......@@ -28,5 +28,4 @@ ReviewUnambiguousConstraint.java 6f8933d64bf57a2c0e3bd61de3baed2eed80c983 GREEN
ReviewVerifiableConstraint.java ed9ad8e1f635615989afe31da3afa6e684220457 GREEN
SignalConstraints.java c725bf91ebb910d962b55a0eabb75c90c60b46fc GREEN
SourceConstraint.java 497707ee5694c8eff896a527fd40a7f3bb1bf1a0 GREEN
TraceConstraint.java 9609f4a218174048004052020bba9adeb71907eb GREEN
TraceNotEmptyConstraint.java abce9f5f72f8359405e1538293c232251c1b147a GREEN
......@@ -33,26 +33,19 @@ public class ComponentNameMeaningfulConstraint extends ComponentConstraintGroup
@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);
String name = comp.getName().toLowerCase();
if(name.startsWith("component architecture")) {
// If top component node is available, set traceAvailable to true
return successIfTrue(true);
}
// check for default pattern
if((comp.getName().trim().isEmpty() || comp.getName().length() == 1 ||
comp.getName().equalsIgnoreCase("component") ||
comp.getName().equalsIgnoreCase("componen") ||
comp.getName().equalsIgnoreCase("compone") ||
comp.getName().equalsIgnoreCase("compon") ||
comp.getName().equalsIgnoreCase("compo") ||
comp.getName().equalsIgnoreCase("comp") || comp.getName().equalsIgnoreCase("com") ||
comp.getName().equalsIgnoreCase("co") || comp.getName().matches(".*\\d+.*"))) {
meaningfulName = false;
if((name.trim().isEmpty() || name.length() == 1 || "component".startsWith(name) ||
name.matches(".*\\d+.*"))) {
return successIfTrue(false);
}
return successIfTrue(meaningfulName == true);
return successIfTrue(true);
}
/** {@inheritDoc} */
......
......@@ -51,9 +51,8 @@ public class ComponentToRequirementTraceExistsConstraint extends ComponentConstr
if(componentTraceAvailable == true) {
traceAvailable = true;
}
if(comp.getName().equalsIgnoreCase("Component Architecture Root")) {
// if top component node is available. don't do anything but make the traceAvailable
// to true
if(comp.getName().toLowerCase().startsWith("component architecture")) {
// If top component node is available, set traceAvailable to true
traceAvailable = true;
}
return successIfTrue(traceAvailable);
......
DevelopmentProcessConfigurationCompositor.java 575dca049c6d894febee9ffaa9275e9378b67d40 GREEN
ExecutionConfigurationStoreCompositor.java bab1bb181390f0d0d82df492113a6053aaae24e5 GREEN
FileProjectCompositor.java a6cc57929744fd3fdf85d1efe6279e6ffb9c4dc2 GREEN
FileProjectCompositor.java 4c37b0e6df0dfc97c952a3551f99f20b907de93b GREEN
......@@ -15,12 +15,11 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.project.compositor;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.model.ProjectConfiguration;
import org.fortiss.af3.project.model.execution.ExecutionConfigurationStore;
import org.fortiss.tooling.base.compose.ModelElementCompositorBase;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
......@@ -31,7 +30,7 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement;
*
* @author hoelzl
*/
public class FileProjectCompositor implements IElementCompositor<FileProject> {
public class FileProjectCompositor extends ModelElementCompositorBase<FileProject> {
/** {@inheritDoc} */
@Override
......@@ -50,6 +49,7 @@ public class FileProjectCompositor implements IElementCompositor<FileProject> {
@Override
public boolean compose(FileProject container, EObject contained,
IElementCompositionContext context) {
super.compose(container, contained, context);
return container.getRootElements().add((IProjectRootElement)contained);
}
......@@ -64,11 +64,4 @@ public class FileProjectCompositor implements IElementCompositor<FileProject> {
public boolean canDecompose(EObject contained) {
return isCorrectElementClass(contained);
}
/** {@inheritDoc} */
@Override
public boolean decompose(EObject contained) {
delete(contained, true);
return true;
}
}
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