Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/entity/OpenDiagramEditorSWTBotTest.java')
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/entity/OpenDiagramEditorSWTBotTest.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/entity/OpenDiagramEditorSWTBotTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/entity/OpenDiagramEditorSWTBotTest.java
new file mode 100644
index 0000000000..d2aed6efbc
--- /dev/null
+++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.swtbot.tests/src/org/eclipse/jpt/jpadiagrameditor/swtbot/tests/entity/OpenDiagramEditorSWTBotTest.java
@@ -0,0 +1,58 @@
+package org.eclipse.jpt.jpadiagrameditor.swtbot.tests.entity;
+
+import org.eclipse.jpt.jpadiagrameditor.swtbot.tests.internal.AbstractSwtBotEditorTest;
+import org.eclipse.jpt.jpadiagrameditor.swtbot.tests.utils.Utils;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class OpenDiagramEditorSWTBotTest extends AbstractSwtBotEditorTest{
+
+ protected static String TEST_PROJECT = "Test_" + System.currentTimeMillis();
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ createJPa20Project(TEST_PROJECT);
+ }
+
+ /**
+ * Test that the JPA Diagram editor is opened when the context menu
+ * "JPA Tools -> Open Diagram" of the project is called.
+ */
+ @Test
+ public void testOpenDiagramOnProjectLevel() {
+ Utils.sayTestStarted("testOpenDiagramOnProjectLevel");
+
+ assertTrue("The diagram must be empty.", jpaDiagramEditor
+ .mainEditPart().children().isEmpty());
+
+ workbenchBot.closeAllEditors();
+ // open JPA diagram editor on project level: JPA Tools -> Open Diagram
+ SWTBotGefEditor diagramEditor = editorProxy
+ .openDiagramOnJPAProjectNode(jpaProject.getName(), true);
+ diagramEditor.close();
+
+ Utils.sayTestFinished("testOpenDiagramOnProjectLevel");
+ }
+
+ /**
+ * Test that the JPA Diagram editor is opened when the context menu
+ * "Open Diagram" of the JPA content node is called.
+ */
+ @Test
+ public void testOpenDiagramOnJPAContentNodeLevel() {
+ Utils.sayTestStarted("testOpenDiagramOnJPAContentNodeLevel");
+
+ assertTrue("The diagram must be empty.", jpaDiagramEditor
+ .mainEditPart().children().isEmpty());
+
+ workbenchBot.closeAllEditors();
+ // open JPA diagram editor on JPA content level: Open Diagram
+ SWTBotGefEditor diagramEditor = editorProxy
+ .openDiagramOnJPAContentNode(jpaProject.getName());
+ diagramEditor.close();
+
+ Utils.sayTestFinished("testOpenDiagramOnJPAContentNodeLevel");
+ }
+
+}

Back to the top