Author: vpakan(a)redhat.com
Date: 2010-04-07 11:28:05 -0400 (Wed, 07 Apr 2010)
New Revision: 21316
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.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/EntityType.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Added constants for Drools SWTBot tests and new methods.
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-04-07
15:22:49 UTC (rev 21315)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-04-07
15:28:05 UTC (rev 21316)
@@ -11,7 +11,6 @@
package org.jboss.tools.ui.bot.ext;
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.List;
@@ -50,7 +49,7 @@
@Override
public SWTBotMenu menu(String text) {
- log.info("Menu \"" + text + "\" secleted");
+ log.info("Menu \"" + text + "\" selected");
return super.menu(text);
}
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-04-07
15:22:49 UTC (rev 21315)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-04-07
15:28:05 UTC (rev 21316)
@@ -523,5 +523,44 @@
boolean pressContinueButton) {
closeWarningWindowIfOpened(bot, pressContinueButton);
}
+ /**
+ * Returns true if table column specified by column parameter contains item
+ * @param table
+ * @param item
+ * @param column
+ * @return
+ */
+ public static boolean isItemInTableColumn (SWTBotTable table , String item, int
column){
+ boolean found = false;
+
+ int rowIndex = 0;
+ while (!found && rowIndex < table.rowCount()){
+ if (table.cell(rowIndex, column).trim().equals(item.trim())){
+ found = true;
+ }
+ else{
+ rowIndex++;
+ }
+ }
+ return found;
+ }
+
+ /**
+ * Hide Warning Message if displayed static version
+ */
+ public static void hideWarningIfDisplayed(SWTBotExt bot) {
+ try {
+ bot.shell(IDELabel.Shell.WARNING).activate();
+ bot.button(IDELabel.Button.OK).click();
+ } catch (WidgetNotFoundException wnfe) {
+ // do nothing
+ }
+ }
+ /**
+ * Hide Warning Message if displayed
+ */
+ public void hideWarningIfDisplayed() {
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ }
-}
+}
\ No newline at end of file
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2010-04-07
15:22:49 UTC (rev 21315)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2010-04-07
15:28:05 UTC (rev 21316)
@@ -21,7 +21,7 @@
*/
public enum EntityType {
HIBERNATE_MAPPING_FILE, JAVA_PROJECT, JAVA_CLASS, HIBERNATE_REVERSE_FILE,
HIBERNATE_CONSOLE,
- HIBERNATE_CONFIGURATION_FILE, STRUTS_PROJECT, JPA_PROJECT;
+ HIBERNATE_CONFIGURATION_FILE, STRUTS_PROJECT, JPA_PROJECT, DROOLS_PROJECT;
public List<String> getGroupsLabels() {
List<String> groupLabel = new LinkedList<String>();
@@ -35,6 +35,7 @@
case HIBERNATE_CONSOLE: groupLabel.add(IDELabel.EntityGroup.HIBERNATE); break;
case STRUTS_PROJECT: groupLabel.add(IDELabel.EntityGroup.JBOSS_TOOLS_WEB);
groupLabel.add(IDELabel.EntityGroup.STRUTS);break;
case JPA_PROJECT: groupLabel.add(IDELabel.EntityGroup.JPA);break;
+ case DROOLS_PROJECT: groupLabel.add(IDELabel.EntityGroup.DROOLS);break;
default: fail("Unknown Entity Type");
}
@@ -57,6 +58,7 @@
case JAVA_CLASS: entityLabel = IDELabel.EntityLabel.JAVA_CLASS; break;
case STRUTS_PROJECT: entityLabel = IDELabel.EntityLabel.STRUTS_PROJECT; break;
case JPA_PROJECT: entityLabel = IDELabel.EntityLabel.JPA_PROJECT; break;
+ case DROOLS_PROJECT: entityLabel = IDELabel.EntityLabel.DROOLS_PROJECT; break;
default: fail("Unknown Entity Type");
}
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-04-07
15:22:49 UTC (rev 21315)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-04-07
15:28:05 UTC (rev 21316)
@@ -78,6 +78,8 @@
public static final String ADD = "Add...";
public static final String NEW = "New...";
public static final String CONTINUE = "Continue";
+ public static final String REMOVE = "Remove";
+ public static final String EDIT = "Edit...";
}
public class Shell {
@@ -106,6 +108,8 @@
public static final String NEW_SERVER = "New Server";
public static final String RUN_ON_SERVER = "Run On Server";
public static final String WARNING = "Warning";
+ public static final String DROOLS_RUNTIME = "Drools Runtime";
+ public static final String NEW_DROOLS_PROJECT = "";
}
public class EntityGroup {
@@ -115,6 +119,7 @@
public static final String STRUTS = "Struts";
public static final String JBOSS_TOOLS_WEB = "JBoss Tools Web";
public static final String JPA = "JPA";
+ public static final String DROOLS = "Drools";
}
public class EntityLabel {
@@ -127,6 +132,7 @@
public static final String HIBERNATE_CONFIGURATION_FILE = "Hibernate Configuration
File (cfg.xml)";
public static final String STRUTS_PROJECT = "Struts Project";
public static final String JPA_PROJECT = "JPA Project";
+ public static final String DROOLS_PROJECT = "Drools Project";
}
public class JavaProjectWizard {
@@ -293,6 +299,8 @@
public static final String SERVER_GROUP = "Server";
public static final String RUNTIME_ENVIRONMENTS = "Runtime Environments";
+ public static final String DROOLS_GROUP = "Drools";
+ public static final String INSTALLED_DROOLS_RUNTIMES = "Installed Drools
Runtimes";
}
@@ -320,4 +328,17 @@
public static final String JBOSS_EAP_5_0 = "JBoss Enterprise Application
Platform 5.0";
}
+ public static final class DroolsRuntimeDialog {
+
+ public static final String NAME = "Name: ";
+ public static final String PATH = "Path: ";
+ public static final int COLUMN_NAME_INDEX = 0;
+ public static final int COLUMN_LOCATION_INDEX = 1;
+
+ }
+ public static final class NewDroolsProjectDialog {
+
+ public static final String NAME = "Project name:";
+
+ }
}