Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementRelatedTest.java43
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementTest.java16
2 files changed, 47 insertions, 12 deletions
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementRelatedTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementRelatedTest.java
index 50caf9f0a52..8e61ebb74fe 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementRelatedTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/requirements/tests/RequirementRelatedTest.java
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.sysml.requirements.tests;
import junit.framework.TestCase;
import junit.textui.TestRunner;
+import org.eclipse.papyrus.sysml.requirements.Copy;
import org.eclipse.papyrus.sysml.requirements.Requirement;
import org.eclipse.papyrus.sysml.requirements.RequirementRelated;
import org.eclipse.papyrus.sysml.requirements.RequirementsFactory;
@@ -65,6 +66,17 @@ public class RequirementRelatedTest extends TestCase {
protected Model model = null;
// ////////////////////////////////////////////////////////////////////
+
+ protected Class copy = null;
+
+ protected Class master = null;
+
+ protected Requirement copy_req = null;
+
+ protected Requirement master_req = null;
+
+ protected RequirementRelated copy_reqR = null;
+
protected Requirement trace1_req = null;
protected Requirement trace2_req = null;
@@ -171,19 +183,36 @@ public class RequirementRelatedTest extends TestCase {
// Add "Trace" (Abstraction)
// trace1, trace2 -> traced
Abstraction t11 = UMLFactory.eINSTANCE.createAbstraction();
- t11.getClients().add(trace1);
- t11.getSuppliers().add(traced);
+ t11.getClients().add(traced);
+ t11.getSuppliers().add(trace1);
model.getPackagedElements().add(t11);
@SuppressWarnings("unused")
Trace t_t11 = (Trace)t11.applyStereotype(t11.getApplicableStereotype(StandardResource.TRACE_ID));
Abstraction t12 = UMLFactory.eINSTANCE.createAbstraction();
- t12.getClients().add(trace2);
- t12.getSuppliers().add(traced);
+ t12.getClients().add(traced);
+ t12.getSuppliers().add(trace2);
model.getPackagedElements().add(t12);
@SuppressWarnings("unused")
Trace t_t12 = (Trace)t12.applyStereotype(t12.getApplicableStereotype(StandardResource.TRACE_ID));
+ master = model.createOwnedClass("master", false);
+ master_req = (Requirement)master.applyStereotype(master.getApplicableStereotype(SysmlResource.REQUIREMENT_ID));
+
+ copy = model.createOwnedClass("copy", false);
+ copy_req = (Requirement)copy.applyStereotype(copy.getApplicableStereotype(SysmlResource.REQUIREMENT_ID));
+ copy_reqR = (RequirementRelated)copy.applyStereotype(copy.getApplicableStereotype(SysmlResource.REQUIREMENT_RELATED_ID));
+
+ // Add "copy" (Abstraction) between master and copy
+ // copy -> master
+ Abstraction c_m = UMLFactory.eINSTANCE.createAbstraction();
+ c_m.getClients().add(copy);
+ c_m.getSuppliers().add(master);
+ model.getPackagedElements().add(c_m);
+ @SuppressWarnings("unused")
+ Copy copy_c_m = (Copy)c_m.applyStereotype(c_m.getApplicableStereotype(SysmlResource.COPY_ID));
+
+
// ////////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////
@@ -355,6 +384,12 @@ public class RequirementRelatedTest extends TestCase {
if(!traced_reqR.getTracedFrom().contains(trace2_req)) {
fail();
}
+
+ // Should not include Trace subtypes clients
+ // Test getter through Copy (should not be taken into account see bug #352563)
+ if(copy_reqR.getTracedFrom().contains(master)) {
+ fail();
+ }
}
/**
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 b73090af569..e9fb147f6bc 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
@@ -552,25 +552,25 @@ public class RequirementTest extends TestCase {
}
// DeriveReqt / Verify / Copy inherits from Trace
- // Test getter through Copy
- if(!master_req.getTracedTo().contains(copy)) {
+ // Test getter through Copy (should not be taken into account see bug #352563)
+ if(master_req.getTracedTo().contains(copy)) {
fail();
}
// Test getter through DeriveReqt (tracedTo = Clients)
- // derived1 -> [derive1_req, derive2_req]
- // derived2 -> [derive2_req]
- if(!derive1_req.getTracedTo().contains(derived1)) {
+ // derived1 -> [derive1_req, derive2_req] (should not be taken into account see bug #352563)
+ // derived2 -> [derive2_req] (should not be taken into account see bug #352563)
+ if(derive1_req.getTracedTo().contains(derived1)) {
fail();
}
- if(!derive2_req.getTracedTo().contains(derived1)) {
+ if(derive2_req.getTracedTo().contains(derived1)) {
fail();
}
- if(!derive2_req.getTracedTo().contains(derived2)) {
+ if(derive2_req.getTracedTo().contains(derived2)) {
fail();
}
- // Test getter through Verify
+ // Test getter through Verify (should not be taken into account see bug #352563)
// Should not happen...
// Direct test

Back to the top