Package org.netbeans.jemmy
Class Timeouts
java.lang.Object
org.netbeans.jemmy.Timeouts
Class to store and process a set of timeout values.
- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a copy of the current timeouts set.boolean
Checks if timeout has already been defined in this timeout instance.static boolean
containsDefault
(String name) Check that default timeout value was defined.Creates Timeout new object by name and getTimeout(name) value.Create timeout for "Timeouts.DeltaTimeout" name.void
Sleeps for the "name" timeout value.static long
getDefault
(String name) Gets default timeout value.long
Gets "Timeouts.DeltaTimeout" timeout value.long
getTimeout
(String name) Gets timeout value.static double
Get timeouts scale.static void
initDefault
(String name, long newValue) Sets default timeout value if it was not set before.long
initTimeout
(String name, long newValue) Sets timeout value if it was not set before.void
load()
Loads timeouts values.void
load
(InputStream stream) Loads timeouts values.void
Loads timeouts values from file.void
Loads debug timeouts values.void
Loads default timeouts values.void
loadDefaults
(InputStream stream) Loads default timeouts values.void
loadDefaults
(String fileName) Loads default timeouts values from file.void
print
(PrintStream ps) Prins all defined timeouts.void
print
(PrintWriter pw) Prins all defined timeouts.static void
setDefault
(String name, long newValue) Stores default timeout value.long
setTimeout
(String name, long newValue) Sets new timeout value.void
Sleeps for the "name" timeout value.
-
Constructor Details
-
Timeouts
public Timeouts()Creates empty Timeouts object.
-
-
Method Details
-
setDefault
Stores default timeout value.- Parameters:
name
- Timeout name.newValue
- Timeout value.- See Also:
-
initDefault
Sets default timeout value if it was not set before.- Parameters:
name
- Timeout name.newValue
- Timeout value.- See Also:
-
getDefault
Gets default timeout value.- Parameters:
name
- Timeout name.- Returns:
- Timeout value or -1 if timeout is not defined.
- See Also:
-
containsDefault
Check that default timeout value was defined.- Parameters:
name
- Timeout name.- Returns:
- True if timeout has been defined, false otherwise.
- See Also:
-
loadDefaults
Loads default timeouts values.- Parameters:
stream
- Stream to load timeouts from.- Throws:
IOException
- See Also:
-
loadDefaults
Loads default timeouts values from file.- Parameters:
fileName
- File to load timeouts from.- Throws:
IOException
FileNotFoundException
- See Also:
-
loadDefaults
Loads default timeouts values. Uses jemmy.timeouts system property to get timeouts file.- Throws:
IOException
FileNotFoundException
- See Also:
-
create
Creates Timeout new object by name and getTimeout(name) value.- Parameters:
name
- Timeout name.- Returns:
- a Timeout instance.
-
createDelta
Create timeout for "Timeouts.DeltaTimeout" name.- Returns:
- a Timeout instance.
-
contains
Checks if timeout has already been defined in this timeout instance.- Parameters:
name
- Timeout name.- Returns:
- True if timeout has been defined, false otherwise.
- See Also:
-
setTimeout
Sets new timeout value.- Parameters:
name
- Timeout name.newValue
- Timeout value.- Returns:
- old timeout value
- See Also:
-
getTimeout
Gets timeout value. It timeout was not defined in this instance, returns default timeout value.- Parameters:
name
- Timeout name.- Returns:
- Timeout value.
- See Also:
-
getDeltaTimeout
public long getDeltaTimeout()Gets "Timeouts.DeltaTimeout" timeout value.- Returns:
- Timeout value.
- See Also:
-
initTimeout
Sets timeout value if it was not set before.- Parameters:
name
- Timeout name.newValue
- Timeout value.- Returns:
- old timeout value
-
cloneThis
Creates a copy of the current timeouts set.- Returns:
- A copy.
-
eSleep
Sleeps for the "name" timeout value. Can throw InterruptedException if current thread was interrupted.- Parameters:
name
- Timeout name.- Throws:
InterruptedException
-
sleep
Sleeps for the "name" timeout value. Does not throw InterruptedException anyway.- Parameters:
name
- Timeout name.
-
print
Prins all defined timeouts.- Parameters:
pw
- PrintWriter to print into.
-
print
Prins all defined timeouts.- Parameters:
ps
- PrintStream to print into.
-
load
Loads timeouts values.- Parameters:
stream
- Stream to load timeouts from.- Throws:
IOException
- See Also:
-
load
Loads timeouts values from file.- Parameters:
fileName
- File to load timeouts from.- Throws:
IOException
FileNotFoundException
- See Also:
-
load
Loads timeouts values. Uses jemmy.timeouts system property to get timeouts file.- Throws:
IOException
FileNotFoundException
- See Also:
-
loadDebugTimeouts
Loads debug timeouts values.- Throws:
IOException
-
getTimeoutsScale
public static double getTimeoutsScale()Get timeouts scale. Uses jemmy.timeouts.scale system property to get the value.- Returns:
- timeouts scale or 1 if the property is not set.
-