Class TimeoutsProvider
- java.lang.Object
-
- org.apache.sling.testing.timeouts.TimeoutsProvider
-
public class TimeoutsProvider extends java.lang.ObjectReturn timeout values that can be multiplied by a configurable factor. Useful to cope with slower integration testing systems: use timeout constants in your code that work for usual development systems, and set a multiplier when running on a slower system.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_TIMEOUT_MULTIPLIER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TimeoutsProvidergetInstance()intgetTimeout(int nomimalValue)longgetTimeout(long nomimalValue)intgetTimeout(java.lang.String systemPropertyName, int defaultNominalValue)Get timeout from a system property, with default value
-
-
-
Field Detail
-
PROP_TIMEOUT_MULTIPLIER
public static final java.lang.String PROP_TIMEOUT_MULTIPLIER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static TimeoutsProvider getInstance()
- Returns:
- the instance of the singleton
-
getTimeout
public long getTimeout(long nomimalValue)
- Parameters:
nomimalValue- base number to be multiplied internally with the factor- Returns:
- the new timeout
-
getTimeout
public int getTimeout(int nomimalValue)
- Parameters:
nomimalValue- base number to be multiplied internally with the factor- Returns:
- the new timeout
-
getTimeout
public int getTimeout(java.lang.String systemPropertyName, int defaultNominalValue)Get timeout from a system property, with default value- Parameters:
systemPropertyName- the name of the system prop from which to get the timeoutdefaultNominalValue- default value in case the property does not exist- Returns:
- the timeout
-
-