Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorytanguy2011-07-18 11:06:49 +0000
committerytanguy2011-07-18 11:06:49 +0000
commit8306b6ca2c8ab31c61a5530802650045bdb6ceb9 (patch)
tree8296dcb19d3b1436ee0d68fbde4cbe1bec9c5a00 /tests
parentf1dc69ea40edaf324d1bfe5b0046414f89743e37 (diff)
downloadorg.eclipse.papyrus-8306b6ca2c8ab31c61a5530802650045bdb6ceb9.tar.gz
org.eclipse.papyrus-8306b6ca2c8ab31c61a5530802650045bdb6ceb9.tar.xz
org.eclipse.papyrus-8306b6ca2c8ab31c61a5530802650045bdb6ceb9.zip
NEW - bug 352331: [SysML Static Profile] Deprecated constraint on Verify ends is still used (client is not necessarily a TestCase)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352331
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementTest.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementTest.java
index e402b4699f4..8b0c3a7c127 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementTest.java
@@ -30,6 +30,7 @@ import org.eclipse.papyrus.uml.standard.util.StandardResource;
import org.eclipse.uml2.uml.Abstraction;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Operation;
import org.eclipse.uml2.uml.Realization;
import org.eclipse.uml2.uml.UMLFactory;
@@ -142,6 +143,8 @@ public class RequirementTest extends TestCase {
protected org.eclipse.papyrus.sysml.requirements.TestCase testCase1 = null;
+ protected NamedElement verifierNamedElement = null;
+
// ////////////////////////////////////////////////////////////////////
protected org.eclipse.papyrus.sysml.requirements.TestCase testCase2 = null;
@@ -360,6 +363,8 @@ public class RequirementTest extends TestCase {
// Prepare getVerifiedBy test elements
// ////////////////////////////////////////////////////////////////////
+ verifierNamedElement = model.createOwnedClass("verifierNamedElement", false);
+
Class verified = model.createOwnedClass("verified", false);
verified_req = (Requirement)verified.applyStereotype(verified.getApplicableStereotype(SysmlResource.REQUIREMENT_ID));
@@ -386,6 +391,15 @@ public class RequirementTest extends TestCase {
@SuppressWarnings("unused")
Verify v_t2_v = (Verify)t2_v.applyStereotype(t2_v.getApplicableStereotype(SysmlResource.VERIFY_ID));
+ // Add "Verify" (Abstraction)
+ // verifierNamedElement -> verified
+ Abstraction t3_v = UMLFactory.eINSTANCE.createAbstraction();
+ t3_v.getClients().add(verifierNamedElement);
+ t3_v.getSuppliers().add(verified);
+ model.getPackagedElements().add(t3_v);
+ @SuppressWarnings("unused")
+ Verify v_t3_v = (Verify)t3_v.applyStereotype(t3_v.getApplicableStereotype(SysmlResource.VERIFY_ID));
+
// ////////////////////////////////////////////////////////////////////
}
@@ -584,13 +598,16 @@ public class RequirementTest extends TestCase {
}
// Test getVerifiedBy getter for
- // [testCase1, testCase2] -> verified_req
+ // [testCase1, testCase2, verifierNamedElement] -> verified_req
if(!verified_req.getVerifiedBy().contains(testCase1)) {
fail();
}
if(!verified_req.getVerifiedBy().contains(testCase2)) {
fail();
}
+ if(!verified_req.getVerifiedBy().contains(verifierNamedElement)) {
+ fail();
+ }
}
} // RequirementTest

Back to the top