Author: mickael_istria
Date: 2012-07-03 10:15:40 -0400 (Tue, 03 Jul 2012)
New Revision: 42343
Modified:
workspace/mistria/install-tests/plugins/org.jboss.tools.qa.install.tests/src/org/jboss/tools/qa/install/tests/InstallTest.java
workspace/mistria/install-tests/scripts/testInstall.sh
Log:
JBIDE-11713: script supports directly URLs as parameters, and files also
Modified:
workspace/mistria/install-tests/plugins/org.jboss.tools.qa.install.tests/src/org/jboss/tools/qa/install/tests/InstallTest.java
===================================================================
---
workspace/mistria/install-tests/plugins/org.jboss.tools.qa.install.tests/src/org/jboss/tools/qa/install/tests/InstallTest.java 2012-07-03
14:09:56 UTC (rev 42342)
+++
workspace/mistria/install-tests/plugins/org.jboss.tools.qa.install.tests/src/org/jboss/tools/qa/install/tests/InstallTest.java 2012-07-03
14:15:40 UTC (rev 42343)
@@ -41,11 +41,11 @@
this.bot.text(1).setText(site);
this.bot.button("OK").click();
this.bot.shell("Install").activate().setFocus();
- this.bot.waitUntil(new ICondition() {
+ this.bot.waitWhile(new ICondition() {
@Override
public boolean test() throws Exception {
- return bot.tree().getAllItems().length > 2;
+ return bot.tree().getAllItems()[0].getText().startsWith("Pending...");
}
@Override
Modified: workspace/mistria/install-tests/scripts/testInstall.sh
===================================================================
--- workspace/mistria/install-tests/scripts/testInstall.sh 2012-07-03 14:09:56 UTC (rev
42342)
+++ workspace/mistria/install-tests/scripts/testInstall.sh 2012-07-03 14:15:40 UTC (rev
42343)
@@ -1,21 +1,49 @@
#!/bin/bash
-eclipse_home=$1
-site_list=$2
-
usage() {
echo "Script to test installation"
- echo "usage: <dir>/testInstalls.sh <eclipse_home>
<file_containing_list_of_sites>"
+ echo "usage: $0 <eclipse_home>
<file_containing_list_of_sites|repository_url>*"
echo " <eclipse_home>: an eclipse installation will be performed on"
echo " <file_containing_list_of_sites> a file containing a list of
p2-friendly URLs of repositories"
echo " separated by spaces or line breaks"
+ echo " <repository_url>: URL of a p2 repo to install from"
}
+# Takes repo URL as single parameter
+install_repo() {
+ echo "Installing content from " $1
+ report=TEST-install-$(date +%Y%m%d%H%M).xml
+ #Invoke tests
+ output=$(java \
+ -DUPDATE_SITE=$1 \
+ -Dorg.eclipse.swtbot.search.timeout=10000 \
+ -Dusage_reporting_enabled=false \
+ -Xms256M -Xmx768M -XX:MaxPermSize=512M \
+ -jar plugins/org.eclipse.equinox.launcher_*.jar \
+ -application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplication \
+ -testApplication org.eclipse.ui.ide.workbench \
+ -product $productName \
+ -data workspace/ \
+ formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,$report
\
+ formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter \
+ -testPluginName org.jboss.tools.qa.install.tests \
+ -className org.jboss.tools.qa.install.tests.InstallTest \
+ -consoleLog -debug)
+ if [[ ! "$output" == *"Failures: 0, Errors: 0"* ]]; then
+ echo "Error while installing from " $site ". Read $report for details
and see screenshots/"
+ popd
+ exit 1
+ fi
+}
+
+eclipse_home=$1
+shift
+
if [ ! -d "$eclipse_home" -o ! -f "$eclipse_home/eclipse" ]; then
usage
exit 2
fi
-if [ ! -f "$site_list" ]; then
+if (( $# <= 0)); then
usage
exit 2
fi
@@ -27,8 +55,6 @@
exit 3
fi
-
-
echo "Preparing tests, installing framework"
pushd $eclipse_home
iniFile=$(ls -1 *.ini)
@@ -43,29 +69,15 @@
-installIU org.jboss.tools.qa.install.tests.feature.feature.group \
-consoleLog
-for site in $(cat "$site_list"); do
- echo "Installing content from " $site
- report=TEST-install-$(date +%Y%m%d%H%M).xml
- #Invoke tests
- output=$(java \
- -DUPDATE_SITE=$site \
- -Dusage_reporting_enabled=false \
- -Xms256M -Xmx768M -XX:MaxPermSize=512M \
- -jar plugins/org.eclipse.equinox.launcher_*.jar \
- -application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplication \
- -testApplication org.eclipse.ui.ide.workbench \
- -product $productName \
- -data workspace/ \
- formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,$report
\
- formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter \
- -testPluginName org.jboss.tools.qa.install.tests \
- -className org.jboss.tools.qa.install.tests.InstallTest \
- -consoleLog -debug)
- if [[ ! "$output" == *"Failures: 0, Errors: 0"* ]]; then
- echo "Error while installing from " $site ". Read $report for details
and see screenshots/"
- popd
- exit 1
- fi
+while (($#)); do
+ if [ -f "$1" ]; then
+ for repoUrl in $(cat "$1"); do
+ install_repo "$repoUrl"
+ done
+ else
+ install_repo "$1"
+ fi
+ shift
done
popd
exit 0
Show replies by date