Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-06-04 08:38:45 -0400
committerptessier2014-06-04 08:38:45 -0400
commit3b33fe3e22b703abf17395c41d591807dd35f6b6 (patch)
tree5c441a0344f67a2281c20b4bebd46ea2bbfeb86e
parentbc8db3d07569c4067921fba51d7fd10d0a0332c3 (diff)
downloadorg.eclipse.papyrus-3b33fe3e22b703abf17395c41d591807dd35f6b6.tar.gz
org.eclipse.papyrus-3b33fe3e22b703abf17395c41d591807dd35f6b6.tar.xz
org.eclipse.papyrus-3b33fe3e22b703abf17395c41d591807dd35f6b6.zip
436569: [Diagram Version] test that diagram has a version
https://bugs.eclipse.org/bugs/show_bug.cgi?id=436569 Merge branch 'master' of ssh://ptessier@git.eclipse.org:29418/papyrus/org.eclipse.papyrus Change-Id: I4426bf3205edf9c1397d2204cf02383fa91c86ce
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/GenericDiagramFucntion.uml2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src-gen/org/eclipse/papyrus/uml/diagram/interactionoverview/factory/InteractionOverviewDiagramViewFactory.java9
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/.settings/org.eclipse.jdt.core.prefs5
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractPapyrusTestCase.java55
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestMultiLink.java36
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java54
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildLabel.java86
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildNode.java3
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestCommentLink.java8
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestConstraintLink.java8
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestContainmentLink.java20
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java64
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLinkOwnedBySource.java8
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestNested.java16
15 files changed, 193 insertions, 183 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend
index 0019f97e6b6..92a862615da 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend
@@ -24,7 +24,7 @@ import xpt.Common
override implementsList(GenLinkLabel it) '''
- implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart
+ implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart, org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit
««« BEGIN: PapyrusGenCode
«IF it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v |v.externalNodeLabels.contains(it)].size != 0»
, org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/GenericDiagramFucntion.uml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/GenericDiagramFucntion.uml
index d9efef0e539..35cedd02933 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/GenericDiagramFucntion.uml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/GenericDiagramFucntion.uml
@@ -15,6 +15,7 @@
<packagedElement xmi:type="uml:Class" xmi:id="_seSb0GP6EeOq0pDGL_YBMA" name="Edit Grid and Ruler Property"/>
<packagedElement xmi:type="uml:Class" xmi:id="_uKPAQGP6EeOq0pDGL_YBMA" name="Snap To Grid Behavior"/>
<packagedElement xmi:type="uml:Class" xmi:id="_UzjXQOGuEeO_JM12vRgWBQ" name="DropDromModelExplorer"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_dQjtQOvJEeOv4v5t8d2cOg" name="DiagramVersion"/>
</packagedElement>
<profileApplication xmi:type="uml:ProfileApplication" xmi:id="_V0CKUHaNEeKemeMpJaVA3A">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_V1EsIHaNEeKemeMpJaVA3A" source="http://www.eclipse.org/uml2/2.0.0/UML">
@@ -30,4 +31,5 @@
<Requirements:Requirement xmi:id="_tDokkGP6EeOq0pDGL_YBMA" text="The user must be able to change the Diagram Viewer properties (Snap To Grid/To Geometry, Show Rulers, Show Grid, Grid Style, Grid Color, Grid Order, Ruler Units, Grid Spacing )" id="Req_005" base_Class="_seSb0GP6EeOq0pDGL_YBMA"/>
<Requirements:Requirement xmi:id="_u_1LgGP6EeOq0pDGL_YBMA" text="Snap To Grid must be able to snap on : &#xD;&#xA;- 4 corners of rectangle&#xD;&#xA;- 4 middles of side of a rectangle&#xD;&#xA;- anchors of link&#xD;&#xA;- bendpoints" id="Req_005" base_Class="_uKPAQGP6EeOq0pDGL_YBMA"/>
<Requirements:Requirement xmi:id="_Uzo20OGuEeO_JM12vRgWBQ" text="Its possible to drop the seame element several time on the canva" id="Req006" base_Class="_UzjXQOGuEeO_JM12vRgWBQ"/>
+ <Requirements:Requirement xmi:id="_dQusYOvJEeOv4v5t8d2cOg" text="Each diagram must have a version inorder to able possble migration" id="Req007" base_Class="_dQjtQOvJEeOv4v5t8d2cOg"/>
</xmi:XMI>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src-gen/org/eclipse/papyrus/uml/diagram/interactionoverview/factory/InteractionOverviewDiagramViewFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src-gen/org/eclipse/papyrus/uml/diagram/interactionoverview/factory/InteractionOverviewDiagramViewFactory.java
index c00f984d212..e14ec1589d9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src-gen/org/eclipse/papyrus/uml/diagram/interactionoverview/factory/InteractionOverviewDiagramViewFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview/src-gen/org/eclipse/papyrus/uml/diagram/interactionoverview/factory/InteractionOverviewDiagramViewFactory.java
@@ -11,7 +11,9 @@
package org.eclipse.papyrus.uml.diagram.interactionoverview.factory;
import org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.MeasurementUnit;
+import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramVersioningUtils;
public class InteractionOverviewDiagramViewFactory extends DiagramViewFactory {
@@ -25,4 +27,11 @@ public class InteractionOverviewDiagramViewFactory extends DiagramViewFactory {
protected MeasurementUnit getMeasurementUnit() {
return MeasurementUnit.PIXEL_LITERAL;
}
+ @Override
+ protected Diagram createDiagramView() {
+ // TODO Auto-generated method stub
+ Diagram diagram= super.createDiagramView();
+ DiagramVersioningUtils.stampCurrentVersion(diagram);
+ return diagram;
+ }
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/.settings/org.eclipse.jdt.core.prefs
index 44217f8c068..a347708599f 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractPapyrusTestCase.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractPapyrusTestCase.java
index 729ba1efd36..86e466ec730 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractPapyrusTestCase.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractPapyrusTestCase.java
@@ -33,6 +33,9 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.StringValueStyle;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
@@ -43,6 +46,7 @@ import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.core.utils.DiResourceSet;
+import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramVersioningUtils;
import org.eclipse.papyrus.junit.utils.rules.HouseKeeper;
import org.eclipse.papyrus.junit.utils.tests.AbstractPapyrusTest;
import org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand;
@@ -73,43 +77,43 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
protected boolean operationFailed = false;
/** The Constant CREATION. */
- protected static final String CREATION = "CREATION:";
+ protected static final String CREATION = "CREATION:"; //$NON-NLS-1$
/** The Constant CONTAINER_CREATION. */
- protected static final String CONTAINER_CREATION = "CONTAINER CREATION: ";
+ protected static final String CONTAINER_CREATION = "CONTAINER CREATION: "; //$NON-NLS-1$
/** The Constant DROP. */
- protected static final String DROP = "DROP: ";
+ protected static final String DROP = "DROP: "; //$NON-NLS-1$
/** The Constant DESTROY_DELETION. */
- protected static final String DESTROY_DELETION = "DESTROY DELETION: ";
+ protected static final String DESTROY_DELETION = "DESTROY DELETION: "; //$NON-NLS-1$
/** The Constant COMMAND_NULL. */
- protected static final String COMMAND_NULL = " command null";
+ protected static final String COMMAND_NULL = " command null"; //$NON-NLS-1$
/** The Constant VIEW_DELETION. */
- protected static final String VIEW_DELETION = "VIEW DELETION: ";
+ protected static final String VIEW_DELETION = "VIEW DELETION: "; //$NON-NLS-1$
/** The Constant TEST_THE_REDO. */
- protected static final String TEST_THE_REDO = "test the redo";
+ protected static final String TEST_THE_REDO = "test the redo"; //$NON-NLS-1$
/** The Constant TEST_THE_UNDO. */
- protected static final String TEST_THE_UNDO = "test the undo";
+ protected static final String TEST_THE_UNDO = "test the undo"; //$NON-NLS-1$
/** The Constant TEST_THE_EXECUTION. */
- protected static final String TEST_THE_EXECUTION = "test the execution";
+ protected static final String TEST_THE_EXECUTION = "test the execution"; //$NON-NLS-1$
/** The Constant TEST_IF_THE_COMMAND_CAN_BE_EXECUTED. */
- protected static final String TEST_IF_THE_COMMAND_CAN_BE_EXECUTED = "test if the command can be executed";
+ protected static final String TEST_IF_THE_COMMAND_CAN_BE_EXECUTED = "test if the command can be executed"; //$NON-NLS-1$
/** The Constant TEST_IF_THE_COMMAND_IS_CREATED. */
- protected static final String TEST_IF_THE_COMMAND_IS_CREATED = "test if the command is created";
+ protected static final String TEST_IF_THE_COMMAND_IS_CREATED = "test if the command is created"; //$NON-NLS-1$
/** The Constant INITIALIZATION_TEST. */
- protected static final String INITIALIZATION_TEST = "Intitial State";
+ protected static final String INITIALIZATION_TEST = "Intitial State"; //$NON-NLS-1$
/** The Constant CHANGE_CONTAINER. */
- protected static final String CHANGE_CONTAINER = "CHANGE CONTAINER";
+ protected static final String CHANGE_CONTAINER = "CHANGE CONTAINER"; //$NON-NLS-1$
/** The papyrus editor. */
protected IMultiDiagramEditor papyrusEditor;
@@ -172,7 +176,7 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
public void run() {
try {
//if the diagram is a Profile we dont save it because we dont need to define it
- if(!diagramEditPart.getDiagramView().getType().equals("PapyrusUMLProfileDiagram")) {
+ if(!diagramEditPart.getDiagramView().getType().equals("PapyrusUMLProfileDiagram")) { //$NON-NLS-1$
papyrusEditor.doSave(new NullProgressMonitor());
}
@@ -190,7 +194,7 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
};
Display.getDefault().syncExec(runnable);
if(!runnable.getResult()) {
- Assert.fail("Cannot close the editor and delete the project");
+ Assert.fail("Cannot close the editor and delete the project"); //$NON-NLS-1$
}
}
@@ -203,8 +207,11 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
if(diagramEditPart == null) {
diagramEditor = (UmlGmfDiagramEditor)papyrusEditor.getActiveEditor();
diagramEditPart = (DiagramEditPart)papyrusEditor.getAdapter(DiagramEditPart.class);
- Assert.assertNotNull("Cannot find the diagram editor", diagramEditor);
- Assert.assertNotNull("Cannot find the Diagram edit part", diagramEditPart);
+ Assert.assertNotNull("Cannot find the diagram editor", diagramEditor); //$NON-NLS-1$
+ Assert.assertNotNull("Cannot find the Diagram edit part", diagramEditPart); //$NON-NLS-1$
+ StringValueStyle style=(StringValueStyle)diagramEditPart.getNotationView().getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), DiagramVersioningUtils.COMPATIBILITY_VERSION);
+ Assert.assertNotNull("A version lust be associated to a each diagram", style); //$NON-NLS-1$
+ Assert.assertTrue("The created diagram has not a good version",DiagramVersioningUtils.isOfCurrentPapyrusVersion((Diagram)diagramEditPart.getNotationView())); //$NON-NLS-1$
}
return diagramEditPart;
}
@@ -265,7 +272,7 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
diResource.save(null);
diResource.unload();
diResourceSet.createsModels(file);
- if(!file.getName().endsWith(".profile.di")) {
+ if(!file.getName().endsWith(".profile.di")) { //$NON-NLS-1$
new CreateUMLModelCommand().createModel(this.diResourceSet);
@@ -280,7 +287,7 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
// Apply the required profiles
ArrayList<IFile> modifiedFiles = new ArrayList<IFile>();
modifiedFiles.add(file);
- ICommand commandProfiles = new AbstractTransactionalCommand(diResourceSet.getTransactionalEditingDomain(), "Apply profiles", modifiedFiles) {
+ ICommand commandProfiles = new AbstractTransactionalCommand(diResourceSet.getTransactionalEditingDomain(), "Apply profiles", modifiedFiles) { //$NON-NLS-1$
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
@@ -317,12 +324,12 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
}
}
ICreationCommand command = getDiagramCommandCreation();
- command.createDiagram(diResourceSet, null, "DiagramToTest");
+ command.createDiagram(diResourceSet, null, "DiagramToTest"); //$NON-NLS-1$
diResourceSet.save(new NullProgressMonitor());
}
papyrusEditor = houseKeeper.openPapyrusEditor(file);
- Assert.assertNotNull("Failed to open the editor", papyrusEditor);
+ Assert.assertNotNull("Failed to open the editor", papyrusEditor); //$NON-NLS-1$
}
/**
@@ -359,7 +366,7 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
}
protected void assertLastOperationSuccessful() {
- Assert.assertFalse("The operation failed. Look at the log, or put a breakpoint on ExecutionException or DefaultOperationHistory#notifyNotOK to find the cause.", this.operationFailed);
+ Assert.assertFalse("The operation failed. Look at the log, or put a breakpoint on ExecutionException or DefaultOperationHistory#notifyNotOK to find the cause.", this.operationFailed); //$NON-NLS-1$
}
/**
@@ -381,7 +388,7 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
protected void undo() {
resetLastOperationFailedState();
final CommandStack commandStack = getCommandStack();
- Assert.assertTrue("We should be able to undo", commandStack.canUndo());
+ Assert.assertTrue("We should be able to undo", commandStack.canUndo()); //$NON-NLS-1$
commandStack.undo();
assertLastOperationSuccessful();
}
@@ -390,7 +397,7 @@ public abstract class AbstractPapyrusTestCase extends AbstractPapyrusTest {
protected void redo() {
resetLastOperationFailedState();
final CommandStack commandStack = getCommandStack();
- Assert.assertTrue("We should be able to redo", commandStack.canRedo());
+ Assert.assertTrue("We should be able to redo", commandStack.canRedo()); //$NON-NLS-1$
commandStack.redo();
assertLastOperationSuccessful();
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestMultiLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestMultiLink.java
index 969ecd34f6e..f62f3a4e230 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestMultiLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestMultiLink.java
@@ -51,15 +51,15 @@ import org.junit.Before;
*/
public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
- protected static final String THE_BRANCH_TO_RECONNECT_EXISTS = "the branch to reconnect exists";
+ protected static final String THE_BRANCH_TO_RECONNECT_EXISTS = "the branch to reconnect exists"; //$NON-NLS-1$
- protected static final String BRANCH_EXISTS_RECONNECTION_ON_TARGET = "branch exists reconnection on target ";
+ protected static final String BRANCH_EXISTS_RECONNECTION_ON_TARGET = "branch exists reconnection on target "; //$NON-NLS-1$
- protected static final String RECONNECTION_TARGET = "Reconnection target ";
+ protected static final String RECONNECTION_TARGET = "Reconnection target "; //$NON-NLS-1$
- protected static final String BRANCH_EXISTS_RECONNECTION_ON_SOURCE = "branch exists reconnection on Source ";
+ protected static final String BRANCH_EXISTS_RECONNECTION_ON_SOURCE = "branch exists reconnection on Source "; //$NON-NLS-1$
- protected static final String RECONNECTION_SOURCE = "Reconnection Source ";
+ protected static final String RECONNECTION_SOURCE = "Reconnection Source "; //$NON-NLS-1$
GraphicalEditPart source = null;
@@ -76,43 +76,43 @@ public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
ShapeNodeEditPart linkNode = null;
/** The Constant CREATION. */
- protected static final String CREATION = "CREATION:";
+ protected static final String CREATION = "CREATION:"; //$NON-NLS-1$
/** The Constant CONTAINER_CREATION. */
- protected static final String CONTAINER_CREATION = "CONTAINER CREATION: ";
+ protected static final String CONTAINER_CREATION = "CONTAINER CREATION: "; //$NON-NLS-1$
/** The Constant DROP. */
- protected static final String DROP = "DROP: ";
+ protected static final String DROP = "DROP: "; //$NON-NLS-1$
/** The Constant DESTROY_DELETION. */
- protected static final String DESTROY_DELETION = "DESTROY DELETION: ";
+ protected static final String DESTROY_DELETION = "DESTROY DELETION: "; //$NON-NLS-1$
/** The Constant COMMAND_NULL. */
- protected static final String COMMAND_NULL = " command null";
+ protected static final String COMMAND_NULL = " command null"; //$NON-NLS-1$
/** The Constant VIEW_DELETION. */
- protected static final String VIEW_DELETION = "VIEW DELETION: ";
+ protected static final String VIEW_DELETION = "VIEW DELETION: "; //$NON-NLS-1$
/** The Constant TEST_THE_REDO. */
- protected static final String TEST_THE_REDO = "test the redo";
+ protected static final String TEST_THE_REDO = "test the redo"; //$NON-NLS-1$
/** The Constant TEST_THE_UNDO. */
- protected static final String TEST_THE_UNDO = "test the undo";
+ protected static final String TEST_THE_UNDO = "test the undo"; //$NON-NLS-1$
/** The Constant TEST_THE_EXECUTION. */
- protected static final String TEST_THE_EXECUTION = "test the execution";
+ protected static final String TEST_THE_EXECUTION = "test the execution"; //$NON-NLS-1$
/** The Constant TEST_IF_THE_COMMAND_CAN_BE_EXECUTED. */
- protected static final String TEST_IF_THE_COMMAND_CAN_BE_EXECUTED = "test if the command can be executed";
+ protected static final String TEST_IF_THE_COMMAND_CAN_BE_EXECUTED = "test if the command can be executed"; //$NON-NLS-1$
/** The Constant TEST_IF_THE_COMMAND_IS_CREATED. */
- protected static final String TEST_IF_THE_COMMAND_IS_CREATED = "test if the command is created";
+ protected static final String TEST_IF_THE_COMMAND_IS_CREATED = "test if the command is created"; //$NON-NLS-1$
/** The Constant INITIALIZATION_TEST. */
- protected static final String INITIALIZATION_TEST = "Intitial State";
+ protected static final String INITIALIZATION_TEST = "Intitial State"; //$NON-NLS-1$
/** The Constant CHANGE_CONTAINER. */
- protected static final String CHANGE_CONTAINER = "CHANGE CONTAINER";
+ protected static final String CHANGE_CONTAINER = "CHANGE CONTAINER"; //$NON-NLS-1$
/** The root compartment. */
protected ShapeCompartmentEditPart rootCompartment = null;
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java
index aff63f87e3a..1d6a0312199 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java
@@ -16,8 +16,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -33,14 +31,12 @@ import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.requests.GroupRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
@@ -55,12 +51,9 @@ import org.eclipse.gmf.tooling.runtime.update.DiagramUpdater;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart;
import org.eclipse.papyrus.uml.diagram.common.editparts.UMLCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
-import org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromModelCommandHandler;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.internal.e4.compatibility.SelectionService;
import org.eclipse.uml2.uml.Element;
import org.junit.Assert;
import org.junit.Before;
@@ -298,13 +291,13 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
*/
protected void testEnableForDeleteFromModel() {
ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
- org.eclipse.core.commands.Command cmd = commandService.getCommand("org.eclipse.ui.edit.delete");
+ org.eclipse.core.commands.Command cmd = commandService.getCommand("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
IHandler handler = cmd.getHandler();
if(handler instanceof AbstractHandler) {
- ((AbstractHandler)handler).setEnabled("org.eclipse.ui.edit.delete");
+ ((AbstractHandler)handler).setEnabled("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
}
boolean res = handler.isEnabled();
- assertTrue("Delete from model handler must be enable",res);
+ assertTrue("Delete from model handler must be enable",res); //$NON-NLS-1$
}
/**
@@ -389,7 +382,7 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
command = compartment.getCommand(changeBoundsRequest);
assertNotNull(CHANGE_CONTAINER, command);
assertTrue(CHANGE_CONTAINER + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
@@ -435,12 +428,12 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
});
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute());
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute()); //$NON-NLS-1$
// execute the creation
executeOnUIThread(command);
assertEquals(CREATION + TEST_THE_EXECUTION, expectedGraphicalChildren + addedGraphicalChildren, getRootView().getChildren().size());
if(addedGraphicalChildren>=1){
- Assert.assertTrue("Node must be org.eclipse.gmf.runtime.notation.Shape",getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1) instanceof Shape);
+ Assert.assertTrue("Node must be org.eclipse.gmf.runtime.notation.Shape",getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1) instanceof Shape); //$NON-NLS-1$
}
if(testSemantic) {
@@ -460,24 +453,24 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
}
EditPart createdEditPart= (EditPart)getContainerEditPart().getChildren().get((getContainerEditPart().getChildren().size()-1));
- Assert.assertNotNull("The editpart must be created", createdEditPart);
+ Assert.assertNotNull("The editpart must be created", createdEditPart); //$NON-NLS-1$
testNodeEditPart(maskmanaged, createdEditPart, initialName);
// test diagram updater
if(getDiagramUpdater()!=null){
- Assert.assertNotEquals("Diagram updater must detect that children has been created",0,getDiagramUpdater().getSemanticChildren(getRootView()).size());
- Assert.assertEquals("Diagram updater must detect that no link has been created",0,getDiagramUpdater().getContainedLinks(getRootView()).size());
- Assert.assertEquals ("Diagram updater must detect that no link are incoming",0,getDiagramUpdater().getIncomingLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size());
- Assert.assertEquals ("Diagram updater must detect that no link are outgoing",0,getDiagramUpdater().getOutgoingLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size());
- Assert.assertEquals ("Diagram updater must detect that no children has ben created in the new element",numberSemanticChildreen,getDiagramUpdater().getSemanticChildren((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size());
- Assert.assertEquals ("Diagram updater must detect that no link has been created in the new element",0,getDiagramUpdater().getContainedLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size());
+ Assert.assertNotEquals("Diagram updater must detect that children has been created",0,getDiagramUpdater().getSemanticChildren(getRootView()).size()); //$NON-NLS-1$
+ Assert.assertEquals("Diagram updater must detect that no link has been created",0,getDiagramUpdater().getContainedLinks(getRootView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are incoming",0,getDiagramUpdater().getIncomingLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are outgoing",0,getDiagramUpdater().getOutgoingLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no children has ben created in the new element",numberSemanticChildreen,getDiagramUpdater().getSemanticChildren((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link has been created in the new element",0,getDiagramUpdater().getContainedLinks((View)getRootView().getChildren().get(expectedGraphicalChildren + addedGraphicalChildren-1)).size()); //$NON-NLS-1$
}
createdEditPart.getChildren();
for(Iterator<?> iteratorEditPart = createdEditPart.getChildren().iterator(); iteratorEditPart.hasNext();) {
Object subEditPart = iteratorEditPart.next();
if( subEditPart instanceof UMLCompartmentEditPart){
- Assert.assertEquals("Diagram updater must detect that children has been created",0,getDiagramUpdater().getSemanticChildren(((CompartmentEditPart)subEditPart).getNotationView()).size());
+ Assert.assertEquals("Diagram updater must detect that children has been created",0,getDiagramUpdater().getSemanticChildren(((CompartmentEditPart)subEditPart).getNotationView()).size()); //$NON-NLS-1$
}
}
@@ -490,13 +483,13 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
*/
protected void testNodeEditPart(boolean maskmanaged, EditPart createdEditPart,String initialName) {
if( maskmanaged){
- Assert.assertNotNull("the created editpolicy must have as MASK_MANAGED_LABEL_EDIT_POLICY", createdEditPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY));
+ Assert.assertNotNull("the created editpolicy must have as MASK_MANAGED_LABEL_EDIT_POLICY", createdEditPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY)); //$NON-NLS-1$
}
int index=0;
while(index < createdEditPart.getChildren().size()) {
if((createdEditPart.getChildren().get(index)) instanceof ResizableCompartmentEditPart ) {
ResizableCompartmentEditPart compartment = (ResizableCompartmentEditPart)(createdEditPart.getChildren().get(index));
- Assert.assertFalse("compartment must not be selectable",compartment.isSelectable());
+ Assert.assertFalse("compartment must not be selectable",compartment.isSelectable()); //$NON-NLS-1$
}
index++;
}
@@ -506,23 +499,23 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
protected void testNameLabel(EditPart createdEditPart, String initialName) {
if( createdEditPart instanceof NamedElementEditPart){
GraphicalEditPart namedEditPart=(GraphicalEditPart)((NamedElementEditPart)createdEditPart).getPrimaryChildEditPart();
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof ITextAwareEditPart);
+ Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof ITextAwareEditPart); //$NON-NLS-1$
String name=namedEditPart.resolveSemanticElement().eClass().getName();
if( initialName!=null){
name=initialName;
}
if(name.length()<((ITextAwareEditPart)namedEditPart).getEditText().length()){
- Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText().substring(0,name.length()));
+ Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText().substring(0,name.length())); //$NON-NLS-1$
}
else{
//not the same it sure but display the mistake is important
- Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText());
+ Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText()); //$NON-NLS-1$
}
if(namedEditPart instanceof CompartmentEditPart ){
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof CompartmentEditPart);
- Assert.assertTrue("namelabelEditpart must be editable",((CompartmentEditPart)namedEditPart).isEditModeEnabled());}
+ Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof CompartmentEditPart); //$NON-NLS-1$
+ Assert.assertTrue("namelabelEditpart must be editable",((CompartmentEditPart)namedEditPart).isEditModeEnabled());} //$NON-NLS-1$
else{
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof LabelEditPart);
+ Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof LabelEditPart); //$NON-NLS-1$
}
}
@@ -547,8 +540,7 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
public void testViewDeletion(IElementType type, int expectedGraphicalChildren, int expectedSemanticChildren, int removedGraphicalChildren) {
//DELETION OF THE VIEW
assertEquals(VIEW_DELETION + INITIALIZATION_TEST, expectedGraphicalChildren, getRootView().getChildren().size());
- if(testSemantic) {
- }
+
Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
Command command = ((IGraphicalEditPart)getContainerEditPart().getChildren().get(getContainerEditPart().getChildren().size()-1)).getCommand(deleteViewRequest);
assertNotNull(VIEW_DELETION + COMMAND_NULL, command);
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildLabel.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildLabel.java
index ebc146831c5..4ea2f9f4edf 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildLabel.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildLabel.java
@@ -30,7 +30,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
@@ -41,7 +40,6 @@ import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.update.DiagramUpdater;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart;
import org.eclipse.uml2.uml.Element;
import org.junit.Assert;
@@ -52,43 +50,43 @@ import org.junit.Assert;
public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase {
/** The Constant CREATION. */
- protected static final String CREATION = "CREATION:";
+ protected static final String CREATION = "CREATION:"; //$NON-NLS-1$
/** The Constant CONTAINER_CREATION. */
- protected static final String CONTAINER_CREATION = "CONTAINER CREATION: ";
+ protected static final String CONTAINER_CREATION = "CONTAINER CREATION: "; //$NON-NLS-1$
/** The Constant DROP. */
- protected static final String DROP = "DROP: ";
+ protected static final String DROP = "DROP: "; //$NON-NLS-1$
/** The Constant DESTROY_DELETION. */
- protected static final String DESTROY_DELETION = "DESTROY DELETION: ";
+ protected static final String DESTROY_DELETION = "DESTROY DELETION: "; //$NON-NLS-1$
/** The Constant COMMAND_NULL. */
- protected static final String COMMAND_NULL = " command null";
+ protected static final String COMMAND_NULL = " command null"; //$NON-NLS-1$
/** The Constant VIEW_DELETION. */
- protected static final String VIEW_DELETION = "VIEW DELETION: ";
+ protected static final String VIEW_DELETION = "VIEW DELETION: "; //$NON-NLS-1$
/** The Constant TEST_THE_REDO. */
- protected static final String TEST_THE_REDO = "test the redo";
+ protected static final String TEST_THE_REDO = "test the redo"; //$NON-NLS-1$
/** The Constant TEST_THE_UNDO. */
- protected static final String TEST_THE_UNDO = "test the undo";
+ protected static final String TEST_THE_UNDO = "test the undo"; //$NON-NLS-1$
/** The Constant TEST_THE_EXECUTION. */
- protected static final String TEST_THE_EXECUTION = "test the execution";
+ protected static final String TEST_THE_EXECUTION = "test the execution"; //$NON-NLS-1$
/** The Constant TEST_IF_THE_COMMAND_CAN_BE_EXECUTED. */
- protected static final String TEST_IF_THE_COMMAND_CAN_BE_EXECUTED = "test if the command can be executed";
+ protected static final String TEST_IF_THE_COMMAND_CAN_BE_EXECUTED = "test if the command can be executed"; //$NON-NLS-1$
/** The Constant TEST_IF_THE_COMMAND_IS_CREATED. */
- protected static final String TEST_IF_THE_COMMAND_IS_CREATED = "test if the command is created";
+ protected static final String TEST_IF_THE_COMMAND_IS_CREATED = "test if the command is created"; //$NON-NLS-1$
/** The Constant INITIALIZATION_TEST. */
- protected static final String INITIALIZATION_TEST = "Intitial State";
+ protected static final String INITIALIZATION_TEST = "Intitial State"; //$NON-NLS-1$
/** The Constant CHANGE_CONTAINER. */
- protected static final String CHANGE_CONTAINER = "CHANGE CONTAINER";
+ protected static final String CHANGE_CONTAINER = "CHANGE CONTAINER"; //$NON-NLS-1$
/** The top node. */
protected GraphicalEditPart topNode;
@@ -107,12 +105,12 @@ public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.c
ListCompartmentEditPart compartment = null;
int index = 0;
while(compartment == null && index < getTopEditPart().getChildren().size()) {
- if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) {
+ if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) { //$NON-NLS-1$
compartment = (ListCompartmentEditPart)(getTopEditPart().getChildren().get(index));
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
//DELETION OF THE VIEW
assertTrue(VIEW_DELETION + INITIALIZATION_TEST, compartment.getChildren().size() == 1);
assertTrue(VIEW_DELETION + INITIALIZATION_TEST, ((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size() == 1);
@@ -144,12 +142,12 @@ public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.c
ListCompartmentEditPart compartment = null;
int index = 0;
while(compartment == null && index < getTopEditPart().getChildren().size()) {
- if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) {
+ if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) { //$NON-NLS-1$
compartment = (ListCompartmentEditPart)(getTopEditPart().getChildren().get(index));
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
//DESTROY SEMANTIC+ VIEW
assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, compartment.getChildren().size() == 1);
assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, ((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size() == 1);
@@ -181,12 +179,12 @@ public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.c
ListCompartmentEditPart compartment = null;
int index = 0;
while(compartment == null && index < getTopEditPart().getChildren().size()) {
- if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) {
+ if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) { //$NON-NLS-1$
compartment = (ListCompartmentEditPart)(getTopEditPart().getChildren().get(index));
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
//DROP
assertTrue(DROP + INITIALIZATION_TEST, compartment.getChildren().size() == 0);
assertTrue(DROP + INITIALIZATION_TEST, ((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size() == 1);
@@ -224,12 +222,12 @@ public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.c
ListCompartmentEditPart compartment = null;
int index = 0;
while(compartment == null && index < getTopEditPart().getChildren().size()) {
- if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) {
+ if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) { //$NON-NLS-1$
compartment = (ListCompartmentEditPart)(getTopEditPart().getChildren().get(index));
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
//CHANGE CONTAINER
assertTrue(CHANGE_CONTAINER + INITIALIZATION_TEST, compartment.getChildren().size() == 1);
assertTrue(CHANGE_CONTAINER + INITIALIZATION_TEST, ((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size() == 1);
@@ -247,12 +245,12 @@ public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.c
ListCompartmentEditPart newCompartment = null;
index = 0;
while(newCompartment == null && index < newContainerEditPart.getChildren().size()) {
- if((newContainerEditPart.getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) {
+ if((newContainerEditPart.getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) { //$NON-NLS-1$
newCompartment = (ListCompartmentEditPart)(newContainerEditPart.getChildren().get(index));
}
index++;
}
- assertTrue("NewContainer not found", newCompartment != null);
+ assertTrue("NewContainer not found", newCompartment != null); //$NON-NLS-1$
command = newCompartment.getCommand(changeBoundsRequest);
assertNotNull(CHANGE_CONTAINER, command);
assertTrue(CHANGE_CONTAINER + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
@@ -284,12 +282,12 @@ public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.c
ListCompartmentEditPart compartment = null;
int index = 0;
while(compartment == null && index < getTopEditPart().getChildren().size()) {
- if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) {
+ if((getTopEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) { //$NON-NLS-1$
compartment = (ListCompartmentEditPart)(getTopEditPart().getChildren().get(index));
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
//CREATION
assertTrue(CREATION + INITIALIZATION_TEST, compartment.getChildren().size() == 0);
assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 0);
@@ -297,24 +295,24 @@ public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.c
Command command = compartment.getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION + TEST_THE_EXECUTION, compartment.getChildren().size() == 1);
- Assert.assertTrue("Node must be org.eclipse.gmf.runtime.notation.Shape",((EditPart)compartment.getChildren().get(0)).getModel() instanceof Shape);
+ Assert.assertTrue("Node must be org.eclipse.gmf.runtime.notation.Shape",((EditPart)compartment.getChildren().get(0)).getModel() instanceof Shape); //$NON-NLS-1$
EditPart createdEditPart= (EditPart)compartment.getChildren().get(0);
testNodeEditPart(maskmanaged, createdEditPart, initialName);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(CREATION + TEST_THE_UNDO, compartment.getChildren().size() == 0);
assertTrue(CREATION + TEST_THE_UNDO, ((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size() == 0);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue("CREATION: " + TEST_THE_REDO, compartment.getChildren().size() == 1);
+ assertTrue("CREATION: " + TEST_THE_REDO, compartment.getChildren().size() == 1); //$NON-NLS-1$
- Assert.assertNotEquals("Diagram updater must detect that children has been created",0,getDiagramUpdater().getSemanticChildren(getRootView()).size());
- Assert.assertEquals("Diagram updater must detect that no link has been created",0,getDiagramUpdater().getContainedLinks(getRootView()).size());
- Assert.assertEquals ("Diagram updater must detect that no link are incoming",0,getDiagramUpdater().getIncomingLinks(((GraphicalEditPart) compartment.getChildren().get(0)).getNotationView()).size());
- Assert.assertEquals ("Diagram updater must detect that no link are outgoing",0,getDiagramUpdater().getOutgoingLinks(((GraphicalEditPart) compartment.getChildren().get(0)).getNotationView()).size());
- Assert.assertEquals ("Diagram updater must detect that no children has ben created in the new element",0,getDiagramUpdater().getSemanticChildren(((GraphicalEditPart) compartment.getChildren().get(0)).getNotationView()).size());
- Assert.assertEquals ("Diagram updater must detect that no link has been created in the new element",0,getDiagramUpdater().getContainedLinks(((GraphicalEditPart) compartment.getChildren().get(0)).getNotationView()).size());
+ Assert.assertNotEquals("Diagram updater must detect that children has been created",0,getDiagramUpdater().getSemanticChildren(getRootView()).size()); //$NON-NLS-1$
+ Assert.assertEquals("Diagram updater must detect that no link has been created",0,getDiagramUpdater().getContainedLinks(getRootView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are incoming",0,getDiagramUpdater().getIncomingLinks(((GraphicalEditPart) compartment.getChildren().get(0)).getNotationView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are outgoing",0,getDiagramUpdater().getOutgoingLinks(((GraphicalEditPart) compartment.getChildren().get(0)).getNotationView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no children has ben created in the new element",0,getDiagramUpdater().getSemanticChildren(((GraphicalEditPart) compartment.getChildren().get(0)).getNotationView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link has been created in the new element",0,getDiagramUpdater().getContainedLinks(((GraphicalEditPart) compartment.getChildren().get(0)).getNotationView()).size()); //$NON-NLS-1$
@@ -325,25 +323,25 @@ public abstract class TestChildLabel extends org.eclipse.papyrus.diagram.tests.c
* @param createdEditPart
*/
protected void testNodeEditPart(boolean maskmanaged, EditPart createdEditPart, String initialName) {
- Assert.assertNotNull("The editpart must be created", createdEditPart);
+ Assert.assertNotNull("The editpart must be created", createdEditPart); //$NON-NLS-1$
if( maskmanaged){
- Assert.assertNotNull("the created editpolicy must have as MASK_MANAGED_LABEL_EDIT_POLICY", createdEditPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY));
+ Assert.assertNotNull("the created editpolicy must have as MASK_MANAGED_LABEL_EDIT_POLICY", createdEditPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY)); //$NON-NLS-1$
}
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",createdEditPart instanceof ITextAwareEditPart);
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",createdEditPart instanceof GraphicalEditPart);
+ Assert.assertTrue("the primary editpart must be the namelabelEditpart",createdEditPart instanceof ITextAwareEditPart); //$NON-NLS-1$
+ Assert.assertTrue("the primary editpart must be the namelabelEditpart",createdEditPart instanceof GraphicalEditPart); //$NON-NLS-1$
String name=((GraphicalEditPart)createdEditPart).resolveSemanticElement().eClass().getName();
if(initialName!=null){
name= initialName;
}
if(name.length()<((ITextAwareEditPart)createdEditPart).getEditText().length()){
- Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)createdEditPart).getEditText().substring(0,name.length()));
+ Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)createdEditPart).getEditText().substring(0,name.length())); //$NON-NLS-1$
}
else{
//not the same it sure but display the mistake is important
- Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)createdEditPart).getEditText());
+ Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)createdEditPart).getEditText()); //$NON-NLS-1$
}
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",createdEditPart instanceof CompartmentEditPart);
- Assert.assertTrue("namelabelEditpart must be editable",((CompartmentEditPart)createdEditPart).isEditModeEnabled());
+ Assert.assertTrue("the primary editpart must be the namelabelEditpart",createdEditPart instanceof CompartmentEditPart); //$NON-NLS-1$
+ Assert.assertTrue("namelabelEditpart must be editable",((CompartmentEditPart)createdEditPart).isEditModeEnabled()); //$NON-NLS-1$
}
/**
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildNode.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildNode.java
index 507b9c1b9f1..e5c3f62030d 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildNode.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestChildNode.java
@@ -28,7 +28,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Element;
import org.junit.Before;
/**
@@ -81,7 +80,7 @@ public abstract class TestChildNode extends AbstractTestNode {
}
index++;
}
- assertNotNull("There should be at least one container for the node tests", rootCompartment);
+ assertNotNull("There should be at least one container for the node tests", rootCompartment); //$NON-NLS-1$
}
/**
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestCommentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestCommentLink.java
index fce8bc9924b..05b54ac8f3f 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestCommentLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestCommentLink.java
@@ -150,7 +150,7 @@ public abstract class TestCommentLink extends TestLink {
Command command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the source player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -158,7 +158,7 @@ public abstract class TestCommentLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -166,7 +166,7 @@ public abstract class TestCommentLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -174,7 +174,7 @@ public abstract class TestCommentLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
source = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
sourcePlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestConstraintLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestConstraintLink.java
index 3c875e54349..14a855e8c6a 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestConstraintLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestConstraintLink.java
@@ -150,7 +150,7 @@ public abstract class TestConstraintLink extends TestLink {
Command command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the source player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -158,7 +158,7 @@ public abstract class TestConstraintLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -166,7 +166,7 @@ public abstract class TestConstraintLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -174,7 +174,7 @@ public abstract class TestConstraintLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
source = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
sourcePlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestContainmentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestContainmentLink.java
index 9c1b8adfc5e..e8cfd6484fe 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestContainmentLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestContainmentLink.java
@@ -48,7 +48,7 @@ public abstract class TestContainmentLink extends TestLink {
assertTrue(VIEW_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 3);
assertTrue(VIEW_DELETION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- Command command = ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)).getCommand(deleteViewRequest);
+ Command command = ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)).getCommand(deleteViewRequest); //$NON-NLS-1$
assertNotNull(VIEW_DELETION + COMMAND_NULL, command);
assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
@@ -79,7 +79,7 @@ public abstract class TestContainmentLink extends TestLink {
assertTrue(CREATION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 3);
Request deleteViewRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- Command command = ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)).getCommand(deleteViewRequest);
+ Command command = ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)).getCommand(deleteViewRequest); //$NON-NLS-1$
assertNotNull(DESTROY_DELETION + COMMAND_NULL, command);
assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
@@ -148,7 +148,7 @@ public abstract class TestContainmentLink extends TestLink {
Command command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the source player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -156,7 +156,7 @@ public abstract class TestContainmentLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -164,7 +164,7 @@ public abstract class TestContainmentLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -172,7 +172,7 @@ public abstract class TestContainmentLink extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
source = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
sourcePlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
@@ -184,8 +184,8 @@ public abstract class TestContainmentLink extends TestLink {
public void testTargetReconnectAMultiLink(IElementType type) {
//target reconnection
ReconnectRequest reconnectRequest = new ReconnectRequest();
- assertTrue(THE_LINK_RECONNECT_EXISTS, ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)) != null);
- ConnectionEditPart binaryLink = ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0));
+ assertTrue(THE_LINK_RECONNECT_EXISTS, ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)) != null); //$NON-NLS-1$
+ ConnectionEditPart binaryLink = ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)); //$NON-NLS-1$
reconnectRequest.setConnectionEditPart(binaryLink);
reconnectRequest.setTargetEditPart(targetPlayer);
reconnectRequest.setType(RequestConstants.REQ_RECONNECT_TARGET);
@@ -208,8 +208,8 @@ public abstract class TestContainmentLink extends TestLink {
public void testSourceReconnectAMultiLink(IElementType type) {
//target reconnection
ReconnectRequest reconnectRequest = new ReconnectRequest();
- assertTrue(THE_LINK_TO_RECONNECT_EXISTS, ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)) != null);
- ConnectionEditPart branch = ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0));
+ assertTrue(THE_LINK_TO_RECONNECT_EXISTS, ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)) != null); //$NON-NLS-1$
+ ConnectionEditPart branch = ((ConnectionEditPart)source.getChildBySemanticHint("3032").getSourceConnections().get(0)); //$NON-NLS-1$
reconnectRequest.setConnectionEditPart(branch);
reconnectRequest.setTargetEditPart(sourcePlayer);
reconnectRequest.setType(RequestConstants.REQ_RECONNECT_SOURCE);
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java
index 02bbd7a8904..2ff22976e30 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java
@@ -34,7 +34,6 @@ import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gef.requests.GroupRequest;
import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
@@ -52,7 +51,6 @@ import org.eclipse.gmf.tooling.runtime.update.DiagramUpdater;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.uml2.uml.Element;
@@ -65,17 +63,17 @@ import org.junit.Assert;
*/
public abstract class TestLink extends AbstractPapyrusTestCase {
- protected static final String THE_LINK_RECONNECT_EXISTS = "The Link exist";
+ protected static final String THE_LINK_RECONNECT_EXISTS = "The Link exist"; //$NON-NLS-1$
- protected static final String RECONNECTION_TARGET = "Reconnection of target";
+ protected static final String RECONNECTION_TARGET = "Reconnection of target"; //$NON-NLS-1$
- protected static final String LINK_EXISTS_RECONNECTION_ON_TARGET = "Link exist on the target";
+ protected static final String LINK_EXISTS_RECONNECTION_ON_TARGET = "Link exist on the target"; //$NON-NLS-1$
- protected static final String THE_LINK_TO_RECONNECT_EXISTS = "The Link exist";
+ protected static final String THE_LINK_TO_RECONNECT_EXISTS = "The Link exist"; //$NON-NLS-1$
- protected static final String RECONNECTION_SOURCE = "Reconnection of source";
+ protected static final String RECONNECTION_SOURCE = "Reconnection of source"; //$NON-NLS-1$
- protected static final String LINK_EXISTS_RECONNECTION_ON_SOURCE = "Link exist on the source";
+ protected static final String LINK_EXISTS_RECONNECTION_ON_SOURCE = "Link exist on the source"; //$NON-NLS-1$
protected GraphicalEditPart source = null;
@@ -225,7 +223,7 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
command = compartment.getCommand(changeBoundsRequest);
assertNotNull(CHANGE_CONTAINER, command);
assertTrue(CHANGE_CONTAINER + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
@@ -268,17 +266,17 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
ConnectionEditPart linkEditPart= (ConnectionEditPart)getDiagramEditPart().getConnections().get(0);
testLinkEditPart(linkEditPart, initialName);
- Assert.assertEquals("Diagram updater must detect that node children has been created",4,getDiagramUpdater().getSemanticChildren(getRootView()).size());
- Assert.assertEquals("Diagram updater must detect that no link has been created",1,getDiagramUpdater().getContainedLinks(getRootView()).size());
- Assert.assertEquals ("Diagram updater must detect that no link are incoming",0,getDiagramUpdater().getIncomingLinks((View)((Diagram)getRootView()).getEdges().get(0)).size());
- Assert.assertEquals ("Diagram updater must detect that no link are outgoing",0,getDiagramUpdater().getOutgoingLinks((View)((Diagram)getRootView()).getEdges().get(0)).size());
- Assert.assertEquals ("Diagram updater must detect that no children has ben created in the new element",0,getDiagramUpdater().getSemanticChildren(((View)((Diagram)getRootView()).getEdges().get(0))).size());
- Assert.assertEquals ("Diagram updater must detect that no link has been created in the new element",0,getDiagramUpdater().getContainedLinks(((View)((Diagram)getRootView()).getEdges().get(0))).size());
+ Assert.assertEquals("Diagram updater must detect that node children has been created",4,getDiagramUpdater().getSemanticChildren(getRootView()).size()); //$NON-NLS-1$
+ Assert.assertEquals("Diagram updater must detect that no link has been created",1,getDiagramUpdater().getContainedLinks(getRootView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are incoming",0,getDiagramUpdater().getIncomingLinks((View)((Diagram)getRootView()).getEdges().get(0)).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are outgoing",0,getDiagramUpdater().getOutgoingLinks((View)((Diagram)getRootView()).getEdges().get(0)).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no children has ben created in the new element",0,getDiagramUpdater().getSemanticChildren(((View)((Diagram)getRootView()).getEdges().get(0))).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link has been created in the new element",0,getDiagramUpdater().getContainedLinks(((View)((Diagram)getRootView()).getEdges().get(0))).size()); //$NON-NLS-1$
- Assert.assertEquals ("Diagram updater must detect that no link are incoming",1,getDiagramUpdater().getIncomingLinks(target.getNotationView()).size());
- Assert.assertEquals ("Diagram updater must detect that no link are OutgoingLinks",0,getDiagramUpdater().getOutgoingLinks(target.getNotationView()).size());
- Assert.assertEquals ("Diagram updater must detect that no link are IncomingLinks",0,getDiagramUpdater().getIncomingLinks(source.getNotationView()).size());
- Assert.assertEquals ("Diagram updater must detect that no link are OutgoingLinks",1,getDiagramUpdater().getOutgoingLinks(source.getNotationView()).size());
+ Assert.assertEquals ("Diagram updater must detect that no link are incoming",1,getDiagramUpdater().getIncomingLinks(target.getNotationView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are OutgoingLinks",0,getDiagramUpdater().getOutgoingLinks(target.getNotationView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are IncomingLinks",0,getDiagramUpdater().getIncomingLinks(source.getNotationView()).size()); //$NON-NLS-1$
+ Assert.assertEquals ("Diagram updater must detect that no link are OutgoingLinks",1,getDiagramUpdater().getOutgoingLinks(source.getNotationView()).size()); //$NON-NLS-1$
}
@@ -288,15 +286,15 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
* @param linkEditPart
*/
protected void testLinkEditPart(ConnectionEditPart linkEditPart, String initialName) {
- Assert.assertNotNull("the editpart of the link must exist",linkEditPart);
+ Assert.assertNotNull("the editpart of the link must exist",linkEditPart); //$NON-NLS-1$
EditPolicy policy=linkEditPart.getEditPolicy(org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE);
- Assert.assertNotNull("the link must have an edipolicy that to show or hide label",policy);
- Assert.assertTrue("the policy of the link must be an instance of ShowHideLabelEditPolicy", policy instanceof org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy);
+ Assert.assertNotNull("the link must have an edipolicy that to show or hide label",policy); //$NON-NLS-1$
+ Assert.assertTrue("the policy of the link must be an instance of ShowHideLabelEditPolicy", policy instanceof org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy); //$NON-NLS-1$
//get text aware
ITextAwareEditPart namedEditPart=null;
for(Iterator iteratorChildren = linkEditPart.getChildren().iterator(); iteratorChildren.hasNext();) {
Object children = iteratorChildren.next();
- if (children instanceof ITextAwareEditPart&&(((ITextAwareEditPart)children).getEditText()!=null)&&(!((ITextAwareEditPart)children).getEditText().trim().equals(""))){
+ if (children instanceof ITextAwareEditPart&&(((ITextAwareEditPart)children).getEditText()!=null)&&(!((ITextAwareEditPart)children).getEditText().trim().equals(""))){ //$NON-NLS-1$
namedEditPart=(ITextAwareEditPart)children;
}
}
@@ -307,17 +305,17 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
}
protected void testNameLabel(ITextAwareEditPart namedEditPart, String initialName) {
- Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof GraphicalEditPart);
+ Assert.assertTrue("the primary editpart must be the namelabelEditpart",namedEditPart instanceof GraphicalEditPart); //$NON-NLS-1$
String name=((GraphicalEditPart)namedEditPart).resolveSemanticElement().eClass().getName();
if( initialName!=null){
name=initialName;
}
if(name.length()<((ITextAwareEditPart)namedEditPart).getEditText().length()){
- Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText().substring(0,name.length()));
+ Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText().substring(0,name.length())); //$NON-NLS-1$
}
else{
//not the same it sure but display the mistake is important
- Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText());
+ Assert.assertEquals(" the name must contain the name of the metaclass",name, ((ITextAwareEditPart)namedEditPart).getEditText()); //$NON-NLS-1$
}
}
@@ -330,7 +328,7 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
Command command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the source player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -338,7 +336,7 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -346,7 +344,7 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -354,7 +352,7 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
source = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
sourcePlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
@@ -518,12 +516,12 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
*/
protected void testEnableForDeleteFromModel() {
ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
- org.eclipse.core.commands.Command cmd = commandService.getCommand("org.eclipse.ui.edit.delete");
+ org.eclipse.core.commands.Command cmd = commandService.getCommand("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
IHandler handler = cmd.getHandler();
if(handler instanceof AbstractHandler) {
- ((AbstractHandler)handler).setEnabled("org.eclipse.ui.edit.delete");
+ ((AbstractHandler)handler).setEnabled("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
}
boolean res = handler.isEnabled();
- assertTrue("Delete from model handler must be enable",res);
+ assertTrue("Delete from model handler must be enable",res); //$NON-NLS-1$
}
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLinkOwnedBySource.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLinkOwnedBySource.java
index a37c77b04eb..cb46570f123 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLinkOwnedBySource.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLinkOwnedBySource.java
@@ -178,7 +178,7 @@ public abstract class TestLinkOwnedBySource extends TestLink {
Command command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the source player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -186,7 +186,7 @@ public abstract class TestLinkOwnedBySource extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -194,7 +194,7 @@ public abstract class TestLinkOwnedBySource extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
//create the target player to test reconnect
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
@@ -202,7 +202,7 @@ public abstract class TestLinkOwnedBySource extends TestLink {
command = getDiagramEditPart().getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
source = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
sourcePlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestNested.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestNested.java
index 0188c0dec18..2b6bc1aca51 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestNested.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestNested.java
@@ -47,12 +47,12 @@ public abstract class TestNested extends org.eclipse.papyrus.diagram.tests.canon
ListCompartmentEditPart compartment = null;
int index = 0;
while(compartment == null && index < getChildEditPart().getChildren().size()) {
- if((getChildEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getChildEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) {
+ if((getChildEditPart().getChildren().get(index)) instanceof ListCompartmentEditPart && (((View)((ListCompartmentEditPart)(getChildEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) { //$NON-NLS-1$
compartment = (ListCompartmentEditPart)(getChildEditPart().getChildren().get(index));
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
//CREATION
assertTrue(CREATION + INITIALIZATION_TEST, compartment.getChildren().size() == 0);
assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModelchild().getOwnedElements().size() == 0);
@@ -60,14 +60,14 @@ public abstract class TestNested extends org.eclipse.papyrus.diagram.tests.canon
Command command = compartment.getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION + TEST_THE_EXECUTION, compartment.getChildren().size() == 1);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(CREATION + TEST_THE_UNDO, compartment.getChildren().size() == 0);
assertTrue(CREATION + TEST_THE_UNDO, ((Element)((View)getChildEditPart().getModel()).getElement()).getOwnedElements().size() == 0);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue("CREATION: " + TEST_THE_REDO, compartment.getChildren().size() == 1);
+ assertTrue("CREATION: " + TEST_THE_REDO, compartment.getChildren().size() == 1); //$NON-NLS-1$
}
/**
@@ -83,13 +83,13 @@ public abstract class TestNested extends org.eclipse.papyrus.diagram.tests.canon
int index = 0;
while(compartment == null && index < getTopEditPart().getChildren().size()) {
if((getTopEditPart().getChildren().get(index)) instanceof ResizableCompartmentEditPart) {
- if((((View)((ResizableCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) {
+ if((((View)((ResizableCompartmentEditPart)(getTopEditPart().getChildren().get(index))).getModel()).getType().equals("" + containerType))) { //$NON-NLS-1$
compartment = (ResizableCompartmentEditPart)(getTopEditPart().getChildren().get(index));
}
}
index++;
}
- assertTrue("Container not found", compartment != null);
+ assertTrue("Container not found", compartment != null); //$NON-NLS-1$
//CREATION
assertTrue(CREATION + INITIALIZATION_TEST, compartment.getChildren().size() == 0);
assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 0);
@@ -97,14 +97,14 @@ public abstract class TestNested extends org.eclipse.papyrus.diagram.tests.canon
Command command = compartment.getCommand(requestcreation);
assertNotNull(CREATION + COMMAND_NULL, command);
assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
+ assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); //$NON-NLS-1$
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION + TEST_THE_EXECUTION, compartment.getChildren().size() == 1);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(CREATION + TEST_THE_UNDO, compartment.getChildren().size() == 0);
assertTrue(CREATION + TEST_THE_UNDO, ((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size() == 0);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue("CREATION: " + TEST_THE_REDO, compartment.getChildren().size() == 1);
+ assertTrue("CREATION: " + TEST_THE_REDO, compartment.getChildren().size() == 1); //$NON-NLS-1$
childNode = (GraphicalEditPart)compartment.getChildren().get(0);
}

Back to the top