Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetya Sabeva2012-10-09 11:26:54 +0000
committerPetya Sabeva2012-10-09 11:26:54 +0000
commite6f3f1a928f874a5892dc13e236a82c0970295b3 (patch)
tree73977ca57af87bd46c177d7edd3436fd337bca8b /jpa_diagram_editor
parent8eafdb307f75da370e0cbaff202de27d8ca713f3 (diff)
downloadwebtools.dali-e6f3f1a928f874a5892dc13e236a82c0970295b3.tar.gz
webtools.dali-e6f3f1a928f874a5892dc13e236a82c0970295b3.tar.xz
webtools.dali-e6f3f1a928f874a5892dc13e236a82c0970295b3.zip
Fix failing swtbot tests
Diffstat (limited to 'jpa_diagram_editor')
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/EditorProxy.java60
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/JPADiagramEditorSWTBotTest.java144
2 files changed, 143 insertions, 61 deletions
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/EditorProxy.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/EditorProxy.java
index 960052cab8..e21b6e450f 100644
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/EditorProxy.java
+++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/EditorProxy.java
@@ -20,16 +20,13 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.draw2d.FigureCanvas;
import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.LayerConstants;
import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.ui.internal.contextbuttons.ContextButton;
import org.eclipse.graphiti.ui.internal.contextbuttons.ContextButtonPad;
import org.eclipse.graphiti.ui.internal.parts.DiagramEditPart;
@@ -562,62 +559,62 @@ public class EditorProxy {
}
/**
- * Select the bidirectional relation and call its "Delete" context menu.
+ * Select the bidirectional self relation and call its "Delete" context menu.
* On the confirmation dialog press "No" and assert that
* the connection and the relative relation attributes still exist
* and the "Relation Attributes" sections of the entities' are visible.
* @param jpaDiagramEditor
* @param entity1
- * @param entity2
* @param connection
* @param ownerAttributeName
* @param inverseAttributeName
*/
- public void assertBiDirRelationIsNotDeleted(
+ public void assertSelfBiDirRelationIsNotDeleted(
SWTBotGefEditor jpaDiagramEditor, SWTBotGefEditPart entity1,
- SWTBotGefEditPart entity2,
SWTBotGefConnectionEditPart connection,
String ownerAttributeName, String inverseAttributeName) {
connection.select();
jpaDiagramEditor.clickContextMenu("Delete");
denyDelete();
assertFalse(entity1.sourceConnections().isEmpty());
- assertFalse(entity2.targetConnections().isEmpty());
+ assertFalse(entity1.targetConnections().isEmpty());
connection = entity1.sourceConnections().get(0);
assertNotNull("Attribute must not be deleted!", connection);
assertNotNull(jpaDiagramEditor.getEditPart(ownerAttributeName));
assertNotNull(jpaDiagramEditor.getEditPart(inverseAttributeName));
assertTrue("\"Relation Attributes\" section of the owner entity must be visible!", isSectionVisible(jpaDiagramEditor, entity1, JPAEditorMessages.AddJPAEntityFeature_relationAttributesShapes));
- assertTrue("\"Relation Attributes\" section of the inverse entity must be visible!", isSectionVisible(jpaDiagramEditor, entity2, JPAEditorMessages.AddJPAEntityFeature_relationAttributesShapes));
}
/**
- * Select the bidirectional self relation and call its "Delete" context menu.
+ * Select the bidirectional relation and call its "Delete" context menu.
* On the confirmation dialog press "No" and assert that
* the connection and the relative relation attributes still exist
* and the "Relation Attributes" sections of the entities' are visible.
* @param jpaDiagramEditor
* @param entity1
+ * @param entity2
* @param connection
* @param ownerAttributeName
* @param inverseAttributeName
*/
- public void assertSelfBiDirRelationIsNotDeleted(
+ public void assertBiDirRelationIsNotDeleted(
SWTBotGefEditor jpaDiagramEditor, SWTBotGefEditPart entity1,
+ SWTBotGefEditPart entity2,
SWTBotGefConnectionEditPart connection,
String ownerAttributeName, String inverseAttributeName) {
connection.select();
jpaDiagramEditor.clickContextMenu("Delete");
denyDelete();
assertFalse(entity1.sourceConnections().isEmpty());
- assertFalse(entity1.targetConnections().isEmpty());
+ assertFalse(entity2.targetConnections().isEmpty());
connection = entity1.sourceConnections().get(0);
assertNotNull("Attribute must not be deleted!", connection);
assertNotNull(jpaDiagramEditor.getEditPart(ownerAttributeName));
assertNotNull(jpaDiagramEditor.getEditPart(inverseAttributeName));
assertTrue("\"Relation Attributes\" section of the owner entity must be visible!", isSectionVisible(jpaDiagramEditor, entity1, JPAEditorMessages.AddJPAEntityFeature_relationAttributesShapes));
+ assertTrue("\"Relation Attributes\" section of the inverse entity must be visible!", isSectionVisible(jpaDiagramEditor, entity2, JPAEditorMessages.AddJPAEntityFeature_relationAttributesShapes));
}
-
+
/**
* Select the unidirectional relation and call its "Delete" context menu.
* On the confirmation dialog press "No" and assert that
@@ -924,7 +921,24 @@ public class EditorProxy {
* @param attributeName
* @param relationAttributeMapping - the expected attribute mapping
*/
- public void assertAttributeIsCorretlyMapped(
+ public void assertAttributeIsCorretlyMapped(IFeatureProvider fp,
+ SWTBotGefEditor jpaDiagramEditor, String attributeName, String relationAttributeMapping) {
+
+ SWTBotGefEditPart attribute = jpaDiagramEditor.getEditPart(attributeName);
+ PictogramElement el = (PictogramElement) attribute.part().getModel();
+ Object bo = fp.getBusinessObjectForPictogramElement(el);
+ assertTrue("The selected element is not an attribute!", (bo instanceof JavaPersistentAttribute));
+
+ assertEquals(((JavaPersistentAttribute)bo).getMappingKey(), relationAttributeMapping);
+ }
+
+ /**
+ * Assert that the relation attribute is correctly mapped in the JPA Details view
+ * @param jpaDiagramEditor
+ * @param attributeName
+ * @param relationAttributeMapping - the expected attribute mapping
+ */
+ public void assertAttributeIsCorretlyMappedInJPADetailsView(
SWTBotGefEditor jpaDiagramEditor, String attributeName, String relationAttributeMapping) {
//assert that the JPA Details view is opened
@@ -948,7 +962,23 @@ public class EditorProxy {
* @param typeName
* @param typeMapping - the expected type mapping
*/
- public void assertTypeIsCorretlyMapped(
+ public void assertTypeIsCorretlyMapped(IFeatureProvider fp,
+ SWTBotGefEditor jpaDiagramEditor, String typeName, String typeMapping) {
+
+ SWTBotGefEditPart attribute = jpaDiagramEditor.getEditPart(typeName);
+ PictogramElement el = (PictogramElement) attribute.part().getModel();
+ Object bo = fp.getBusinessObjectForPictogramElement(el);
+ assertTrue("The selected element is not an persistent type!", (bo instanceof JavaPersistentType));
+ assertEquals(((JavaPersistentType)bo).getMappingKey(), typeMapping);
+ }
+
+ /**
+ * Assert that the type is correctly mapped in the JPA Details view
+ * @param jpaDiagramEditor
+ * @param typeName
+ * @param typeMapping - the expected type mapping
+ */
+ public void assertTypeIsCorretlyMappedInJPADetailsView(
SWTBotGefEditor jpaDiagramEditor, String typeName, String typeMapping) {
workbenchBot.viewByTitle("JPA Details").close();
jpaDiagramEditor.clickContextMenu(JPAEditorMessages.JPAEditorToolBehaviorProvider_openJPADetailsView);
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/JPADiagramEditorSWTBotTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/JPADiagramEditorSWTBotTest.java
index d10ddde52e..d9b9ee5112 100644
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/JPADiagramEditorSWTBotTest.java
+++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/JPADiagramEditorSWTBotTest.java
@@ -9,6 +9,8 @@ import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.ui.internal.parts.DiagramEditPart;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jpt.jpa.core.JpaProject;
+import org.eclipse.jpt.jpa.core.MappingKeys;
+import org.eclipse.jpt.jpa.core.context.MappingFile;
import org.eclipse.jpt.jpadiagrameditor.swtbot.tests.internal.JPACreateFactory;
import org.eclipse.jpt.jpadiagrameditor.swtbot.tests.internal.Utils;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
@@ -1012,7 +1014,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "one to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertUniDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, entity2, connection, attributeName);
@@ -1060,7 +1064,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "one to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttrPart = jpaDiagramEditor.getEditPart(attributeName);
@@ -1112,7 +1118,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "one to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertSelfUniDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, connection, attributeName);
@@ -1162,8 +1170,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "one to one");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "one to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertBiDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, entity2, connection, ownerAttributeName,
@@ -1215,8 +1225,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "one to one");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "one to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
//delete the inverse attribute
SWTBotGefEditPart inverseAttr = jpaDiagramEditor.getEditPart(inverseAttributeName);
@@ -1234,7 +1246,8 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
assertEquals(ownerAttributeName, editorProxy.testOwnerRelationAttributeProperties(
jpaDiagramEditor, rel));
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "one to one");
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttr = jpaDiagramEditor.getEditPart(ownerAttributeName);
@@ -1291,8 +1304,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "one to one");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "one to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttrPart = jpaDiagramEditor.getEditPart(ownerAttributeName);
@@ -1349,9 +1364,11 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
-
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "one to one");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "one to one");
+
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertSelfBiDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, connection, ownerAttributeName,
@@ -1400,8 +1417,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
-
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "one to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertUniDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, entity2, connection, attributeName);
@@ -1448,8 +1466,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String attributeName = editorProxy.testOwnerRelationAttributeProperties(
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "one to many");
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttrPart = jpaDiagramEditor.getEditPart(attributeName);
@@ -1501,7 +1520,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "one to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertSelfUniDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, connection, attributeName);
@@ -1548,8 +1569,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String attributeName = editorProxy.testOwnerRelationAttributeProperties(
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
-
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "many to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertUniDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, entity2, connection, attributeName);
@@ -1597,7 +1619,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "many to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttrPart = jpaDiagramEditor.getEditPart(attributeName);
@@ -1649,7 +1673,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "many to one");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertSelfUniDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, connection, attributeName);
@@ -1699,8 +1725,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to one");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "one to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertBiDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, entity2, connection, ownerAttributeName,
@@ -1752,8 +1780,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to one");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "one to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
//delete the inverse attribute
SWTBotGefEditPart inverseAttr = jpaDiagramEditor.getEditPart(inverseAttributeName);
@@ -1771,7 +1801,7 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
assertEquals(ownerAttributeName, editorProxy.testOwnerRelationAttributeProperties(
jpaDiagramEditor, rel));
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to one");
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttr = jpaDiagramEditor.getEditPart(ownerAttributeName);
@@ -1828,8 +1858,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to one");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "one to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttrPart = jpaDiagramEditor.getEditPart(ownerAttributeName);
@@ -1887,8 +1919,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to one");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "one to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertSelfBiDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, connection, ownerAttributeName,
@@ -1937,7 +1971,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "many to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertUniDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, entity2, connection, attributeName);
@@ -1985,7 +2021,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "many to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttrPart = jpaDiagramEditor.getEditPart(attributeName);
@@ -2038,7 +2076,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
jpaDiagramEditor, rel);
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, attributeName, "many to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, attributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertSelfUniDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, connection, attributeName);
@@ -2088,8 +2128,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to many");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "many to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertBiDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, entity2, connection, ownerAttributeName,
@@ -2141,8 +2183,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to many");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "many to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
//delete the inverse attribute
SWTBotGefEditPart inverseAttr = jpaDiagramEditor.getEditPart(inverseAttributeName);
@@ -2161,7 +2205,7 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
assertEquals(ownerAttributeName, editorProxy.testOwnerRelationAttributeProperties(
jpaDiagramEditor, rel));
assertNull(rel.getInverseAnnotatedAttribute());
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to many");
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttr = jpaDiagramEditor.getEditPart(ownerAttributeName);
@@ -2218,8 +2262,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to many");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "many to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
//delete the owner attribute
SWTBotGefEditPart ownerAttrPart = jpaDiagramEditor.getEditPart(ownerAttributeName);
@@ -2277,8 +2323,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
String inverseAttributeName = editorProxy.testInverseRelationAttributeProperties(
jpaDiagramEditor, rel);
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, ownerAttributeName, "many to many");
- editorProxy.assertAttributeIsCorretlyMapped(jpaDiagramEditor, inverseAttributeName, "many to many");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, ownerAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ editorProxy.assertAttributeIsCorretlyMapped(fp, jpaDiagramEditor, inverseAttributeName, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
editorProxy.assertSelfBiDirRelationIsNotDeleted(jpaDiagramEditor,
entity1, connection, ownerAttributeName,
@@ -2329,8 +2377,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
assertEquals(editorProxy.getEntityForElement(jpaDiagramEditor, inheritedEntity), rel.getSubclass());
assertEquals(editorProxy.getEntityForElement(jpaDiagramEditor, entity1), rel.getSuperclass());
- editorProxy.assertTypeIsCorretlyMapped(jpaDiagramEditor, "Entity1", "entity");
- editorProxy.assertTypeIsCorretlyMapped(jpaDiagramEditor, "Entity2", "entity");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertTypeIsCorretlyMapped(fp, jpaDiagramEditor, "Entity1", MappingKeys.ENTITY_TYPE_MAPPING_KEY);
+ editorProxy.assertTypeIsCorretlyMapped(fp, jpaDiagramEditor, "Entity2", MappingKeys.ENTITY_TYPE_MAPPING_KEY);
editorProxy.deleteDiagramElements(jpaDiagramEditor);
@@ -2374,8 +2424,10 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
assertEquals(editorProxy.getEntityForElement(jpaDiagramEditor, inheritedEntity), rel.getSubclass());
assertEquals(editorProxy.getEntityForElement(jpaDiagramEditor, mappedSuperclass), rel.getSuperclass());
- editorProxy.assertTypeIsCorretlyMapped(jpaDiagramEditor, "MpdSuprcls1", "mapped superclass");
- editorProxy.assertTypeIsCorretlyMapped(jpaDiagramEditor, "Entity1", "entity");
+ final IFeatureProvider fp = ((DiagramEditPart)jpaDiagramEditor.mainEditPart().part()).getFeatureProvider();
+
+ editorProxy.assertTypeIsCorretlyMapped(fp, jpaDiagramEditor, "MpdSuprcls1", MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
+ editorProxy.assertTypeIsCorretlyMapped(fp, jpaDiagramEditor, "Entity1", MappingKeys.ENTITY_TYPE_MAPPING_KEY);
editorProxy.deleteDiagramElements(jpaDiagramEditor);

Back to the top