Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/CapTestCommand.java8
-rw-r--r--org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/ChangeAUTModeCommand.java14
-rw-r--r--org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/CheckListener.java12
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/CheckListener.java12
4 files changed, 19 insertions, 27 deletions
diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/CapTestCommand.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/CapTestCommand.java
index 90ce0fa4c..90ba96c26 100644
--- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/CapTestCommand.java
+++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/CapTestCommand.java
@@ -214,9 +214,7 @@ public class CapTestCommand implements ICommand {
final int oldMode = autServer.getMode();
TestErrorEvent event = null;
CAPTestResponseMessage response = new CAPTestResponseMessage();
- if (oldMode != ChangeAUTModeMessage.TESTING) {
- autServer.setMode(ChangeAUTModeMessage.TESTING);
- }
+ autServer.setMode(ChangeAUTModeMessage.TESTING);
try {
MessageCap messageCap = m_capTestMessage.getMessageCap();
response.setMessageCap(messageCap);
@@ -271,9 +269,7 @@ public class CapTestCommand implements ICommand {
} catch (MethodParamException ex) {
LOG.error(ex.getLocalizedMessage(), ex);
} finally {
- if (autServer.getMode() != oldMode) {
- autServer.setMode(oldMode);
- }
+ autServer.setMode(oldMode);
}
if (event != null) {
response.setTestErrorEvent(event);
diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/ChangeAUTModeCommand.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/ChangeAUTModeCommand.java
index ed20c3430..f796d38a0 100644
--- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/ChangeAUTModeCommand.java
+++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/ChangeAUTModeCommand.java
@@ -89,9 +89,10 @@ public class ChangeAUTModeCommand implements ICommand {
log.info("changing mode of the AUTServer to: " //$NON-NLS-1$
+ m_message.getMode());
- int oldMode = AUTServer.getInstance().getMode();
- AUTServer.getInstance().setMode(m_message.getMode());
- AUTServer.getInstance().refreshMode();
+ AUTServer autserver = AUTServer.getInstance();
+ int oldMode = autserver.getMode();
+ autserver.setMode(m_message.getMode());
+ autserver.refreshMode();
ServerShowObservConsoleMessage shellMsg =
new ServerShowObservConsoleMessage();
ServerShowDialogMessage dialogMsg =
@@ -119,11 +120,10 @@ public class ChangeAUTModeCommand implements ICommand {
}
try {
- AUTServer.getInstance().getServerCommunicator().send(shellMsg);
+ autserver.getServerCommunicator().send(shellMsg);
if (m_message.getMode() != oldMode && (m_message.getMode()
== ChangeAUTModeMessage.TESTING)) {
- AUTServer.getInstance().getServerCommunicator()
- .send(dialogMsg);
+ autserver.getServerCommunicator().send(dialogMsg);
}
} catch (CommunicationException e) {
// Could not send message to AUT Agent. This is not a problem,
@@ -133,7 +133,7 @@ public class ChangeAUTModeCommand implements ICommand {
}
AUTModeChangedMessage result = new AUTModeChangedMessage();
- result.setMode(AUTServer.getInstance().getMode());
+ result.setMode(autserver.getMode());
return result;
}
diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/CheckListener.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/CheckListener.java
index 75286aa5f..9f418a6af 100644
--- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/CheckListener.java
+++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/CheckListener.java
@@ -178,10 +178,10 @@ public class CheckListener extends AbstractAutSwingEventListener {
*/
protected void openCheckDialog(IComponentIdentifier id,
Map<String, String> checkValues, String logName) {
+ AUTServer autsever = AUTServer.getInstance();
try {
// send a message with the identifier of the selected component
- AUTServer.getInstance().setMode(
- ChangeAUTModeMessage.TESTING);
+ autsever.setMode(ChangeAUTModeMessage.TESTING);
// set always to true, before showing observing
// dialog. Changing AUTServer mode sets it to false
m_active = true;
@@ -191,16 +191,14 @@ public class CheckListener extends AbstractAutSwingEventListener {
.findComponent(id.getSupportedClassName());
sendMessage(id, comp, checkValues, logName);
- AUTServer.getInstance()
- .setObservingDialogOpen(true);
+ autsever.setObservingDialogOpen(true);
// m_active could be set to false, by ending observation
// mode in client
if (m_active) {
- AUTServer.getInstance().setMode(
- ChangeAUTModeMessage.CHECK_MODE);
+ autsever.setMode(ChangeAUTModeMessage.CHECK_MODE);
}
} catch (CommunicationException nifce) {
- AUTServer.getInstance().setObservingDialogOpen(false);
+ autsever.setObservingDialogOpen(false);
log.error("communication exception: '" + nifce); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/CheckListener.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/CheckListener.java
index 94b0979c8..779bcf784 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/CheckListener.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/CheckListener.java
@@ -161,10 +161,10 @@ public class CheckListener extends AbstractAutSwtEventListener {
*/
protected void openCheckDialog(IComponentIdentifier id,
Map<String, String> checkValues, String logName) {
+ AUTServer autserver = AUTServer.getInstance();
try {
// send a message with the identifier of the selected component
- AUTServer.getInstance().setMode(
- ChangeAUTModeMessage.TESTING);
+ autserver.setMode(ChangeAUTModeMessage.TESTING);
// set always to true, before showing observing
// dialog. Changing AUTServer mode sets it to false
m_active = true;
@@ -174,16 +174,14 @@ public class CheckListener extends AbstractAutSwtEventListener {
.findComponent(id.getSupportedClassName());
sendMessage(id, comp, checkValues, logName);
- AUTServer.getInstance()
- .setObservingDialogOpen(true);
+ autserver.setObservingDialogOpen(true);
// m_active could be set to false, by ending observation
// mode in client
if (m_active) {
- AUTServer.getInstance().setMode(
- ChangeAUTModeMessage.CHECK_MODE);
+ autserver.setMode(ChangeAUTModeMessage.CHECK_MODE);
}
} catch (CommunicationException nifce) {
- AUTServer.getInstance().setObservingDialogOpen(false);
+ autserver.setObservingDialogOpen(false);
log.error("communication exception: '" + nifce); //$NON-NLS-1$
}
}

Back to the top