Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2014-01-28 16:07:15 +0000
committerMarkus Tiede2014-01-28 16:38:51 +0000
commitef952e007084d5796459800dd3962308e784a0c9 (patch)
treeb91cfeb85b3c4482a02d2d6a9059ac7aa80f29a7 /org.eclipse.jubula.client.autagent
parente9a5492356d2f18e4618e1103a0ecc061093b07f (diff)
downloadorg.eclipse.jubula.core-ef952e007084d5796459800dd3962308e784a0c9.tar.gz
org.eclipse.jubula.core-ef952e007084d5796459800dd3962308e784a0c9.tar.xz
org.eclipse.jubula.core-ef952e007084d5796459800dd3962308e784a0c9.zip
Sprint task - patch for enhancement http://eclip.se/385846 reviewed, modified and applied.
Diffstat (limited to 'org.eclipse.jubula.client.autagent')
-rw-r--r--org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/handlers/ConnectToEmbeddedAutAgentHandler.java14
-rw-r--r--org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/PreferenceInitializer.java7
2 files changed, 7 insertions, 14 deletions
diff --git a/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/handlers/ConnectToEmbeddedAutAgentHandler.java b/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/handlers/ConnectToEmbeddedAutAgentHandler.java
index e0eb7e874..98261beb2 100644
--- a/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/handlers/ConnectToEmbeddedAutAgentHandler.java
+++ b/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/handlers/ConnectToEmbeddedAutAgentHandler.java
@@ -28,6 +28,7 @@ import org.eclipse.jubula.client.autagent.preferences.PreferenceInitializer;
import org.eclipse.jubula.client.ui.rcp.constants.RCPCommandIDs;
import org.eclipse.jubula.client.ui.rcp.handlers.AUTAgentConnectHandler;
import org.eclipse.jubula.client.ui.utils.CommandHelper;
+import org.eclipse.jubula.tools.constants.EnvConstants;
import org.eclipse.jubula.tools.i18n.I18n;
import org.eclipse.ui.statushandlers.StatusManager;
import org.slf4j.Logger;
@@ -50,11 +51,6 @@ public class ConnectToEmbeddedAutAgentHandler extends AbstractHandler
protected static final Logger LOG = LoggerFactory
.getLogger(ConnectToEmbeddedAutAgentHandler.class);
- /**
- * hostname to use for starting and accessing the embedded AUT Agent
- */
- private static final String EMBEDDED_AGENT_HOSTNAME = "localhost"; //$NON-NLS-1$
-
/** {@inheritDoc} */
public Object execute(ExecutionEvent event) {
@@ -63,9 +59,9 @@ public class ConnectToEmbeddedAutAgentHandler extends AbstractHandler
// Embedded Agent is not running. We need to start it before
// trying to connect to it.
final int port = Platform.getPreferencesService().getInt(
- Activator.PLUGIN_ID,
- PreferenceInitializer.PREF_EMBEDDED_AGENT_PORT,
- PreferenceInitializer.DEFAULT_EMBEDDED_AGENT_PORT, null);
+ Activator.PLUGIN_ID,
+ PreferenceInitializer.PREF_EMBEDDED_AGENT_PORT,
+ EnvConstants.AUT_AGENT_DEFAULT_PORT, null);
try {
autAgentInstance.start(
port, false, Verbosity.QUIET, false);
@@ -81,7 +77,7 @@ public class ConnectToEmbeddedAutAgentHandler extends AbstractHandler
return null;
}
}
- String hostname = EMBEDDED_AGENT_HOSTNAME;
+ String hostname = EnvConstants.LOCALHOST_ALIAS;
int port = autAgentInstance.getCommunicator().getLocalPort();
Command connectToAutAgentCommand = CommandHelper
diff --git a/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/PreferenceInitializer.java b/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/PreferenceInitializer.java
index 4e995de26..2bee72fee 100644
--- a/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/PreferenceInitializer.java
+++ b/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/PreferenceInitializer.java
@@ -14,6 +14,7 @@ import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jubula.client.autagent.Activator;
+import org.eclipse.jubula.tools.constants.EnvConstants;
/**
*
@@ -26,15 +27,11 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
public static final String PREF_EMBEDDED_AGENT_PORT =
"org.eclipse.jubula.autagent.preference.port"; //$NON-NLS-1$
- /** default value for "Embedded AUT Agent Port" preference */
- public static final int DEFAULT_EMBEDDED_AGENT_PORT = 60000;
-
@Override
public void initializeDefaultPreferences() {
IEclipsePreferences preferenceNode =
DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID);
preferenceNode.putInt(PREF_EMBEDDED_AGENT_PORT,
- DEFAULT_EMBEDDED_AGENT_PORT);
+ EnvConstants.AUT_AGENT_DEFAULT_PORT);
}
-
}

Back to the top