Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorptessier2012-03-22 14:07:43 +0000
committerptessier2012-03-22 14:07:43 +0000
commit20b0eb6ca33502dfb22790a4ffc29b50b8b31048 (patch)
treee23ef2174d36ef6519345e19739e15d1077b6614 /tests
parente09ccdb0c71b7baf08ed2dcf56fb4d3b5e097720 (diff)
downloadorg.eclipse.papyrus-20b0eb6ca33502dfb22790a4ffc29b50b8b31048.tar.gz
org.eclipse.papyrus-20b0eb6ca33502dfb22790a4ffc29b50b8b31048.tar.xz
org.eclipse.papyrus-20b0eb6ca33502dfb22790a4ffc29b50b8b31048.zip
bug 330457: [General] Update the test class diagram to fit junit4 standards
https://bugs.eclipse.org/bugs/show_bug.cgi?id=330457
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/AbstractTestMultiLink.java23
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildLabel.java38
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildNode.java34
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestDropfunction.java6
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLink.java15
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLinkOwnedBySource.java14
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestTopNode.java13
7 files changed, 57 insertions, 86 deletions
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/AbstractTestMultiLink.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/AbstractTestMultiLink.java
index 44902c02ebd..97e85ecfeee 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/AbstractTestMultiLink.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/AbstractTestMultiLink.java
@@ -178,19 +178,12 @@ public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
assertTrue(DESTROY_DELETION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
//getDiagramEditPart().getDiagramEditDomain().getDiagramCommandStack().execute(command);
//getDiagramEditPart().getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
- getDiagramEditPart().getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,getDiagramEditPart().getChildren().size()==5);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,((Diagram)getRootView()).getEdges().size()==0);
- EditingDomainUndoContext undoContext= new EditingDomainUndoContext(getDiagramEditPart().getEditingDomain());
- try{
- OperationHistoryFactory.getOperationHistory().undo(undoContext, new NullProgressMonitor(), null);
- }catch (Exception e) {
- System.err.println(e);
- }
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- //diagramEditor.getEditingDomain().getCommandStack().undo();
- //diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,getDiagramEditPart().getChildren().size()==6);
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,((Diagram)getRootView()).getEdges().size()==4);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
@@ -398,7 +391,7 @@ public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
assertNotNull(CONTAINER_CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,getDiagramEditPart().getChildren().size()==1);
@@ -408,7 +401,7 @@ public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
assertNotNull(CONTAINER_CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,getDiagramEditPart().getChildren().size()==2);
requestcreation.setLocation(new Point(200,200));
@@ -417,7 +410,7 @@ public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
assertNotNull(CONTAINER_CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,getDiagramEditPart().getChildren().size()==3);
source=(GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
target=(GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
@@ -429,7 +422,7 @@ public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
assertNotNull(CONTAINER_CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,getDiagramEditPart().getChildren().size()==4);
fourthPlayer=(GraphicalEditPart)getDiagramEditPart().getChildren().get(3);
//4d guest
@@ -438,7 +431,7 @@ public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
assertNotNull(CONTAINER_CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,getDiagramEditPart().getChildren().size()==5);
guestPlayer=(GraphicalEditPart)getDiagramEditPart().getChildren().get(4);
@@ -453,7 +446,7 @@ public abstract class AbstractTestMultiLink extends AbstractPapyrusTestCase {
Command command = target.getCommand(createConnectionViewRequest(type, source, target));
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,((Diagram)getRootView()).getEdges().size()==1);
assertTrue(CREATION +INITIALIZATION_TEST,getRootSemanticModel().getOwnedElements().size()==6);
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildLabel.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildLabel.java
index 6c3d3833cec..628c5d6544c 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildLabel.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildLabel.java
@@ -112,15 +112,15 @@ public abstract class TestChildLabel extends AbstractPapyrusTestCase {
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);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(VIEW_DELETION +TEST_THE_EXECUTION,compartment.getChildren().size()==0);
assertTrue(VIEW_DELETION +TEST_THE_EXECUTION,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(VIEW_DELETION +TEST_THE_UNDO,compartment.getChildren().size()==1);
assertTrue(VIEW_DELETION +TEST_THE_UNDO,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue(VIEW_DELETION +TEST_THE_REDO,compartment.getChildren().size()==0);
assertTrue(VIEW_DELETION +TEST_THE_REDO,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==1);
@@ -152,13 +152,13 @@ public abstract class TestChildLabel extends AbstractPapyrusTestCase {
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);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,compartment.getChildren().size()==0);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==0);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
//assertTrue(DESTROY_DELETION +TEST_THE_UNDO,compartment.getChildren().size()==1);
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue(DESTROY_DELETION +TEST_THE_REDO,compartment.getChildren().size()==0);
assertTrue(DESTROY_DELETION +TEST_THE_REDO,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==0);
}
@@ -194,13 +194,13 @@ public abstract class TestChildLabel extends AbstractPapyrusTestCase {
assertNotNull(DROP+COMMAND_NULL,command);
assertTrue(DROP +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(DROP+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DROP +TEST_THE_EXECUTION,compartment.getChildren().size()!=0);
assertTrue(DROP +TEST_THE_EXECUTION,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()!=0);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(DROP+TEST_THE_UNDO,compartment.getChildren().size()==0);
assertTrue(DROP+TEST_THE_UNDO,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()!=0);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue(DROP+TEST_THE_REDO,compartment.getChildren().size()!=0);
assertTrue(DROP+TEST_THE_REDO,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()!=0);
}
@@ -234,7 +234,7 @@ public abstract class TestChildLabel extends AbstractPapyrusTestCase {
assertNotNull(CONTAINER_CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CONTAINER_CREATION+TEST_THE_EXECUTION,getRootView().getChildren().size()==2);
GraphicalEditPart newContainerEditPart= (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest(RequestConstants.REQ_ADD);
@@ -255,15 +255,15 @@ public abstract class TestChildLabel extends AbstractPapyrusTestCase {
assertNotNull(CHANGE_CONTAINER,command);
assertTrue(CHANGE_CONTAINER+TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CHANGE_CONTAINER+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,compartment.getChildren().size()==0);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==0);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,newCompartment.getChildren().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(CHANGE_CONTAINER+TEST_THE_UNDO,compartment.getChildren().size()==1);
assertTrue(CHANGE_CONTAINER+TEST_THE_UNDO,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==1);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,newCompartment.getChildren().size()==0);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue(CHANGE_CONTAINER+TEST_THE_REDO,compartment.getChildren().size()==0);
assertTrue(CHANGE_CONTAINER+TEST_THE_REDO,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==0);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,newCompartment.getChildren().size()==1);
@@ -295,12 +295,12 @@ public abstract class TestChildLabel extends AbstractPapyrusTestCase {
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);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION+TEST_THE_EXECUTION,compartment.getChildren().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ 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.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue("CREATION: "+TEST_THE_REDO,compartment.getChildren().size()==1);
}
@@ -321,7 +321,7 @@ public abstract class TestChildLabel extends AbstractPapyrusTestCase {
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);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION+TEST_THE_EXECUTION,getRootView().getChildren().size()==1);
topNode = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
}
@@ -358,9 +358,9 @@ public abstract class TestChildLabel extends AbstractPapyrusTestCase {
testToCreateATopNode(topNodeType);
testToCreateANode(type,containerType);
testDestroy(type,containerType);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
testViewDeletion(type,containerType);
- //diagramEditor.getEditingDomain().getCommandStack().undo();
+ //diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
testDrop(type,containerType);
testChangeContainer(topNodeType,type, containerType);
}
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildNode.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildNode.java
index f6259b25b52..d63b780fdb8 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildNode.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestChildNode.java
@@ -66,13 +66,13 @@ public class TestChildNode extends AbstractPapyrusTestCase {
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);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(VIEW_DELETION +TEST_THE_EXECUTION,getRootCompartment().getChildren().size()==0);
assertTrue(VIEW_DELETION +TEST_THE_EXECUTION,getRootSemanticModel().getOwnedElements().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(VIEW_DELETION +TEST_THE_UNDO,getRootCompartment().getChildren().size()==1);
assertTrue(VIEW_DELETION +TEST_THE_UNDO,getRootSemanticModel().getOwnedElements().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue(VIEW_DELETION +TEST_THE_REDO,getRootCompartment().getChildren().size()==0);
assertTrue(VIEW_DELETION +TEST_THE_REDO,getRootSemanticModel().getOwnedElements().size()==1);
@@ -103,13 +103,13 @@ public class TestChildNode extends AbstractPapyrusTestCase {
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);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,getRootCompartment().getChildren().size()==0);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,getRootSemanticModel().getOwnedElements().size()==0);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,getRootCompartment().getChildren().size()==1);
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,getRootSemanticModel().getOwnedElements().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue(DESTROY_DELETION +TEST_THE_REDO,getRootCompartment().getChildren().size()==0);
assertTrue(DESTROY_DELETION +TEST_THE_REDO,getRootSemanticModel().getOwnedElements().size()==0);
}
@@ -135,13 +135,13 @@ public class TestChildNode extends AbstractPapyrusTestCase {
assertNotNull(DROP+COMMAND_NULL,command);
assertTrue(DROP +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(DROP+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DROP +TEST_THE_EXECUTION,getRootCompartment().getChildren().size()!=0);
assertTrue(DROP +TEST_THE_EXECUTION,getRootSemanticModel().getOwnedElements().size()!=0);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(DROP+TEST_THE_UNDO,getRootCompartment().getChildren().size()==0);
assertTrue(DROP+TEST_THE_UNDO,getRootSemanticModel().getOwnedElements().size()!=0);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue(DROP+TEST_THE_REDO,getRootCompartment().getChildren().size()!=0);
assertTrue(DROP+TEST_THE_REDO,getRootSemanticModel().getOwnedElements().size()!=0);
}
@@ -164,7 +164,7 @@ public class TestChildNode extends AbstractPapyrusTestCase {
assertNotNull(CONTAINER_CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CONTAINER_CREATION+TEST_THE_EXECUTION,getRootView().getChildren().size()==2);
GraphicalEditPart containerEditPart= (GraphicalEditPart)getRootCompartment().getChildren().get(1);
ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest(RequestConstants.REQ_ADD);
@@ -185,15 +185,15 @@ public class TestChildNode extends AbstractPapyrusTestCase {
assertNotNull(CHANGE_CONTAINER,command);
assertTrue(CHANGE_CONTAINER+TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CHANGE_CONTAINER+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,getRootView().getChildren().size()==1);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,getRootSemanticModel().getOwnedElements().size()==1);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,compartment.getChildren().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(CHANGE_CONTAINER+TEST_THE_UNDO,getRootView().getChildren().size()==2);
assertTrue(CHANGE_CONTAINER+TEST_THE_UNDO,getRootSemanticModel().getOwnedElements().size()==2);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,compartment.getChildren().size()==0);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue(CHANGE_CONTAINER+TEST_THE_REDO,getRootView().getChildren().size()==1);
assertTrue(CHANGE_CONTAINER+TEST_THE_REDO,getRootSemanticModel().getOwnedElements().size()==1);
assertTrue(CHANGE_CONTAINER+TEST_THE_EXECUTION,compartment.getChildren().size()==1);
@@ -216,12 +216,12 @@ public class TestChildNode extends AbstractPapyrusTestCase {
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);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION+TEST_THE_EXECUTION,getRootView().getChildren().size()==1);
- diagramEditor.getEditingDomain().getCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(CREATION+TEST_THE_UNDO,getRootView().getChildren().size()==0);
assertTrue(CREATION+TEST_THE_UNDO,getRootSemanticModel().getOwnedElements().size()==0);
- diagramEditor.getEditingDomain().getCommandStack().redo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
assertTrue("CREATION: "+TEST_THE_REDO,getRootCompartment().getChildren().size()==1);
}
@@ -241,7 +241,7 @@ public class TestChildNode extends AbstractPapyrusTestCase {
assertNotNull(CONTAINER_CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,getDiagramEditPart().getChildren().size()==1);
GraphicalEditPart containerEditPart= (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
rootCompartment = null;
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestDropfunction.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestDropfunction.java
index 6406d1f23da..9be371ae590 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestDropfunction.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestDropfunction.java
@@ -72,13 +72,13 @@ public void testDropWithOrder(){
assertTrue(CREATION+TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue("CREATION: "+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
//creation of label
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION+TEST_THE_EXECUTION,compartment.getChildren().size()==1);
//deletion view
Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
command = ((GraphicalEditPart)compartment.getChildren().get(0)).getCommand(deleteViewRequest);
assertNotNull(VIEW_DELETION +COMMAND_NULL,command);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
}
}
@@ -114,7 +114,7 @@ public void testDropWithOrder(){
assertNotNull(DROP+COMMAND_NULL,command);
assertTrue(DROP +TEST_IF_THE_COMMAND_IS_CREATED,command!=UnexecutableCommand.INSTANCE);
assertTrue(DROP+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DROP +TEST_THE_EXECUTION,compartment.getChildren().size()==MAX);
assertTrue(DROP +TEST_THE_EXECUTION,((Element)((View)getTopEditPart().getModel()).getElement()).getOwnedElements().size()==MAX);
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLink.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLink.java
index 9e91ae32194..f4d3949fdbd 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLink.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLink.java
@@ -130,17 +130,10 @@ public class TestLink extends AbstractPapyrusTestCase {
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);
- getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DESTROY_DELETION +INITIALIZATION_TEST,source.getSourceConnections().size()==0);
assertTrue(DESTROY_DELETION +INITIALIZATION_TEST,getRootSemanticModel().getOwnedElements().size()==4);
-
- EditingDomainUndoContext undoContext= new EditingDomainUndoContext(getEditingDomain());
- try{
- OperationHistoryFactory.getOperationHistory().undo(undoContext, new NullProgressMonitor(), null);
- }catch (Exception e) {
- System.err.println(e);
- }
-
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(DESTROY_DELETION +INITIALIZATION_TEST,source.getSourceConnections().size()==1);
assertTrue(DESTROY_DELETION +INITIALIZATION_TEST,getRootSemanticModel().getOwnedElements().size()==5);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
@@ -251,7 +244,7 @@ public class TestLink extends AbstractPapyrusTestCase {
Command command = target.getCommand(createConnectionViewRequest(linkType, source, target));
assertNotNull(CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,((Diagram)getRootView()).getEdges().size()==1);
assertTrue(CREATION +INITIALIZATION_TEST,getRootSemanticModel().getOwnedElements().size()==5);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
@@ -463,7 +456,7 @@ public class TestLink extends AbstractPapyrusTestCase {
assertNotNull(CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==allowed);
if(allowed){
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,((Diagram)getRootView()).getEdges().size()==2);
assertTrue(CREATION +INITIALIZATION_TEST,getRootSemanticModel().getOwnedElements().size()==6);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLinkOwnedBySource.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLinkOwnedBySource.java
index 0bbf5674684..f7625db2dfa 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLinkOwnedBySource.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestLinkOwnedBySource.java
@@ -98,17 +98,11 @@ public class TestLinkOwnedBySource extends TestLink {
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);
- getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,source.getSourceConnections().size()==0);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,getRootSemanticModel().getOwnedElements().size()==4);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size()==0);
-
- EditingDomainUndoContext undoContext= new EditingDomainUndoContext(getEditingDomain());
- try{
- OperationHistoryFactory.getOperationHistory().undo(undoContext, new NullProgressMonitor(), null);
- }catch (Exception e) {
- System.err.println(e);
- }
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,source.getSourceConnections().size()==1);
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,getRootSemanticModel().getOwnedElements().size()==4);
@@ -174,7 +168,7 @@ public class TestLinkOwnedBySource extends TestLink {
Command command = target.getCommand(createConnectionViewRequest(linkType, source, target));
assertNotNull(CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +TEST_THE_EXECUTION,((Diagram)getRootView()).getEdges().size()==1);
assertTrue(CREATION +TEST_THE_EXECUTION,getRootSemanticModel().getOwnedElements().size()==4);
assertTrue(CREATION +TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size()==1);
@@ -348,7 +342,7 @@ public class TestLinkOwnedBySource extends TestLink {
assertNotNull(CREATION+COMMAND_NULL,command);
assertTrue(CONTAINER_CREATION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==allowed);
if(allowed){
- diagramEditor.getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(CREATION +INITIALIZATION_TEST,((Diagram)getRootView()).getEdges().size()==2);
assertTrue(CREATION +INITIALIZATION_TEST,getRootSemanticModel().getOwnedElements().size()==4);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestTopNode.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestTopNode.java
index 0bb0fe3a981..e55be4f66dd 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestTopNode.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.clazz.test/test/org/eclipse/papyrus/diagram/clazz/test/canonical/TestTopNode.java
@@ -114,19 +114,10 @@ public class TestTopNode extends AbstractPapyrusTestCase {
assertTrue(DESTROY_DELETION+TEST_IF_THE_COMMAND_CAN_BE_EXECUTED,command.canExecute()==true);
//getDiagramEditPart().getDiagramEditDomain().getDiagramCommandStack().execute(command);
//getDiagramEditPart().getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
- getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,getDiagramEditPart().getChildren().size()==0);
assertTrue(DESTROY_DELETION +TEST_THE_EXECUTION,getRootSemanticModel().getOwnedElements().size()==0);
-
- EditingDomainUndoContext undoContext= new EditingDomainUndoContext(getEditingDomain());
- try{
- OperationHistoryFactory.getOperationHistory().undo(undoContext, new NullProgressMonitor(), null);
- }catch (Exception e) {
- System.err.println(e);
- }
-
- //diagramEditor.getEditingDomain().getCommandStack().undo();
- //diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,getDiagramEditPart().getChildren().size()==1);
assertTrue(DESTROY_DELETION +TEST_THE_UNDO,getRootSemanticModel().getOwnedElements().size()==1);
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();

Back to the top