Class CMapWait
- java.lang.Object
-
- org.catools.common.extensions.wait.CObjectWait
-
- org.catools.common.extensions.wait.CMapWait
-
public class CMapWait extends CObjectWait
Map wait class contains all wait method which is related to Map
-
-
Constructor Summary
Constructors Constructor Description CMapWait()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
booleanwaitContains(java.util.Map<K,V> actual, java.util.Map.Entry<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map contains the expected entry.static <K,V>
booleanwaitContains(java.util.Map<K,V> actual, K expectedKey, V expectedValue, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map contains the expected key and value.static <K,V>
booleanwaitContainsAll(java.util.Map<K,V> actual, java.util.Map<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map contains all entries from the expected map.static <K,V>
booleanwaitContainsNone(java.util.Map<K,V> actual, java.util.Map<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map contains none of entries from the expected map.static <K,V>
booleanwaitEmptyOrContains(java.util.Map<K,V> actual, java.util.Map.Entry<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map either is empty or contains the expected entry.static <K,V>
booleanwaitEmptyOrContains(java.util.Map<K,V> actual, K expectedKey, V expectedValue, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map either is empty or contains the expected entry.static <K,V>
booleanwaitEmptyOrNotContains(java.util.Map<K,V> actual, java.util.Map.Entry<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map either is empty or does not contain the expected entry.static <K,V>
booleanwaitEmptyOrNotContains(java.util.Map<K,V> actual, K expectedKey, V expectedValue, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map either is empty or does not contains the expected entry.static <K,V>
booleanwaitEquals(java.util.Map<K,V> actual, java.util.Map<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual and expected maps have the exact same entries.static <K,V>
booleanwaitIsEmpty(java.util.Map<K,V> actual, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map is empty.static <K,V>
booleanwaitIsNotEmpty(java.util.Map<K,V> actual, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map is not empty.static <K,V>
booleanwaitNotContains(java.util.Map<K,V> actual, java.util.Map.Entry<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map does not contain the expected entry.static <K,V>
booleanwaitNotContains(java.util.Map<K,V> actual, K expectedKey, V expectedValue, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map does not contain the expected entry.static <K,V>
booleanwaitNotContainsAll(java.util.Map<K,V> actual, java.util.Map<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map does not contain all entries from the expected map.-
Methods inherited from class org.catools.common.extensions.wait.CObjectWait
waitEquals, waitIsNotNull, waitIsNull, waitNotEquals
-
-
-
-
Method Detail
-
waitContains
public static <K,V> boolean waitContains(java.util.Map<K,V> actual, java.util.Map.Entry<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map contains the expected entry.- Type Parameters:
K
- type of map keyV
- type of map value- 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
-
waitContains
public static <K,V> boolean waitContains(java.util.Map<K,V> actual, K expectedKey, V expectedValue, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map contains the expected key and value.- Type Parameters:
K
- type of map keyV
- type of map value- Parameters:
actual
- map to compareexpectedKey
- key to compareexpectedValue
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitContainsAll
public static <K,V> boolean waitContainsAll(java.util.Map<K,V> actual, java.util.Map<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map contains all entries from the expected map. Please note that actual map might have more entries.- Type Parameters:
K
- type of map keyV
- type of map value- 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 <K,V> boolean waitContainsNone(java.util.Map<K,V> actual, java.util.Map<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map contains none of entries from the expected map.- Type Parameters:
K
- type of map keyV
- type of map value- 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 <K,V> boolean waitEmptyOrContains(java.util.Map<K,V> actual, K expectedKey, V expectedValue, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map either is empty or contains the expected entry.- Type Parameters:
K
- type of map keyV
- type of map value- Parameters:
actual
- value to compareexpectedKey
- key to compareexpectedValue
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitEmptyOrContains
public static <K,V> boolean waitEmptyOrContains(java.util.Map<K,V> actual, java.util.Map.Entry<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map either is empty or contains the expected entry.- Type Parameters:
K
- type of map keyV
- type of map value- 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 <K,V> boolean waitEmptyOrNotContains(java.util.Map<K,V> actual, K expectedKey, V expectedValue, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map either is empty or does not contains the expected entry.- Type Parameters:
K
- type of map keyV
- type of map value- Parameters:
actual
- value to compareexpectedKey
- key to compareexpectedValue
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitEmptyOrNotContains
public static <K,V> boolean waitEmptyOrNotContains(java.util.Map<K,V> actual, java.util.Map.Entry<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map either is empty or does not contain the expected entry.- Type Parameters:
K
- type of map keyV
- type of map value- 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 <K,V> boolean waitEquals(java.util.Map<K,V> actual, java.util.Map<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual and expected maps have the exact same entries. (Ignore entry order) First we compare that actual map contains all expected map entries and then we Wait for defined number of seconds till expected has all entries from actual.- Type Parameters:
K
- type of map keyV
- type of map value- Parameters:
actual
- map to compareexpected
- map to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitIsEmpty
public static <K,V> boolean waitIsEmpty(java.util.Map<K,V> actual, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map is empty.- Type Parameters:
K
- type of map keyV
- type of map value- 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 <K,V> boolean waitIsNotEmpty(java.util.Map<K,V> actual, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map is not empty. (might contains null values)- Type Parameters:
K
- type of map keyV
- type of map value- 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 <K,V> boolean waitNotContains(java.util.Map<K,V> actual, java.util.Map.Entry<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map does not contain the expected entry.- Type Parameters:
K
- type of map keyV
- type of map value- 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
-
waitNotContains
public static <K,V> boolean waitNotContains(java.util.Map<K,V> actual, K expectedKey, V expectedValue, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map does not contain the expected entry.- Type Parameters:
K
- type of map keyV
- type of map value- Parameters:
actual
- value to compareexpectedKey
- key to compareexpectedValue
- value to comparewaitInSeconds
- maximum wait timeintervalInMilliSeconds
- interval between retries in milliseconds- Returns:
- return actual value or null if the timeout reached
-
waitNotContainsAll
public static <K,V> boolean waitNotContainsAll(java.util.Map<K,V> actual, java.util.Map<K,V> expected, int waitInSeconds, int intervalInMilliSeconds)
Wait for defined number of seconds till actual map does not contain all entries from the expected map. Please note that actual map might have some of entries but the point is to ensure that not all expected entries are exist in it.- Type Parameters:
K
- type of map keyV
- type of map value- 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
-
-