Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-03-25 13:55:00 -0400
committerCamille Letavernier2014-03-25 14:00:06 -0400
commit1f3f8d57431a7ea4e27eae672543786b2ea1ff0e (patch)
treeb158962042d8567b08b1f63c391befcb7da205ba /tests/junit
parentb4807d069b25d37ed882cab18ba962952e505872 (diff)
downloadorg.eclipse.papyrus-1f3f8d57431a7ea4e27eae672543786b2ea1ff0e.tar.gz
org.eclipse.papyrus-1f3f8d57431a7ea4e27eae672543786b2ea1ff0e.tar.xz
org.eclipse.papyrus-1f3f8d57431a7ea4e27eae672543786b2ea1ff0e.zip
431145: [Requirement Diagram] Test failures
https://bugs.eclipse.org/bugs/show_bug.cgi?id=431145 - Partial fix: Take the number of required profiles into account when checking the initial state, in AbstractTestNode (Expect N children, N being the number of required profiles, instead of 0)
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch2
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/org.eclipse.papyrus.sysml.diagram.requirement.test.launch2
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/src/org/eclipse/papyrus/sysml/diagram/requirement/test/IRequirementDiagramTestsConstants.java24
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java7
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java4
6 files changed, 23 insertions, 19 deletions
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch
index ba4f82478a6..86add655995 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch
@@ -11,7 +11,7 @@
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Papyrus ALL tests"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-all-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java"/>
</listAttribute>
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/META-INF/MANIFEST.MF
index 605842aacc4..19fa63ae5a2 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/META-INF/MANIFEST.MF
@@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
org.junit;bundle-version="4.10.0",
- org.eclipse.papyrus.sysml.diagram.requirement;bundle-version="1.0.0"
+ org.eclipse.papyrus.sysml.diagram.requirement;bundle-version="1.0.0",
+ org.eclipse.papyrus.sysml;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.sysml.diagram.requirement.test,
org.eclipse.papyrus.sysml.diagram.requirement.test.canonical,
org.eclipse.papyrus.sysml.diagram.requirement.test.load
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/org.eclipse.papyrus.sysml.diagram.requirement.test.launch b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/org.eclipse.papyrus.sysml.diagram.requirement.test.launch
index 93b3369fc13..381eb8e3b4e 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/org.eclipse.papyrus.sysml.diagram.requirement.test.launch
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/org.eclipse.papyrus.sysml.diagram.requirement.test.launch
@@ -12,7 +12,7 @@
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-requirements-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/org.eclipse.papyrus.sysml.diagram.requirement.tests/src/org/eclipse/papyrus/sysml/diagram/requirement/test/AllTests.java"/>
</listAttribute>
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/src/org/eclipse/papyrus/sysml/diagram/requirement/test/IRequirementDiagramTestsConstants.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/src/org/eclipse/papyrus/sysml/diagram/requirement/test/IRequirementDiagramTestsConstants.java
index 21b11e28514..5daf4cbc205 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/src/org/eclipse/papyrus/sysml/diagram/requirement/test/IRequirementDiagramTestsConstants.java
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement.tests/src/org/eclipse/papyrus/sysml/diagram/requirement/test/IRequirementDiagramTestsConstants.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -12,6 +12,11 @@
/*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.requirement.test;
+import org.eclipse.papyrus.sysml.SysmlPackage;
+import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
+
public interface IRequirementDiagramTestsConstants {
/** name of the test project */
@@ -20,18 +25,13 @@ public interface IRequirementDiagramTestsConstants {
/** name of the test model */
public final String FILE_NAME = "RequirmentDiagramTest.di";
- public final String PROFILE_SYSML = "http://www.eclipse.org/papyrus/0.7.0/SysML";
+ public final String PROFILE_SYSML = SysmlPackage.eNS_URI;
- public final String PROFILE_SYSML_BLOCKS = "http://www.eclipse.org/papyrus/0.7.0/SysML/Blocks";
+ public final String PROFILE_SYSML_PORTS = PortandflowsPackage.eNS_URI;
- public final String PROFILE_SYSML_PORTS = "http://www.eclipse.org/papyrus/0.7.0/SysML/PortAndFlows";
+ public final String PROFILE_SYSML_CONSTRAINTS = ConstraintsPackage.eNS_URI;
- public final String PROFILE_SYSML_CONSTRAINTS = "http://www.eclipse.org/papyrus/0.7.0/SysML/Constraints";
+ public final String PROFILE_SYSML_REQUIREMENTS = RequirementsPackage.eNS_URI;
- public final String[] PROFILES = new String[] {
- PROFILE_SYSML,
- PROFILE_SYSML_BLOCKS,
- PROFILE_SYSML_PORTS,
- PROFILE_SYSML_CONSTRAINTS
- };
-} \ No newline at end of file
+ public final String[] PROFILES = new String[]{ PROFILE_SYSML, PROFILE_SYSML_PORTS, PROFILE_SYSML_CONSTRAINTS, PROFILE_SYSML_REQUIREMENTS };
+}
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java
index 21468d19e18..51c675db780 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/AbstractTestNode.java
@@ -13,6 +13,7 @@
package org.eclipse.papyrus.diagram.tests.canonical;
import java.util.ArrayList;
+import java.util.List;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.ecore.EClass;
@@ -306,7 +307,9 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
command = null;
//CREATION
assertEquals(CREATION + INITIALIZATION_TEST, expectedGraphicalChildren, getContainerEditPart().getChildren().size());
- assertEquals(CREATION + INITIALIZATION_TEST, expectedSemanticChildren, getRootSemanticModel().getOwnedElements().size());
+ Element root = getRootSemanticModel();
+ List<Element> ownedElements = root.getOwnedElements();
+ assertEquals(CREATION + INITIALIZATION_TEST, expectedSemanticChildren, ownedElements.size());
final CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(type, getContainerEditPart().getDiagramPreferencesHint());
Display.getDefault().syncExec(new Runnable() {
@@ -344,7 +347,7 @@ public abstract class AbstractTestNode extends org.eclipse.papyrus.diagram.tests
* the type
*/
public void testToCreateANode(IElementType type) {
- testToCreateANode(type, 0, 0, 1, 1);
+ testToCreateANode(type, 0, getRequiredProfiles().length, 1, 1);
}
/**
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java
index d170a75aba1..81e8ae05840 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLink.java
@@ -250,8 +250,8 @@ public abstract class TestLink extends AbstractPapyrusTestCase {
}
public void installEnvironment(IElementType sourceType, IElementType targetType) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 0);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 0);
+ assertEquals(CREATION + INITIALIZATION_TEST, 0, getDiagramEditPart().getChildren().size());
+ assertEquals(CREATION + INITIALIZATION_TEST, 0, getRootSemanticModel().getOwnedElements().size());
//create the source
CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
requestcreation.setLocation(new Point(100, 100));

Back to the top