Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorytanguy2012-03-07 17:10:23 +0000
committerytanguy2012-03-07 17:10:23 +0000
commite2e1a9366fe857016eb4302ce101b8b5f9bcb655 (patch)
tree37a09d16e0259d95b5909eb76a1b89b30cd43a18
parentb4a814edbc7ecfce4642e286ea37d1ccda4bd974 (diff)
downloadorg.eclipse.papyrus-e2e1a9366fe857016eb4302ce101b8b5f9bcb655.tar.gz
org.eclipse.papyrus-e2e1a9366fe857016eb4302ce101b8b5f9bcb655.tar.xz
org.eclipse.papyrus-e2e1a9366fe857016eb4302ce101b8b5f9bcb655.zip
bug 369422: [Refactoring] Adapt Element Edit Service JUnit tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369422
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.service.types.tests/src/org/eclipse/papyrus/sysml/service/types/tests/registry/TestElementTypeRegistryContent.java115
1 files changed, 115 insertions, 0 deletions
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.service.types.tests/src/org/eclipse/papyrus/sysml/service/types/tests/registry/TestElementTypeRegistryContent.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.service.types.tests/src/org/eclipse/papyrus/sysml/service/types/tests/registry/TestElementTypeRegistryContent.java
index 6677128ef81..5b117bca737 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.service.types.tests/src/org/eclipse/papyrus/sysml/service/types/tests/registry/TestElementTypeRegistryContent.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.service.types.tests/src/org/eclipse/papyrus/sysml/service/types/tests/registry/TestElementTypeRegistryContent.java
@@ -12,6 +12,7 @@ import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditServiceProvider;
+import org.eclipse.papyrus.sysml.activities.ActivitiesPackage;
import org.eclipse.papyrus.sysml.allocations.AllocationsPackage;
import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
@@ -31,6 +32,8 @@ public class TestElementTypeRegistryContent {
private static final String PAPYRUS_ELEMENT_TYPE_PREFIX = "org.eclipse.papyrus.sysml."; //$NON-NLS-1$
+ private static final String PAPYRUS_ST_APPLICATION_TYPE_PREFIX = "org.eclipse.papyrus.sysml.stereotype."; //$NON-NLS-1$
+
@Test
public void testRegistryContentForSysMLModelElements() {
@@ -48,6 +51,22 @@ public class TestElementTypeRegistryContent {
}
@Test
+ public void testRegistryContentForStereotypeApplicationsInModelElements() {
+
+ // Iterate over SysML ModelElements sub-profile contents
+ Iterator<EObject> it = ModelelementsPackage.eINSTANCE.eAllContents();
+ while(it.hasNext()) {
+ EObject eObject = it.next();
+ if (eObject instanceof EClass) {
+
+ EClass eClass = (EClass) eObject;
+ assertTrue("No type found in Papyrus context for " + eClass.getName(),
+ ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(PAPYRUS_ST_APPLICATION_TYPE_PREFIX + eClass.getName()));
+ }
+ }
+ }
+
+ @Test
public void testRegistryContentForSysMLBlocks() {
// Iterate over SysML Blocks sub-profile contents
@@ -94,6 +113,22 @@ public class TestElementTypeRegistryContent {
}
@Test
+ public void testRegistryContentForStereotypeApplicationsInBlocks() {
+
+ // Iterate over SysML Blocks sub-profile contents
+ Iterator<EObject> it = BlocksPackage.eINSTANCE.eAllContents();
+ while(it.hasNext()) {
+ EObject eObject = it.next();
+ if (eObject instanceof EClass) {
+ EClass eClass = (EClass) eObject;
+
+ assertTrue("No type found in Papyrus context for " + eClass.getName(),
+ ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(PAPYRUS_ST_APPLICATION_TYPE_PREFIX + eClass.getName()));
+ }
+ }
+ }
+
+ @Test
public void testRegistryContentForSysMLConstraints() {
// Iterate over SysML Constraints sub-profile contents
@@ -110,6 +145,38 @@ public class TestElementTypeRegistryContent {
}
@Test
+ public void testRegistryContentForStereotypeApplicationsInConstraints() {
+
+ // Iterate over SysML Constraints sub-profile contents
+ Iterator<EObject> it = ConstraintsPackage.eINSTANCE.eAllContents();
+ while(it.hasNext()) {
+ EObject eObject = it.next();
+ if (eObject instanceof EClass) {
+
+ EClass eClass = (EClass) eObject;
+ assertTrue("No type found in Papyrus context for " + eClass.getName(),
+ ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(PAPYRUS_ST_APPLICATION_TYPE_PREFIX + eClass.getName()));
+ }
+ }
+ }
+
+ @Test
+ public void testRegistryContentForStereotypeApplicationsInActivities() {
+
+ // Iterate over SysML Activities sub-profile contents
+ Iterator<EObject> it = ActivitiesPackage.eINSTANCE.eAllContents();
+ while(it.hasNext()) {
+ EObject eObject = it.next();
+ if (eObject instanceof EClass) {
+
+ EClass eClass = (EClass) eObject;
+ assertTrue("No type found in Papyrus context for " + eClass.getName(),
+ ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(PAPYRUS_ST_APPLICATION_TYPE_PREFIX + eClass.getName()));
+ }
+ }
+ }
+
+ @Test
public void testRegistryContentForSysMLRequirements() {
// Iterate over SysML Requirements sub-profile contents
@@ -134,6 +201,22 @@ public class TestElementTypeRegistryContent {
}
}
}
+
+ @Test
+ public void testRegistryContentForStereotypeApplicationsInRequirements() {
+
+ // Iterate over SysML Requirements sub-profile contents
+ Iterator<EObject> it = RequirementsPackage.eINSTANCE.eAllContents();
+ while(it.hasNext()) {
+ EObject eObject = it.next();
+ if (eObject instanceof EClass) {
+ EClass eClass = (EClass) eObject;
+
+ assertTrue("No type found in Papyrus context for " + eClass.getName(),
+ ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(PAPYRUS_ST_APPLICATION_TYPE_PREFIX + eClass.getName()));
+ }
+ }
+ }
@Test
public void testRegistryContentForSysMLAllocations() {
@@ -162,6 +245,22 @@ public class TestElementTypeRegistryContent {
}
@Test
+ public void testRegistryContentForStereotypeApplicationsInAllocations() {
+
+ // Iterate over SysML Allocations sub-profile contents
+ Iterator<EObject> it = AllocationsPackage.eINSTANCE.eAllContents();
+ while(it.hasNext()) {
+ EObject eObject = it.next();
+ if (eObject instanceof EClass) {
+ EClass eClass = (EClass) eObject;
+
+ assertTrue("No type found in Papyrus context for " + eClass.getName(),
+ ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(PAPYRUS_ST_APPLICATION_TYPE_PREFIX + eClass.getName()));
+ }
+ }
+ }
+
+ @Test
public void testRegistryContentForSysMLPortAndFlows() {
// Iterate over SysML PortAndFlows sub-profile contents
@@ -178,6 +277,22 @@ public class TestElementTypeRegistryContent {
}
@Test
+ public void testRegistryContentForStereotypeApplicationsInPortAndFlows() {
+
+ // Iterate over SysML PortAndFlows sub-profile contents
+ Iterator<EObject> it = PortandflowsPackage.eINSTANCE.eAllContents();
+ while(it.hasNext()) {
+ EObject eObject = it.next();
+ if (eObject instanceof EClass) {
+
+ EClass eClass = (EClass) eObject;
+ assertTrue("No type found in Papyrus context for " + eClass.getName(),
+ ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(PAPYRUS_ST_APPLICATION_TYPE_PREFIX + eClass.getName()));
+ }
+ }
+ }
+
+ @Test
public void testRegistryContentForSysMLAssociations() {
IClientContext context = ClientContextManager.getInstance().getClientContext(PAPYRUS_CONTEXT_ID);

Back to the top