Author: jpeterka
Date: 2011-09-22 06:38:32 -0400 (Thu, 22 Sep 2011)
New Revision: 34953
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ImportHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ResourceHelper.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/UserLibraryHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java
Log:
[bot-ext] resource and import helpers added
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ImportHelper.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ImportHelper.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ImportHelper.java 2011-09-22
10:38:32 UTC (rev 34953)
@@ -0,0 +1,30 @@
+package org.jboss.tools.ui.bot.ext.helper;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+
+/**
+ * Heper class for project imports
+ */
+public class ImportHelper {
+
+ /**
+ * Import all projects from from given path to current workspace
+ */
+ public static void importAllProjects(String path) {
+ SWTBotExt bot = new SWTBotExt();
+ bot.menu("File").menu("Import...").click();
+
+ SWTBot dlgBot = bot.shell("Import").activate().bot();
+ dlgBot.tree().expandNode("General").expandNode("Existing Projects into
Workspace").select();
+ dlgBot.button(IDELabel.Button.NEXT).click();
+
+ dlgBot.radio(0).click();
+ dlgBot.text().setText(path);
+ dlgBot.radio(1).click();
+ dlgBot.radio(0).click();
+ dlgBot.button("Select All").click();
+ dlgBot.button(IDELabel.Button.FINISH).click();
+ }
+}
Property changes on:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ImportHelper.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ResourceHelper.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ResourceHelper.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ResourceHelper.java 2011-09-22
10:38:32 UTC (rev 34953)
@@ -0,0 +1,62 @@
+package org.jboss.tools.ui.bot.ext.helper;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+
+
+/**
+ * Class provides resource related static methods
+ */
+public class ResourceHelper {
+
+ /**
+ * Provide bundle resource absolute path
+ * @param pluginId - plugin id
+ * @param path - resource relative path
+ * @return resource absolute path
+ */
+ public static String getResourceAbsolutePath(String pluginId, String... path) {
+
+ // Construct path
+ StringBuilder builder = new StringBuilder();
+ for (String fragment : path) {
+ builder.append("/" + fragment);
+ }
+
+ String filePath = "";
+ try {
+ filePath = FileLocator.toFileURL(
+ Platform.getBundle(pluginId).getEntry("/")).getFile()
+ + "resources" + builder.toString();
+ File file = new File(filePath);
+ if (!file.isFile()) {
+ filePath = FileLocator.toFileURL(
+ Platform.getBundle(pluginId).getEntry("/")).getFile()
+ + builder.toString();
+ }
+ } catch (IOException ex) {
+ String message = filePath + " resource file not found";
+ //log.error(message);
+ fail(message);
+ }
+
+ return filePath;
+ }
+
+ /**
+ * Gets workspace absolute path
+ * @return current workspace absolute path
+ */
+ public static String getWorkspaceAbsolutePath() {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ String path = workspace.getRoot().getLocation().toFile().getAbsolutePath();
+ return path;
+ }
+}
Property changes on:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ResourceHelper.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/UserLibraryHelper.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/UserLibraryHelper.java 2011-09-22
08:26:11 UTC (rev 34952)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/UserLibraryHelper.java 2011-09-22
10:38:32 UTC (rev 34953)
@@ -66,6 +66,7 @@
/**
* Creates user library with given identifiers and given jar list
+ * You can receive jar list via #getJarList
*
* @param libName
* @param jarPaths
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java 2011-09-22
08:26:11 UTC (rev 34952)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/JobLists.java 2011-09-22
10:38:32 UTC (rev 34953)
@@ -16,5 +16,5 @@
public class JobLists {
public static String[] ignoredJobs = { "Process Console Input Job",
"Usage Data Event consumer",
- "Updating indexes" };
+ "Updating indexes","Reporting JBoss Developer Studio usage" };
}
Show replies by date