[jbosstools-commits] JBoss Tools SVN: r41283 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed May 23 07:27:40 EDT 2012


Author: jjankovi
Date: 2012-05-23 07:27:39 -0400 (Wed, 23 May 2012)
New Revision: 41283

Modified:
   trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
Log:
method for selecting configured runtime as targeted runtime for entered project

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	2012-05-23 11:26:12 UTC (rev 41282)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java	2012-05-23 11:27:39 UTC (rev 41283)
@@ -47,6 +47,8 @@
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
 import org.hamcrest.Matcher;
 import org.jboss.tools.ui.bot.ext.condition.ButtonIsDisabled;
+import org.jboss.tools.ui.bot.ext.condition.ShellIsActiveCondition;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
 import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
 import org.jboss.tools.ui.bot.ext.entity.JavaProjectEntity;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem;
@@ -1794,5 +1796,38 @@
       }
       return tiNode;
   }
+    
+    /**
+	 * Add configured runtime into project as targeted runtime
+	 * @param project
+	 */
+	public void addConfiguredRuntimeIntoProject(String project, 
+			String configuredRuntime) {
+		if (bot == null || project == null || configuredRuntime == null) {
+			throw new NullPointerException();
+		}
+		bot = openPropertiesOfProject(project);
+		SWTBotShell propertiesShell = bot.shell(
+				IDELabel.Shell.PROPERTIES_FOR + " " + project);
+		propertiesShell.activate();
+		SWTBotTreeItem item = bot.tree().getTreeItem("Targeted Runtimes");
+		item.select();
+		SWTBotTable runtimes = bot.table(); 
+		bot.checkBox("Show all runtimes").select();
+		for (int i = 0; i < runtimes.rowCount(); i++) {
+			runtimes.getTableItem(i).uncheck();
+		}
+		for (int i = 0; i < runtimes.rowCount(); i++) {
+			if (runtimes.getTableItem(i).getText().equals(configuredRuntime)) {
+				runtimes.getTableItem(i).check();
+				break;
+			}
+		}
+		bot.button(IDELabel.Button.OK).click();
+		bot.waitWhile(new ShellIsActiveCondition(propertiesShell), 
+				TaskDuration.LONG.getTimeout());
+		util.waitForNonIgnoredJobs();
+		
+	}
 
 }
\ No newline at end of file



More information about the jbosstools-commits mailing list