Author: vpakan(a)redhat.com
Date: 2010-05-11 14:37:27 -0400 (Tue, 11 May 2010)
New Revision: 22016
Added:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java
Modified:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java
Log:
Added tests of opening Drools perspective and synchronization between Rule Flow editor and
Properties View.
Modified:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
===================================================================
---
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2010-05-11
17:13:07 UTC (rev 22015)
+++
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2010-05-11
18:37:27 UTC (rev 22016)
@@ -22,6 +22,7 @@
import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsProject;
import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRules;
import org.jboss.tools.drools.ui.bot.test.smoke.DroolsRulesEditorTest;
+import org.jboss.tools.drools.ui.bot.test.smoke.OpenDroolsPerspective;
import org.jboss.tools.drools.ui.bot.test.smoke.RuleFlowTest;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
@@ -41,7 +42,8 @@
*
*/
@RunWith(Suite.class)
-(a)SuiteClasses({ManageDroolsRuntime.class,
+(a)SuiteClasses({OpenDroolsPerspective.class,
+ ManageDroolsRuntime.class,
ManageDroolsProject.class,
ManageDroolsRules.class,
DroolsRulesEditorTest.class,
Added:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java
===================================================================
---
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java
(rev 0)
+++
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java 2010-05-11
18:37:27 UTC (rev 22016)
@@ -0,0 +1,50 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2010 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.drools.ui.bot.test.smoke;
+
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
+import org.junit.Test;
+/**
+ * Test opening perspective
+ * @author Vladimir Pakan
+ *
+ */
+public class OpenDroolsPerspective extends SWTTestExt{
+ /**
+ * Test Opening Drools Rules
+ */
+ @Test
+ public void testManageDroolsProject() {
+ openDroolsPerspective();
+ }
+ /**
+ * Open Drools Perspective
+ */
+ private void openDroolsPerspective(){
+ eclipse.openPerspective(PerspectiveType.DROOLS);
+ boolean wasFound = false;
+ try{
+ bot.toolbarDropDownButtonWithTooltip(IDELabel.Button.DROOLS_WORKBENCH);
+ wasFound = true;
+ } catch (WidgetNotFoundException wnfe){
+ wasFound = false;
+ }
+ eclipse.openPerspective(PerspectiveType.JAVA);
+ assertTrue("Drools Perspective was not opened properly. Button " +
+ IDELabel.Button.DROOLS_WORKBENCH + " is not present in Workbench",
+ wasFound);
+ }
+}
+
Property changes on:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
===================================================================
---
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2010-05-11
17:13:07 UTC (rev 22015)
+++
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2010-05-11
18:37:27 UTC (rev 22016)
@@ -28,6 +28,8 @@
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.Result;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
@@ -35,6 +37,7 @@
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -139,6 +142,15 @@
gefEditor.mouseMoveLeftClick(xspacing + xoffset + 5, yoffset + 5);
gefEditor.save();
checkFullRFFile(DroolsAllBotTests.DROOLS_PROJECT_NAME , ruleFlowFileName);
+ // check synchronization with Properties View
+ gefEditor.activateTool("Select");
+ gefEditor.mouseMoveLeftClick(xoffset + 5, yoffset + 5);
+ SWTBotTree tree = eclipse.showView(ViewType.PROPERTIES).tree();
+ String id = tree.getTreeItem("Id").cell(1);
+ String name = tree.getTreeItem("Name").cell(1);
+ assertTrue("First editor element has to have Id=1 and Name=Start." +
+ "\nBut it has Id=" + id +
+ " Name=" + name, id.equals("1") &&
name.equals("Start"));
// Delete each component
gefEditor.activateTool("Select");
for (int toolIndex = 0;toolIndex < tools.length;toolIndex++){
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-05-11
17:13:07 UTC (rev 22015)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-05-11
18:37:27 UTC (rev 22016)
@@ -162,6 +162,9 @@
case GUVNOR_REPOSITORY_EXPLORING:
perspectiveLabel = IDELabel.SelectPerspectiveDialog.GUVNOR_REPOSITORY_EXPLORING;
break;
+ case DROOLS:
+ perspectiveLabel = IDELabel.SelectPerspectiveDialog.DROOLS;
+ break;
default:
fail("Unknown perspective to open");
}
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-05-11
17:13:07 UTC (rev 22015)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-05-11
18:37:27 UTC (rev 22016)
@@ -93,6 +93,7 @@
public static final String REMOVE = "Remove";
public static final String EDIT = "Edit...";
public static final String ADD_WITHOUT_DOTS = "Add";
+ public static final String DROOLS_WORKBENCH = "Drools workbench";
}
public class Shell {
@@ -187,6 +188,7 @@
public static final String PROBLEMS = "Problems";
public static final String DEBUG = "Debug";
public static final String GUVNOR_REPOSITORIES = "Guvnor Repositories";
+ public static final String PROPERTIES = "Properties";
}
public class ViewGroup {
@@ -208,6 +210,7 @@
public static final String JPA = "JPA";
public static final String DEBUG = "Debug";
public static final String GUVNOR_REPOSITORY_EXPLORING = "Guvnor Repository
Exploring";
+ public static final String DROOLS = "Drools";
}
/**
* Hibernate Console Wizard (ConsoleConfigurationCreationWizard) Labels (
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java 2010-05-11
17:13:07 UTC (rev 22015)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java 2010-05-11
18:37:27 UTC (rev 22016)
@@ -16,6 +16,7 @@
*
*/
public enum PerspectiveType {
- SEAM, JAVA, WEB_DEVELOPMENT, HIBERNATE, DB_DEVELOPMENT, JPA, DEBUG,
GUVNOR_REPOSITORY_EXPLORING;
+ SEAM, JAVA, WEB_DEVELOPMENT, HIBERNATE, DB_DEVELOPMENT, JPA, DEBUG,
GUVNOR_REPOSITORY_EXPLORING,
+ DROOLS;
}
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2010-05-11
17:13:07 UTC (rev 22015)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2010-05-11
18:37:27 UTC (rev 22016)
@@ -19,7 +19,7 @@
*/
public enum ViewType {
PACKAGE_EXPLORER, PROJECT_EXPLORER, WELCOME, DATA_SOURCE_EXPLORER,
- SERVERS,WEB_PROJECTS,PROBLEMS,DEBUG,GUVNOR_REPOSITORIES;
+ SERVERS,WEB_PROJECTS,PROBLEMS,DEBUG,GUVNOR_REPOSITORIES,PROPERTIES;
public String getGroupLabel() {
@@ -33,6 +33,7 @@
case PROBLEMS: viewLabel = IDELabel.ViewGroup.GENERAL; break;
case DEBUG: viewLabel = IDELabel.ViewGroup.DEBUG; break;
case GUVNOR_REPOSITORIES: viewLabel = IDELabel.ViewGroup.GUVNOR; break;
+ case PROPERTIES: viewLabel = IDELabel.ViewGroup.GENERAL; break;
default: fail("Unknown View Type");
}
return viewLabel;
@@ -49,6 +50,7 @@
case PROBLEMS: viewLabel = IDELabel.View.PROBLEMS; break;
case DEBUG: viewLabel = IDELabel.View.DEBUG; break;
case GUVNOR_REPOSITORIES: viewLabel = IDELabel.View.GUVNOR_REPOSITORIES; break;
+ case PROPERTIES: viewLabel = IDELabel.View.PROPERTIES; break;
default: fail("Unknown View Type");
}
return viewLabel;