Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2014-09-11 13:55:06 +0000
committerMarkus Tiede2014-09-11 14:23:39 +0000
commitfba55e9411b00b079fe90499d26c06770231e220 (patch)
tree033dc08f7a4b7014b880590adc816730fccc7bca /org.eclipse.jubula.app.autrun
parent2665ee4d741bc83eca517ff0b5bcba8b395d6054 (diff)
downloadorg.eclipse.jubula.core-fba55e9411b00b079fe90499d26c06770231e220.tar.gz
org.eclipse.jubula.core-fba55e9411b00b079fe90499d26c06770231e220.tar.xz
org.eclipse.jubula.core-fba55e9411b00b079fe90499d26c06770231e220.zip
Sprint task - provide API to start SWT/RCP AUTs - part 3: refactoring of AUT configuration map types.
Diffstat (limited to 'org.eclipse.jubula.app.autrun')
-rw-r--r--org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunApplication.java22
-rw-r--r--org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunner.java6
2 files changed, 15 insertions, 13 deletions
diff --git a/org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunApplication.java b/org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunApplication.java
index b5dfe4bae..efd0c28aa 100644
--- a/org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunApplication.java
+++ b/org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunApplication.java
@@ -25,7 +25,7 @@ import org.apache.commons.cli.OptionGroup;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.Parser;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.StringUtils;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.jubula.app.autrun.i18n.Messages;
@@ -189,8 +189,8 @@ public class AutRunApplication implements IApplication {
* @param cmdLine Provides the settings for the AUT configuration.
* @return new settings for starting an AUT.
*/
- private static Map<String, Object> createAutConfig(CommandLine cmdLine) {
- Map<String, Object> autConfig = new HashMap<String, Object>();
+ private static Map<String, String> createAutConfig(CommandLine cmdLine) {
+ Map<String, String> autConfig = new HashMap<String, String>();
if (cmdLine.hasOption(OPT_WORKING_DIR)) {
autConfig.put(AutConfigConstants.WORKING_DIR, cmdLine
.getOptionValue(OPT_WORKING_DIR));
@@ -200,12 +200,12 @@ public class AutRunApplication implements IApplication {
}
if (cmdLine.hasOption(OPT_NAME_TECHNICAL_COMPONENTS)) {
- autConfig.put(AutConfigConstants.NAME_TECHNICAL_COMPONENTS, Boolean
- .valueOf(cmdLine
- .getOptionValue(OPT_NAME_TECHNICAL_COMPONENTS)));
+ autConfig.put(AutConfigConstants.NAME_TECHNICAL_COMPONENTS, String
+ .valueOf(cmdLine.getOptionValue(
+ OPT_NAME_TECHNICAL_COMPONENTS)));
} else {
autConfig.put(AutConfigConstants.NAME_TECHNICAL_COMPONENTS,
- DEFAULT_NAME_TECHNICAL_COMPONENTS);
+ String.valueOf(DEFAULT_NAME_TECHNICAL_COMPONENTS));
}
autConfig.put(AutConfigConstants.EXECUTABLE, cmdLine
.getOptionValue(OPT_EXECUTABLE));
@@ -217,8 +217,10 @@ public class AutRunApplication implements IApplication {
String[] autArguments = cmdLine.getOptionValues(OPT_EXECUTABLE);
if (autArguments.length > 1) {
- autConfig.put(AutConfigConstants.AUT_RUN_AUT_ARGUMENTS,
- ArrayUtils.subarray(autArguments, 1, autArguments.length));
+ autConfig.put(AutConfigConstants.AUT_RUN_AUT_ARGUMENTS, StringUtils
+ .join(autArguments,
+ AutConfigConstants.AUT_RUN_AUT_ARGUMENTS_SEPARATOR_CHAR, 1,
+ autArguments.length));
}
return autConfig;
@@ -362,7 +364,7 @@ public class AutRunApplication implements IApplication {
AutIdentifier autId = new AutIdentifier(cmdLine
.getOptionValue(OPT_AUT_ID));
- Map<String, Object> autConfiguration = createAutConfig(cmdLine);
+ Map<String, String> autConfiguration = createAutConfig(cmdLine);
AutRunner runner = new AutRunner(
toolkit, autId, agentAddr, autConfiguration);
diff --git a/org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunner.java b/org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunner.java
index 85977bbc6..11618d482 100644
--- a/org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunner.java
+++ b/org.eclipse.jubula.app.autrun/src/org/eclipse/jubula/app/autrun/AutRunner.java
@@ -118,7 +118,7 @@ public class AutRunner {
LoggerFactory.getLogger(AutRunner.class);
/** settings used to start the AUT */
- private Map<String, Object> m_autConfiguration;
+ private Map<String, String> m_autConfiguration;
/** the object responsible for actually starting the AUT */
private IStartAut m_startAut;
@@ -142,14 +142,14 @@ public class AutRunner {
* @throws IllegalAccessException
*/
public AutRunner(String autToolkit, AutIdentifier autIdentifier,
- InetSocketAddress agentAddr, Map<String, Object> autConfiguration)
+ InetSocketAddress agentAddr, Map<String, String> autConfiguration)
throws ClassNotFoundException, InstantiationException,
IllegalAccessException {
String className = "org.eclipse.jubula.autagent.commands.Start" //$NON-NLS-1$
+ autToolkit + "AutServerCommand"; //$NON-NLS-1$
Class< ? > autServerClass = Class.forName(className);
m_agentAddr = agentAddr;
- m_autConfiguration = new HashMap<String, Object>(autConfiguration);
+ m_autConfiguration = new HashMap<String, String>(autConfiguration);
m_autConfiguration.put(AutConfigConstants.AUT_AGENT_HOST,
agentAddr.getHostName());
m_autConfiguration.put(AutConfigConstants.AUT_AGENT_PORT,

Back to the top