Author: jpeterka
Date: 2010-10-21 07:18:46 -0400 (Thu, 21 Oct 2010)
New Revision: 25964
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Executive code for Adding jBPM runtime via SWTBot tests added
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-10-21
11:14:54 UTC (rev 25963)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-10-21
11:18:46 UTC (rev 25964)
@@ -507,14 +507,68 @@
}
}
- public void addJBPMRuntime(String name, String version, String runtimeHome) {
- // TODO - needs to be impl.
- log.info("WARN - Adding JBPM Runtime, needs to be impl.");
+ /**
+ * Adds jBPM runtime via SWTBot
+ * @param name
+ * @param runtimeHome
+ */
+ public void addJBPMRuntime(String name, String runtimeHome) {
+ SWTBot wiz =
open.preferenceOpen(ActionItem.Preference.JBossjBPMRuntimeLocations.LABEL);
+
+ boolean createRuntime = true;
+ // first check if Environment doesn't exist
+ SWTBotTable tbRuntimeEnvironments = bot.table();
+ int numRows = tbRuntimeEnvironments.rowCount();
+ if (numRows > 0) {
+ int currentRow = 0;
+ while (createRuntime && currentRow < numRows) {
+ if (tbRuntimeEnvironments.cell(currentRow, 1).equalsIgnoreCase(
+ name)) {
+ createRuntime = false;
+ } else {
+ currentRow++;
+ }
+ }
+ }
+ if (createRuntime) {
+ wiz.button("Add...").click();
+ log.info("jBPM Runtime '" + name +"' added.");
+
+ bot.shell(IDELabel.Shell.NEW_JBPM_RUNTIME).activate();
+ bot.text(0).setText(name);
+ bot.text(1).setText(runtimeHome);
+ bot.clickButton(IDELabel.Button.OK);
+
+ }
+ open.finish(wiz, IDELabel.Button.OK);
}
+ /**
+ * Removes jBPM Runtime via SWTBot
+ * @param name
+ */
public void removeJBPMRuntime(String name) {
- // TODO - needs to be impl
- log.info("WARN - Removing JBPM Runtime, needs to be impl.");
+ SWTBot wiz =
open.preferenceOpen(ActionItem.Preference.JBossjBPMRuntimeLocations.LABEL);
+ SWTBotTable tbRuntimeEnvironments = bot.table();
+ int numRows = tbRuntimeEnvironments.rowCount();
+ if (numRows > 0) {
+ int currentRow = 0;
+ while (currentRow < numRows) {
+ if (tbRuntimeEnvironments.cell(currentRow, 1).equalsIgnoreCase(
+ name)) {
+ tbRuntimeEnvironments.click(currentRow, 1);
+ wiz.button(IDELabel.Button.REMOVE).click();
+ SWTBotShell shell = bot.shell("Confirm Runtime Delete");
+ shell.activate();
+ shell.bot().button(IDELabel.Button.OK).click();
+ log.info("jBPM Runtime '" + name +"' removed.");
+ break;
+ } else {
+ currentRow++;
+ }
+ }
+ }
+ open.finish(wiz,IDELabel.Button.OK);
}
public void addESBRuntime(String name, String version, String runtimeHome ) {
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java 2010-10-21
11:14:54 UTC (rev 25963)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java 2010-10-21
11:18:46 UTC (rev 25964)
@@ -13,7 +13,7 @@
@Override
public void handle() {
String jbpmName = "JBPM-"+TestConfigurator.currentConfig.getJBPM().version;
- SWTTestExt.eclipse.addJBPMRuntime(jbpmName,
TestConfigurator.currentConfig.getJBPM().version,
TestConfigurator.currentConfig.getJBPM().jbpmHome);
+ SWTTestExt.eclipse.addJBPMRuntime(jbpmName,
TestConfigurator.currentConfig.getJBPM().jbpmHome);
SWTTestExt.configuredState.getJBPM().isConfigured=true;
SWTTestExt.configuredState.getJBPM().name=jbpmName;
SWTTestExt.configuredState.getJBPM().version=TestConfigurator.currentConfig.getJBPM().version;
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-10-21
11:14:54 UTC (rev 25963)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-10-21
11:18:46 UTC (rev 25964)
@@ -137,6 +137,7 @@
public static final String CONFIRM_PERSPECTIVE_SWITCH = "Confirm Perspective
Switch";
public static final String NEW_SEAM_RUNTIME = "New Seam Runtime";
public static final String NEW_ESB_RUNTIME = "New JBoss ESB Runtime";
+ public static final String NEW_JBPM_RUNTIME = "Add Location";
public static final String CONFIRM_DELETE = "Confirm Delete";
public static final String SHOW_VIEW = "Show View";
public static final String PROPERTIES_FOR = "Properties for";