Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-04-04 16:39:44 +0000
committerCamille Letavernier2014-04-04 16:39:44 +0000
commit81c1e70f21cc3cfc2d45af7e5e2f0833c667ae38 (patch)
tree2813f9cfeafce36149901340de58c8bdd0ff7616 /tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test
parent7d44f131a17ef9bcbe562d4d5c2adb3b7f6d2e55 (diff)
downloadorg.eclipse.papyrus-81c1e70f21cc3cfc2d45af7e5e2f0833c667ae38.tar.gz
org.eclipse.papyrus-81c1e70f21cc3cfc2d45af7e5e2f0833c667ae38.tar.xz
org.eclipse.papyrus-81c1e70f21cc3cfc2d45af7e5e2f0833c667ae38.zip
432050: [Requirements Diagram Tests] The SysML Requirements Diagram
tests are invalid https://bugs.eclipse.org/bugs/show_bug.cgi?id=432050 - Disable Requirements Diagram Tests - Update Canonical Tests to JUnit 4 style
Diffstat (limited to 'tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test')
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithDifferentParentLink.java69
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithSameParentLink.java78
2 files changed, 80 insertions, 67 deletions
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithDifferentParentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithDifferentParentLink.java
index 34841a567d7..4288a720c74 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithDifferentParentLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithDifferentParentLink.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2014 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,8 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.composite.test.canonical;
+import static org.junit.Assert.assertTrue;
+
import java.util.List;
import org.eclipse.gef.commands.Command;
@@ -25,6 +27,7 @@ import org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent;
import org.eclipse.papyrus.uml.diagram.composite.CreateCompositeDiagramCommand;
import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.composite.test.ICompositeDiagramTestsConstants;
+import org.junit.Before;
import org.junit.Test;
@@ -43,7 +46,7 @@ public class TestCompositeDiagramElementWithDifferentParentLink extends TestLink
* @return the diagram command creation
* @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getDiagramCommandCreation()
*/
-
+
@Override
protected ICreationCommand getDiagramCommandCreation() {
return new CreateCompositeDiagramCommand();
@@ -55,7 +58,7 @@ public class TestCompositeDiagramElementWithDifferentParentLink extends TestLink
* @return the project name
* @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getProjectName()
*/
-
+
@Override
protected String getProjectName() {
return ICompositeDiagramTestsConstants.PROJECT_NAME;
@@ -67,31 +70,32 @@ public class TestCompositeDiagramElementWithDifferentParentLink extends TestLink
* @return the file name
* @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getFileName()
*/
-
+
@Override
protected String getFileName() {
return ICompositeDiagramTestsConstants.FILE_NAME;
}
-
+
/**
* Sets the up.
*
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
* @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#setUp()
*/
-
+ @Before
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
parentType = UMLElementTypes.Class_2073;
}
-
+
/**
* Inits the configuration for a link owned by the parent.
*/
- protected void initConfLinkOwnedByParent(){
+ protected void initConfLinkOwnedByParent() {
// expected values before link creation
beginRootSemanticOwnedElementSize = 2;
beginDiagramEditPartChildrenSize = 2;
@@ -101,24 +105,27 @@ public class TestCompositeDiagramElementWithDifferentParentLink extends TestLink
// expected values after link creation
endSourceConnectionsSize = beginSourceConnectionsSize + 1;
endRootSemanticOwnedElementSize = beginRootSemanticOwnedElementSize + 1;
- endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize;
+ endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize;
endRootEdgeSize = beginRootEdgeSize + 1;
endRootViewChildrenSize = beginRootViewChildrenSize;
}
-
+
/**
* Install environment.
*
- * @param sourceType the source type
- * @param targetType the target type
- * @see org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent#installEnvironment(org.eclipse.gmf.runtime.emf.type.core.IElementType, org.eclipse.gmf.runtime.emf.type.core.IElementType)
+ * @param sourceType
+ * the source type
+ * @param targetType
+ * the target type
+ * @see org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent#installEnvironment(org.eclipse.gmf.runtime.emf.type.core.IElementType,
+ * org.eclipse.gmf.runtime.emf.type.core.IElementType)
*/
-
+
@Override
public void installEnvironment(IElementType sourceType, IElementType targetType) {
super.installEnvironment(sourceType, targetType);
-
+
//create the parent source
CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(parentType, getDiagramEditPart().getDiagramPreferencesHint());
requestcreation.setLocation(DEFAULT_PARENT_LOCATION);
@@ -126,27 +133,27 @@ public class TestCompositeDiagramElementWithDifferentParentLink extends TestLink
assertTrue(command.canExecute());
diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
targetParent = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
-
+
//create the target
requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
requestcreation.setLocation(DEFAULT_SOURCE_LOCATION);
command = targetParent.getCommand(requestcreation);
assertTrue(command.canExecute());
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
// FIXME : get(0) : header; get(1) : container
List<GraphicalEditPart> children = targetParent.getChildren();
- target = (GraphicalEditPart)children.get(2);
+ target = children.get(2);
}
-
+
/**
* Test to manage port connector.
*/
@Test
public void testToManagePortConnector() {
testImpossibleToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Connector_4013);
- }
-
+ }
+
/**
* Test to manage port usage.
*/
@@ -154,8 +161,8 @@ public class TestCompositeDiagramElementWithDifferentParentLink extends TestLink
public void testToManagePortUsage() {
initConfLinkOwnedByParent();
testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Usage_4008, UMLElementTypes.Class_2073, true);
- }
-
+ }
+
/**
* Test to manage port abstraction.
*/
@@ -163,8 +170,8 @@ public class TestCompositeDiagramElementWithDifferentParentLink extends TestLink
public void testToManagePortAbstraction() {
initConfLinkOwnedByParent();
testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Abstraction_4007, UMLElementTypes.Class_2073, true);
- }
-
+ }
+
/**
* Test to manage port substitution.
*/
@@ -172,14 +179,14 @@ public class TestCompositeDiagramElementWithDifferentParentLink extends TestLink
public void testToManagePortSubstitution() {
initConfLinkOwnedByParent();
testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Substitution_4011, UMLElementTypes.Class_2073, true);
- }
-
+ }
+
/**
* Test to manage port generalization.
*/
@Test
public void testToManagePortGeneralization() {
testImpossibleToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Generalization_4015);
- }
-
+ }
+
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithSameParentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithSameParentLink.java
index 3ba2b068662..09e7dac2210 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithSameParentLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithSameParentLink.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2014 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,8 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.composite.test.canonical;
+import static org.junit.Assert.assertTrue;
+
import java.util.List;
import org.eclipse.gef.commands.Command;
@@ -25,6 +27,7 @@ import org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent;
import org.eclipse.papyrus.uml.diagram.composite.CreateCompositeDiagramCommand;
import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.composite.test.ICompositeDiagramTestsConstants;
+import org.junit.Before;
import org.junit.Test;
/**
@@ -32,14 +35,14 @@ import org.junit.Test;
*/
public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithParent {
-
+
/**
* Gets the diagram command creation.
*
* @return the diagram command creation
* @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getDiagramCommandCreation()
*/
-
+
@Override
protected ICreationCommand getDiagramCommandCreation() {
return new CreateCompositeDiagramCommand();
@@ -51,7 +54,7 @@ public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithP
* @return the project name
* @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getProjectName()
*/
-
+
@Override
protected String getProjectName() {
return ICompositeDiagramTestsConstants.PROJECT_NAME;
@@ -63,55 +66,58 @@ public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithP
* @return the file name
* @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getFileName()
*/
-
+
@Override
protected String getFileName() {
return ICompositeDiagramTestsConstants.FILE_NAME;
}
-
+
/**
* Sets the up.
*
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
* @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#setUp()
*/
-
+ @Before
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
parentType = UMLElementTypes.Class_2073;
}
-
+
/**
* Install environment.
*
- * @param sourceType the source type
- * @param targetType the target type
- * @see org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent#installEnvironment(org.eclipse.gmf.runtime.emf.type.core.IElementType, org.eclipse.gmf.runtime.emf.type.core.IElementType)
+ * @param sourceType
+ * the source type
+ * @param targetType
+ * the target type
+ * @see org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent#installEnvironment(org.eclipse.gmf.runtime.emf.type.core.IElementType,
+ * org.eclipse.gmf.runtime.emf.type.core.IElementType)
*/
-
@Override
public void installEnvironment(IElementType sourceType, IElementType targetType) {
super.installEnvironment(sourceType, targetType);
-
+
//create the target
CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
requestcreation.setLocation(DEFAULT_SOURCE_LOCATION);
Command command = parent.getCommand(requestcreation);
assertTrue(command.canExecute());
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
// FIXME : get(0) : header; get(1) : container
List<GraphicalEditPart> children = parent.getChildren();
- target = (GraphicalEditPart)children.get(3);
+ target = children.get(3);
}
-
+
/**
* Init the configuration for a link owned by the parent. (Connector)
*/
- protected void initConfLinkOwnedByParent(){
+ protected void initConfLinkOwnedByParent() {
// expected values before link creation
beginRootSemanticOwnedElementSize = 1;
beginDiagramEditPartChildrenSize = 1;
@@ -121,16 +127,16 @@ public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithP
// expected values after link creation
endSourceConnectionsSize = beginSourceConnectionsSize + 1;
endRootSemanticOwnedElementSize = beginRootSemanticOwnedElementSize;
- endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize;
- endRootEdgeSize = beginRootEdgeSize+1;
+ endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize;
+ endRootEdgeSize = beginRootEdgeSize + 1;
endRootViewChildrenSize = beginRootViewChildrenSize;
}
-
-
+
+
/**
* Init the configuration for a link owned by the root. (Usage)
*/
- protected void initConfLinkOwnedByDiagram(){
+ protected void initConfLinkOwnedByDiagram() {
// expected values before link creation
beginRootSemanticOwnedElementSize = 1;
beginDiagramEditPartChildrenSize = 1;
@@ -140,11 +146,11 @@ public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithP
// expected values after link creation
endSourceConnectionsSize = beginSourceConnectionsSize + 1;
endRootSemanticOwnedElementSize = beginRootSemanticOwnedElementSize + 1;
- endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize;
+ endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize;
endRootEdgeSize = beginRootEdgeSize + 1;
endRootViewChildrenSize = beginRootViewChildrenSize;
- }
-
+ }
+
/**
* Test to manage port connector.
*/
@@ -153,7 +159,7 @@ public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithP
initConfLinkOwnedByParent();
testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Connector_4013, UMLElementTypes.Class_2073, true);
}
-
+
/**
* Test to manage port usage.
*/
@@ -161,8 +167,8 @@ public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithP
public void testToManagePortUsage() {
initConfLinkOwnedByDiagram();
testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Usage_4008, UMLElementTypes.Class_2073, true);
- }
-
+ }
+
/**
* Test to manage port abstraction.
*/
@@ -170,8 +176,8 @@ public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithP
public void testToManagePortAbstraction() {
initConfLinkOwnedByDiagram();
testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Abstraction_4007, UMLElementTypes.Class_2073, true);
- }
-
+ }
+
/**
* Test to manage port substitution.
*/
@@ -179,14 +185,14 @@ public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithP
public void testToManagePortSubstitution() {
initConfLinkOwnedByDiagram();
testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Substitution_4011, UMLElementTypes.Class_2073, true);
- }
-
+ }
+
/**
* Test to manage port generalization.
*/
@Test
public void testToManagePortGeneralization() {
testImpossibleToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Generalization_4015);
- }
-
+ }
+
}

Back to the top