Author: jpeterka
Date: 2010-11-05 03:49:26 -0400 (Fri, 05 Nov 2010)
New Revision: 26275
Added:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/GPDTest.java
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMViewsTest.java
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMDeployTest.java
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMProjectTest.java
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/suite/JBPMAllTest.java
Log:
jBPM Bot tests added/modified
Added:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/GPDTest.java
===================================================================
---
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/GPDTest.java
(rev 0)
+++
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/GPDTest.java 2010-11-05
07:49:26 UTC (rev 26275)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jbpm.ui.bot.test;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
+import org.jboss.tools.jbpm.ui.bot.test.suite.JBPMTest;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.gef.SWTBotGefFigure;
+import org.jboss.tools.ui.bot.ext.widgets.SWTBotMultiPageEditor;
+import org.junit.Test;
+
+@SWTBotTestRequires(perspective = "jBPM jPDL 3", clearProjects = false,
clearWorkspace = false)
+public class GPDTest extends JBPMTest {
+
+ String[] nodes = { "start", "first", "end" };
+
+ @Test
+ public void selectNodes() {
+ SWTGefBot gefBot = new SWTGefBot();
+ SWTBotGefEditor editor = gefBot.gefEditor("simple");
+ SWTBotMultiPageEditor multi = new SWTBotMultiPageEditor(
+ editor.getReference(), gefBot);
+ multi.activatePage("Diagram");
+
+ String[] nodes = { "start", "first", "end" };
+
+ for (String node : nodes)
+ editor.getEditPart(node).select();
+ }
+
+ @Test
+ public void resizeNodes() {
+
+ SWTGefBot gefBot = new SWTGefBot();
+ SWTBotGefEditor editor = gefBot.gefEditor("simple");
+
+ for (String node : nodes) {
+ editor.getEditPart(node).select().focus();
+ editor.getEditPart(node).resize(PositionConstants.SOUTH_EAST, 100,
+ 70);
+ }
+ editor.save();
+ }
+
+ @Test
+ public void moveNodes() {
+
+ SWTGefBot gefBot = new SWTGefBot();
+ final SWTBotGefEditor editor = gefBot.gefEditor("simple");
+ final Rectangle[] abounds = new Rectangle[1];
+
+ for (final String node : nodes) {
+
+ bot.getDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ abounds[0] = ((GraphicalEditPart) editor.getEditPart(node)
+ .part()).getFigure().getBounds();
+ }
+
+ });
+ Rectangle bounds = abounds[0];
+ editor.drag(editor.getEditPart(node), bounds.x + 100,
+ bounds.y + 100);
+ }
+ editor.save();
+ }
+
+ @Test
+ public void renameNodes() {
+ SWTGefBot gefBot = new SWTGefBot();
+ SWTBotGefEditor editor = gefBot.gefEditor("simple");
+
+ bot.sleep(TIME_5S, "check selection by click");
+
+ for (String node : nodes) {
+ SWTBotGefEditPart part = editor.getEditPart(node);
+ SWTBotGefFigure figure = new SWTBotGefFigure(editor, part);
+ SWTBotGefFigure label = figure.labelFigure(node);
+ label.setText(node + "_NEXT");
+ editor.save();
+ assertTrue(label.getText().equals(node + "_NEXT"));
+ }
+ bot.sleep(TIME_5S);
+
+ }
+}
Property changes on:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/GPDTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMDeployTest.java
===================================================================
---
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMDeployTest.java 2010-11-05
07:33:16 UTC (rev 26274)
+++
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMDeployTest.java 2010-11-05
07:49:26 UTC (rev 26275)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jbpm.ui.bot.test;
import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
@@ -4,7 +14,6 @@
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.jboss.tools.jbpm.ui.bot.test.suite.JBPMTest;
-import org.jboss.tools.jbpm.ui.bot.test.suite.Project;
import org.jboss.tools.ui.bot.ext.config.Annotations.JBPM;
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
@@ -12,7 +21,6 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
import org.jboss.tools.ui.bot.ext.widgets.SWTBotMultiPageEditor;
import org.junit.Test;
@@ -21,10 +29,6 @@
@Test
public void deploy() {
- PackageExplorer pe = new PackageExplorer();
- pe.openFile(Project.PROJECT_NAME,
"src/main/jpdl","simple.jpdl.xml");
- util.waitForNonIgnoredJobs();
-
SWTGefBot gefBot = new SWTGefBot();
SWTBotGefEditor editor = gefBot.gefEditor("simple");
editor.setFocus();
@@ -32,7 +36,7 @@
multi.activatePage("Deployment");
gefBot.textWithLabel("Server Name:").setText("127.0.0.1");
- SWTBotText item = gefBot.textWithLabel("Server
Deployer:").setText("gpd-deployer");
+ SWTBotText item = gefBot.textWithLabel("Server
Deployer:").setText("gpd-deployer/upload");
editor.save();
String serverName =
TestConfigurator.currentConfig.getServer().type+"-"+TestConfigurator.currentConfig.getServer().version;
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMProjectTest.java
===================================================================
---
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMProjectTest.java 2010-11-05
07:33:16 UTC (rev 26274)
+++
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMProjectTest.java 2010-11-05
07:49:26 UTC (rev 26275)
@@ -1,56 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jbpm.ui.bot.test;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.jbpm.ui.bot.test.suite.JBPMTest;
import org.jboss.tools.jbpm.ui.bot.test.suite.Project;
-import org.jboss.tools.ui.bot.ext.config.Annotations.JBPM;
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
import org.jboss.tools.ui.bot.ext.types.EntityType;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
import org.junit.Test;
-@SWTBotTestRequires( jbpm=@JBPM(),
server=(a)Server(type=ServerType.SOA,state=ServerState.Present), perspective="jBPM jPDL
3")
+@SWTBotTestRequires(perspective = "jBPM jPDL 3", clearProjects = false)
public class JBPMProjectTest extends JBPMTest {
@Test
public void createProject() {
-
+
// Create project
eclipse.createNew(EntityType.JBPM3_PROJECT);
bot.textWithLabel("Project name:").setText(Project.PROJECT_NAME);
bot.clickButton(IDELabel.Button.NEXT);
-
- String rtName = "JBPM-"+TestConfigurator.currentConfig.getJBPM().version;
-
- // There is some bug related to undefined runtime even it's defined
- /*
+
+ String rtName = "JBPM-"
+ + TestConfigurator.currentConfig.getJBPM().version;
+
+ // There is a bug related to undefined runtime even if it's defined
bot.textWithLabel("Name :").setText(rtName);
String rtHome = TestConfigurator.currentConfig.getJBPM().jbpmHome;
- bot.sleep(TIME_5S);
-
- bot.textWithLabel("Location :").setText(rtHome);
-
+
+ bot.textWithLabel("Location :").setText(rtHome);
+
String msg3 = "Press next to continue the project creation";
-
+
try {
bot.text(msg3);
- } catch(WidgetNotFoundException e) {
+ } catch (WidgetNotFoundException e) {
fail("Missing confirmation during jbpm runtime definition text");
}
-
+
bot.clickButton(IDELabel.Button.NEXT);
- */
-
+
bot.comboBox().setSelection(rtName);
-
-
+
SWTBotShell wizard = bot.activeShell();
bot.clickButton(IDELabel.Button.FINISH);
eclipse.waitForClosedShell(wizard);
util.waitForNonIgnoredJobs();
- }
+ }
+
+ @Test
+ public void openProcess() {
+ PackageExplorer pe = new PackageExplorer();
+ pe.openFile(Project.PROJECT_NAME, "src/main/jpdl",
"simple.jpdl.xml");
+ util.waitForNonIgnoredJobs();
+ }
}
Added:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMViewsTest.java
===================================================================
---
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMViewsTest.java
(rev 0)
+++
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMViewsTest.java 2010-11-05
07:49:26 UTC (rev 26275)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jbpm.ui.bot.test;
+
+import org.jboss.tools.jbpm.ui.bot.test.suite.JBPMTest;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.gen.IView;
+import org.junit.Test;
+
+@SWTBotTestRequires( perspective="jBPM jPDL 3")
+public class JBPMViewsTest extends JBPMTest {
+
+ @Test
+ public void testViews() {
+
+ // reset perspective
+ bot.resetActivePerspective();
+
+ // check if all views are opened
+ IView[] views = { ActionItem.View.JBossjBPMOverviewjBPM3.LABEL,
+ ActionItem.View.GeneralOutline.LABEL,
+ ActionItem.View.GeneralProperties.LABEL,
+ ActionItem.View.GeneralProjectExplorer.LABEL};
+
+ for (IView view : views) {
+ // For jBPM Overview titles aren't the same
+ if (view.equals(ActionItem.View.JBossjBPMOverviewjBPM3.LABEL)) {
+ assertTrue(eclipse.isViewOpened("Overview"));
+ }
+ else {
+ assertTrue(eclipse.isViewOpened(view.getName()));
+ }
+ }
+ }
+}
Property changes on:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/JBPMViewsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/suite/JBPMAllTest.java
===================================================================
---
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/suite/JBPMAllTest.java 2010-11-05
07:33:16 UTC (rev 26274)
+++
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/src/org/jboss/tools/jbpm/ui/bot/test/suite/JBPMAllTest.java 2010-11-05
07:49:26 UTC (rev 26275)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jbpm.ui.bot.test.suite;
import junit.framework.TestSuite;
@@ -2,3 +12,3 @@
-import org.jboss.tools.jbpm.ui.bot.test.JBPMDeployTest;
+import org.jboss.tools.jbpm.ui.bot.test.GPDTest;
import org.jboss.tools.jbpm.ui.bot.test.JBPMProjectTest;
@@ -10,7 +20,9 @@
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
-@SuiteClasses({ JBPMProjectTest.class, JBPMDeployTest.class, })
+// @SuiteClasses({ JBPMProjectTest.class, JBPMDeployTest.class })
+// @SuiteClasses({ JBPMViewsTest.class })
+@SuiteClasses({ JBPMProjectTest.class, GPDTest.class })
@RunWith(RequirementAwareSuite.class)
public class JBPMAllTest extends TestSuite {