summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetya Sabeva2012-10-09 07:59:36 (EDT)
committer Petya Sabeva2012-10-09 07:59:36 (EDT)
commitce25ea0aa2c1593f7ebb3cc7f1da3adf8d2085e7 (patch)
tree5e6a53d29f7336108a168d5f4d42ff0e723639b8
parente6f3f1a928f874a5892dc13e236a82c0970295b3 (diff)
downloadwebtools.dali-ce25ea0aa2c1593f7ebb3cc7f1da3adf8d2085e7.zip
webtools.dali-ce25ea0aa2c1593f7ebb3cc7f1da3adf8d2085e7.tar.gz
webtools.dali-ce25ea0aa2c1593f7ebb3cc7f1da3adf8d2085e7.tar.bz2
Check whether diagram is empty before creating entities.
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/ui/editor/JPADiagramEditorSWTBotTest.java5
1 files changed, 5 insertions, 0 deletions
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 d9b9ee5..5c5f462 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
@@ -1,6 +1,8 @@
package org.eclipse.jpt.jpadiagrameditor.swtbot.tests.ui.editor;
+import static org.junit.Assert.assertFalse;
+
import java.util.List;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -329,6 +331,9 @@ public class JPADiagramEditorSWTBotTest extends SWTBotGefTestCase {
@SuppressWarnings("restriction")
public void testChangeAttributeType(){
Utils.sayTestStarted("testChangeAttributeType");
+
+ List<SWTBotGefEditPart> entities = jpaDiagramEditor.mainEditPart().children();
+ assertTrue("Editor must not contain any entities!", entities.isEmpty());
SWTBotGefEditPart entity = editorProxy.addEntityToDiagram(jpaDiagramEditor, 50, 50, "Entity1");