public class ConnectionTimeout extends Object implements Runnable
run()
waits until the client
connects or the time out value is reached. The time out value defaults to 5 seconds
and can be configured in the Execution panel of the Preferences window or at the
level of Java preferences
(UserConfiguration.getInstance().setInteger("scripting.connectionTimeoutInSec", 5)
).
The default value may be further overridden though the setTimeout(java.lang.Integer)
method. If the connection gets established within the timeout period, the isConnected()
method returns true.T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Constructor and Description |
---|
ConnectionTimeout(RemoteDesktopClient client)
Connector for a desktop client.
|
ConnectionTimeout(ScriptingContext context,
String timeoutMessage)
Constructor to be used with a context.
|
Modifier and Type | Method and Description |
---|---|
int |
getTimeout()
Get the timeout value.
|
boolean |
isConnected()
Get the result achieved by the
run() method. |
void |
run()
Implementation of the
Runnable interface. |
void |
setTimeout(Integer timeout)
Set the timeout value.
|
public ConnectionTimeout(ScriptingContext context, String timeoutMessage)
context
- a valid execution context of a test script which is being
executed.timeoutMessage
- if not null the message will be fired as a script log.
This typically makes the GUI display it in the status bar. The message may
optionally contain the MessageFormat parameter of {0} which will be replaced
with number of seconds remaining to the timeout.public ConnectionTimeout(RemoteDesktopClient client)
client
- a desktop client.public void run()
Runnable
interface. This method waits for
the connection as is specified in the class description.public int getTimeout()
setTimeout(java.lang.Integer)
,
the method returns it. Otherwise it returns a value loaded from user preferences (parameter
scripting.connectionTimeoutInSec
).public void setTimeout(Integer timeout)
timeout
- in seconds.public boolean isConnected()
run()
method.