Class 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>
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CMapWait

        public CMapWait()
    • 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - map to compare
        expectedKey - key to compare
        expectedValue - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expectedKey - key to compare
        expectedValue - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expectedKey - key to compare
        expectedValue - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - map to compare
        expected - map to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expectedKey - key to compare
        expectedValue - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - 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 key
        V - type of map value
        Parameters:
        actual - value to compare
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        return actual value or null if the timeout reached