IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.script
Interface IOperatingSystem


public interface IOperatingSystem

Enables access to some commonly used operating system commands that are not immediately available from the scripting language. Typically, the behavior of these commands depends upon the host operating system. The script developer must therefore adjust to the idiosyncrasies of the host operating system.

This interface is accessible through the getOperatingSystem method available directly to all scripts.

Since:
RFT1.0

Method Summary
 java.lang.String getenv(java.lang.String name)
          Gets the value of an environment variable.
 java.lang.String getEnvironment(java.lang.String variable)
          Returns the value of a specified environment variable or null if the variable is not found in the current process's environment.
 int getForegroundLockTimeout()
          Gets the foreground lock timeout (in milliseconds) on Windows.
 int getRegistryIntValue(java.lang.String key)
          Gets an integer registry value.
 java.lang.String getRegistryValue(java.lang.String key)
          Gets a String registry value.
 java.lang.String getVersion()
          Returns a description of the operating system, including version information.
 boolean isWindows()
          Returns true if the current operating system is Microsoft Windows.
 void setenv(java.lang.String name, java.lang.String value)
          Sets the value of an environment variable.
 void setForegroundLockTimeout(int timeout)
          Sets the foreground lock timeout (in milliseconds) on Windows.
 void unsetenv(java.lang.String name)
          Sets an environment variable to null.
 

Method Detail

getVersion

java.lang.String getVersion()
Returns a description of the operating system, including version information. The format of the resulting String is host dependent.

Returns:
The operating system version information

getEnvironment

java.lang.String getEnvironment(java.lang.String variable)
Returns the value of a specified environment variable or null if the variable is not found in the current process's environment.


isWindows

boolean isWindows()
Returns true if the current operating system is Microsoft Windows.


getForegroundLockTimeout

int getForegroundLockTimeout()
                             throws UnsupportedMethodException,                                     NotSupportedOnUnixException
Gets the foreground lock timeout (in milliseconds) on Windows. On some versions of Windows (for example, Windows2000 or Windows98), rules prevent a non- foreground window from changing the foreground window. This timeout indicates how long the user interface must be quiet, that is, have no mouse or keyboard events, before the foreground can change. If Windows delays a foreground change, the window's icon may flash in the system tray. On some systems, for example, Windows95, NT4, and UNIX, this is not supported, and RobotJ throws an exception.

Throws:
UnsupportedMethodException
NotSupportedOnUnixException

setForegroundLockTimeout

void setForegroundLockTimeout(int timeout)
                              throws UnsupportedMethodException,                                      NotSupportedOnUnixException
Sets the foreground lock timeout (in milliseconds) on Windows. On some versions of Windows (for example, Windows2000 or Windows 98), rules prevent a non- foreground window from changing the foreground window. This timeout indicates how long the user interface must be quiet, that is, have no mouse or keyboard events, before the foreground can change. If Windows delays a foreground change, the window's icon may flash in the system tray. This sticky setting is stored in the registry on a per-user basis. On some systems, for example, Windows95, NT4 and UNIX, this is not supported, and RobotJ throws an exception.

Throws:
UnsupportedMethodException
NotSupportedOnUnixException

getRegistryValue

java.lang.String getRegistryValue(java.lang.String key)
                                  throws NotSupportedOnUnixException,                                          NoSuchRegistryKeyException
Gets a String registry value. This is a native function. The input is the full registry path to the desired value, for example, "HKEY_CURRENT_MACHINE\SOFTWARE\Rational Software\Rational Test\8\Rational FT Install Directory". The specified registry value is assumed to be a String value, and its value is returned. On Windows, the NoSuchRegistryKeyException is thrown if the given key does not exist or is of the wrong type. On UNIX, the implementation throws the NotSupportedOnUnixException.

Throws:
NotSupportedOnUnixException
NoSuchRegistryKeyException

getRegistryIntValue

int getRegistryIntValue(java.lang.String key)
                        throws NotSupportedOnUnixException,                                NoSuchRegistryKeyException
Gets an integer registry value. This is a native function. The input is the full registry path to the desired value, for example, "HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout". The specified registry value is assumed to be an integer (DWORD) value. Its value is returned. On systems running Windows, the NoSuchRegistryKeyException is thrown if the key does not exist or is of the wrong type. On systems running Unix, the NotSupportedOnUnixException is thrown.

Throws:
NotSupportedOnUnixException
NoSuchRegistryKeyException

getenv

java.lang.String getenv(java.lang.String name)
Gets the value of an environment variable.


setenv

void setenv(java.lang.String name,             java.lang.String value)
Sets the value of an environment variable.


unsetenv

void unsetenv(java.lang.String name)
Sets an environment variable to null.