Author: vpakan(a)redhat.com
Date: 2012-02-15 06:17:39 -0500 (Wed, 15 Feb 2012)
New Revision: 38749
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/pom.xml
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/BuildPathHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/MenuBarHelper.java
Log:
Fixes for maven integration
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/pom.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/pom.xml 2012-02-15 11:04:44 UTC (rev
38748)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/pom.xml 2012-02-15 11:17:39 UTC (rev
38749)
@@ -11,8 +11,8 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
-
<jbosstools.test.jboss-as.home>${requirement.build.root}/jboss-5.1.0.GA</jbosstools.test.jboss-as.home>
- <systemProperties>-Dswtbot.test.skip=false
-Dtest.configurations.dir=resources/properties/
-Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home}</systemProperties>
+
<jbosstools.test.jboss-as.home>${requirement.build.root}/jboss-5.1.0.GA</jbosstools.test.jboss-as.home>
+ <systemProperties>-Dswtbot.test.skip=false
-Dtest.configurations.dir=resources/properties/
-Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home}
-Dorg.eclipse.swt.browser.XULRunnerPath=${project.build.outputDirectory}/../work/plugins/org.mozilla.xulrunner.gtk.linux.x86_1.9.2.16b/xulrunner</systemProperties>
<test.suite.class>org.jboss.tools.jsf.ui.bot.test.JSFAllBotTests</test.suite.class>
</properties>
<build>
@@ -25,7 +25,8 @@
<testClass>${test.suite.class}</testClass>
<useUIThread>false</useUIThread>
<skip>${swtbot.test.skip}</skip>
- <dependencies combine.children="append">
+
<product>org.eclipse.platform.ide</product>
+ <dependencies
combine.children="append">
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.jboss.ide.eclipse.as.feature.feature.group</artifactId>
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/BuildPathHelper.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/BuildPathHelper.java 2012-02-15
11:04:44 UTC (rev 38748)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/BuildPathHelper.java 2012-02-15
11:17:39 UTC (rev 38749)
@@ -15,9 +15,12 @@
import java.io.File;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
/**
@@ -53,14 +56,24 @@
*/
public static String addExternalJar(final String externalJarLocation,
final String projectName, boolean overwriteIfExists) {
-
assertTrue("External Jar Location cannot be empty but is " +
externalJarLocation,
externalJarLocation != null && externalJarLocation.length() > 0);
SWTBotExt bot = new SWTEclipseExt().openPropertiesOfProject(projectName);
+ bot.shell(IDELabel.Shell.PROPERTIES_FOR + " " +
projectName).activate().bot();
bot.tree().expandNode(IDELabel.JavaBuildPathPropertiesEditor.JAVA_BUILD_PATH_TREE_ITEM_LABEL).select();
- bot.tabItem(IDELabel.JavaBuildPathPropertiesEditor.LIBRARIES_TAB_LABEL).activate();
- bot.button(IDELabel.Button.ADD_VARIABLE).click();
- bot.shell(IDELabel.Shell.NEW_VARIABLE_CLASS_PATH_ENTRY).activate();
+ bot.sleep(Timing.time3S());
+ bot.tabItem(IDELabel.JavaBuildPathPropertiesEditor.LIBRARIES_TAB_LABEL).activate();
+ final SWTBotButton btn = bot.button(IDELabel.Button.ADD_VARIABLE);
+ btn.click();
+ bot.sleep(Timing.time2S());
+ // workaround because first click is not working when test is run via maven
+ try {
+ bot.shell(IDELabel.Shell.NEW_VARIABLE_CLASS_PATH_ENTRY).activate();
+ } catch (WidgetNotFoundException wnfe){
+ btn.click();
+ bot.sleep(Timing.time2S());
+ bot.shell(IDELabel.Shell.NEW_VARIABLE_CLASS_PATH_ENTRY).activate();
+ }
String jarFileName = new File(externalJarLocation).getName();
String variableEntryName = jarFileName.toUpperCase() + "_LOCATION";
boolean externalJarExists = false;
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/MenuBarHelper.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/MenuBarHelper.java 2012-02-15
11:04:44 UTC (rev 38748)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/MenuBarHelper.java 2012-02-15
11:17:39 UTC (rev 38749)
@@ -21,7 +21,6 @@
import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.hamcrest.Matcher;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
/**
* Helper to find menu within menu bar
@@ -39,7 +38,7 @@
final MenuItem menuItem = UIThreadRunnable.syncExec(new Result<MenuItem>() {
@Override
public MenuItem run() {
- Matcher<? extends Widget> matcher = withMnemonic(IDELabel.Menu.PROJECT);
+ Matcher<? extends Widget> matcher = withMnemonic(menuLabel);
MenuItem[] items = activeShell.getMenuBar().getItems();
int index = 0;
while (index < items.length && !matcher.matches(items[index])){
@@ -49,7 +48,7 @@
return items[index];
}
else{
- throw new WidgetNotFoundException("Unable to find menu with label " +
IDELabel.Menu.PROJECT +
+ throw new WidgetNotFoundException("Unable to find menu with label " +
menuLabel +
" within active shell menu bar.");
}
Show replies by date