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.booleanChecks if timeout has already been defined in this timeout instance.static booleancontainsDefault(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.voidSleeps for the "name" timeout value.static longgetDefault(String name) Gets default timeout value.longGets "Timeouts.DeltaTimeout" timeout value.longgetTimeout(String name) Gets timeout value.static doubleGet timeouts scale.static voidinitDefault(String name, long newValue) Sets default timeout value if it was not set before.longinitTimeout(String name, long newValue) Sets timeout value if it was not set before.voidload()Loads timeouts values.voidload(InputStream stream) Loads timeouts values.voidLoads timeouts values from file.voidLoads debug timeouts values.voidLoads default timeouts values.voidloadDefaults(InputStream stream) Loads default timeouts values.voidloadDefaults(String fileName) Loads default timeouts values from file.voidprint(PrintStream ps) Prins all defined timeouts.voidprint(PrintWriter pw) Prins all defined timeouts.static voidsetDefault(String name, long newValue) Stores default timeout value.longsetTimeout(String name, long newValue) Sets new timeout value.voidSleeps 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:
IOExceptionFileNotFoundException- See Also:
-
loadDefaults
Loads default timeouts values. Uses jemmy.timeouts system property to get timeouts file.- Throws:
IOExceptionFileNotFoundException- See Also:
-
create
-
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
-
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:
IOExceptionFileNotFoundException- See Also:
-
load
Loads timeouts values. Uses jemmy.timeouts system property to get timeouts file.- Throws:
IOExceptionFileNotFoundException- See Also:
-
loadDebugTimeouts
-
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.
-