Class CIterableWait
- java.lang.Object
-
- org.catools.common.extensions.wait.CObjectWait
-
- org.catools.common.extensions.wait.CIterableWait
-
- Direct Known Subclasses:
CCollectionWait
public class CIterableWait extends CObjectWait
Iterable wait class contains all wait method which is related to Iterable
-
-
Constructor Summary
Constructors Constructor Description CIterableWait()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <C> boolean
waitContains(java.lang.Iterable<C> actual, C expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection contains the expected element.static <C> boolean
waitContainsAll(java.lang.Iterable<C> actual, java.lang.Iterable<C> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection contains all elements from the expected collection.static <C> boolean
waitContainsNone(java.lang.Iterable<C> actual, java.lang.Iterable<C> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection contains none of elements from the expected collection.static <C> boolean
waitEmptyOrContains(java.lang.Iterable<C> actual, C expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection either is empty or contains the expected element.static <C> boolean
waitEmptyOrNotContains(java.lang.Iterable<C> actual, C expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection either is empty or does not contain the expected element.static <C> boolean
waitEquals(java.lang.Iterable<C> actual, java.lang.Iterable<C> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual and expected collections have the exact same elements.static <C> boolean
waitIsEmpty(java.lang.Iterable<C> actual, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection is empty.static <C> boolean
waitIsNotEmpty(java.lang.Iterable<C> actual, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection is not empty.static <C> boolean
waitNotContains(java.lang.Iterable<C> actual, C expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection does not contain the expected element.static <C> boolean
waitNotContainsAll(java.lang.Iterable<C> actual, java.lang.Iterable<C> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection does not contain all elements from the expected collection.-
Methods inherited from class org.catools.common.extensions.wait.CObjectWait
waitEquals, waitIsNotNull, waitIsNull, waitNotEquals
-
-
-
-
Method Detail
-
waitContains
public static <C> boolean waitContains(java.lang.Iterable<C> actual, C expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection contains the expected element.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to compareexpected
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitContainsAll
public static <C> boolean waitContainsAll(java.lang.Iterable<C> actual, java.lang.Iterable<C> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection contains all elements from the expected collection. Please note that actual collection might have more elements.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to compareexpected
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitContainsNone
public static <C> boolean waitContainsNone(java.lang.Iterable<C> actual, java.lang.Iterable<C> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection contains none of elements from the expected collection.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to compareexpected
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitEmptyOrContains
public static <C> boolean waitEmptyOrContains(java.lang.Iterable<C> actual, C expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection either is empty or contains the expected element.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to compareexpected
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitEmptyOrNotContains
public static <C> boolean waitEmptyOrNotContains(java.lang.Iterable<C> actual, C expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection either is empty or does not contain the expected element.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to compareexpected
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitEquals
public static <C> boolean waitEquals(java.lang.Iterable<C> actual, java.lang.Iterable<C> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual and expected collections have the exact same elements. (Ignore element order) First we compare that actual collection contains all expected collection elements and then we Wait for defined number of seconds till expected has all elements from actual.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to compareexpected
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitIsEmpty
public static <C> boolean waitIsEmpty(java.lang.Iterable<C> actual, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection is empty.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitIsNotEmpty
public static <C> boolean waitIsNotEmpty(java.lang.Iterable<C> actual, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection is not empty. (might contains null values)- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitNotContains
public static <C> boolean waitNotContains(java.lang.Iterable<C> actual, C expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection does not contain the expected element.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to compareexpected
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitNotContainsAll
public static <C> boolean waitNotContainsAll(java.lang.Iterable<C> actual, java.lang.Iterable<C> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual collection does not contain all elements from the expected collection. Please note that actual collection might have some of elements but the point is to ensure that not all expected elements are exist in it.- Type Parameters:
C
- type of collection elements- Parameters:
actual
- value to compareexpected
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
-