Author: lzoubek(a)redhat.com
Date: 2011-08-04 08:45:40 -0400 (Thu, 04 Aug 2011)
New Revision: 33585
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
Log:
botext: can ignore config files
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java 2011-08-04
10:19:16 UTC (rev 33584)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java 2011-08-04
12:45:40 UTC (rev 33585)
@@ -37,6 +37,7 @@
}
protected static RuntimeBean fromString(String propValue, String url, RuntimeBean bean)
throws Exception {
+ bean = fromString(propValue, bean);
if (bean!=null && url!=null) {
String runtimeFile = downloadRuntime(url);
if (runtimeFile!=null) {
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-04
10:19:16 UTC (rev 33584)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-04
12:45:40 UTC (rev 33585)
@@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map.Entry;
import java.util.Properties;
+import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
@@ -65,6 +66,11 @@
*/
public static final String CONFIGURATIONS_DIR="test.configurations.dir";
/**
+ * regular expression for ignoring property files found in {@link
TestConfigurator#CONFIGURATIONS_DIR}
+ * filename matching this will be ignored
+ */
+ public static final String
CONFIGURATIONS_IGNORE="test.configurations.ignore";
+ /**
* path to property file which contains either 1 configuration or properties [config
name]=[abs path to config property file]
*/
public static final String SWTBOT_TEST_PROPERTIES_FILE =
"swtbot.test.properties.file";
@@ -74,6 +80,13 @@
boolean loadDefault = true;
try {
+ Pattern configMatch = Pattern.compile("nomatch");
+ try {
+ configMatch = Pattern.compile(System.getProperty(CONFIGURATIONS_IGNORE,
"nomatch"));
+ }
+ catch (Exception ex) {
+ log.error("Error parsing property "+CONFIGURATIONS_IGNORE,ex);
+ }
// try to load from file first
String propFile = System.getProperty(SWTBOT_TEST_PROPERTIES_FILE,
null);
@@ -91,11 +104,12 @@
else {
log.info("Loading property config-files from '"
+ configsDir + "'");
+ final Pattern fMatch = Pattern.compile(configMatch.toString());
File[] propFiles = configsDirFile.listFiles(new FileFilter(){
@Override
public boolean accept(File name) {
- return name.getName().endsWith(".properties");
+ return name.getName().endsWith(".properties") &&
!fMatch.matcher(name.getName()).matches();
}});
for (File file : propFiles)
{
Show replies by date