Interface CIterableWaiter<E>

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default boolean waitContains​(E expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection contains the expected element.
      default boolean waitContains​(E expected, int waitInSeconds)
      Wait for defined number of seconds till the actual collection contains the expected element.
      default boolean waitContains​(E expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection contains the expected element.
      default boolean waitContainsAll​(java.lang.Iterable<E> expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection contains all elements from the expected collection.
      default boolean waitContainsAll​(java.lang.Iterable<E> expected, int waitInSeconds)
      Wait for defined number of seconds till the actual collection contains all elements from the expected collection.
      default boolean waitContainsAll​(java.lang.Iterable<E> expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection contains all elements from the expected collection.
      default boolean waitContainsNone​(java.lang.Iterable<E> expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection contains none of elements from the expected collection.
      default boolean waitContainsNone​(java.lang.Iterable<E> expected, int waitInSeconds)
      Wait for defined number of seconds till the actual collection contains none of elements from the expected collection.
      default boolean waitContainsNone​(java.lang.Iterable<E> expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection contains none of elements from the expected collection.
      default boolean waitEmptyOrContains​(E expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection either is empty or contains the expected element.
      default boolean waitEmptyOrContains​(E expected, int waitInSeconds)
      Wait for defined number of seconds till the actual collection either is empty or contains the expected element.
      default boolean waitEmptyOrContains​(E expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection either is empty or contains the expected element.
      default boolean waitEmptyOrNotContains​(E expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection either is empty or does not contain the expected element.
      default boolean waitEmptyOrNotContains​(E expected, int waitInSeconds)
      Wait for defined number of seconds till the actual collection either is empty or does not contain the expected element.
      default boolean waitEmptyOrNotContains​(E expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection either is empty or does not contain the expected element.
      default boolean waitEquals​(java.lang.Iterable<E> expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual and expected collections have the exact same elements.
      default boolean waitEquals​(java.lang.Iterable<E> expected, int waitInSeconds)
      Wait for defined number of seconds till the actual and expected collections have the exact same elements.
      default boolean waitEquals​(java.lang.Iterable<E> expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual and expected collections have the exact same elements.
      default boolean waitHas​(java.util.function.Predicate<E> expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection has the expected predicate.
      default boolean waitHas​(java.util.function.Predicate<E> expected, int waitInSeconds)
      Wait for defined number of seconds till the actual collection contains the expected predicate.
      default boolean waitHas​(java.util.function.Predicate<E> expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection contains the expected predicate.
      default boolean waitIsEmpty()
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection is empty.
      default boolean waitIsEmpty​(int waitInSeconds)
      Wait for defined number of seconds till the actual collection is empty.
      default boolean waitIsEmpty​(int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection is empty.
      default boolean waitIsNotEmpty()
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection is not empty.
      default boolean waitIsNotEmpty​(int waitInSeconds)
      Wait for defined number of seconds till the actual collection is not empty.
      default boolean waitIsNotEmpty​(int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection is not empty.
      default boolean waitNotContains​(E expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection does not contain the expected element.
      default boolean waitNotContains​(E expected, int waitInSeconds)
      Wait for defined number of seconds till the actual collection does not contain the expected element.
      default boolean waitNotContains​(E expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection does not contain the expected element.
      default boolean waitNotContainsAll​(java.lang.Iterable<E> expected)
      Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection contains some but not all elements from the expected collection.
      default boolean waitNotContainsAll​(java.lang.Iterable<E> expected, int waitInSeconds)
      Wait for defined number of seconds till the actual collection contains some but not all elements from the expected collection.
      default boolean waitNotContainsAll​(java.lang.Iterable<E> expected, int waitInSeconds, int intervalInMilliSeconds)
      Wait for defined number of seconds till the actual collection contains some but not all elements from the expected collection.
      • Methods inherited from interface org.catools.common.extensions.states.interfaces.CBaseState

        getValue
    • Method Detail

      • waitHas

        default boolean waitHas​(java.util.function.Predicate<E> expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection has the expected predicate.
        Parameters:
        expected - predicate
        Returns:
        true if wait operation succeed otherwise return false
      • waitHas

        default boolean waitHas​(java.util.function.Predicate<E> expected,
                                int waitInSeconds)
        Wait for defined number of seconds till the actual collection contains the expected predicate.
        Parameters:
        expected - predicate
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitHas

        default boolean waitHas​(java.util.function.Predicate<E> expected,
                                int waitInSeconds,
                                int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection contains the expected predicate.
        Parameters:
        expected - predicate
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitContains

        default boolean waitContains​(E expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection contains the expected element.
        Parameters:
        expected - value to compare
        Returns:
        true if wait operation succeed otherwise return false
      • waitContains

        default boolean waitContains​(E expected,
                                     int waitInSeconds)
        Wait for defined number of seconds till the actual collection contains the expected element.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitContains

        default boolean waitContains​(E expected,
                                     int waitInSeconds,
                                     int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection contains the expected element.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitContainsAll

        default boolean waitContainsAll​(java.lang.Iterable<E> expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection contains all elements from the expected collection. Please note that actual collection might have more elements.
        Parameters:
        expected - value to compare
        Returns:
        true if wait operation succeed otherwise return false
      • waitContainsAll

        default boolean waitContainsAll​(java.lang.Iterable<E> expected,
                                        int waitInSeconds)
        Wait for defined number of seconds till the actual collection contains all elements from the expected collection. Please note that actual collection might have more elements.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitContainsAll

        default boolean waitContainsAll​(java.lang.Iterable<E> expected,
                                        int waitInSeconds,
                                        int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection contains all elements from the expected collection. Please note that actual collection might have more elements.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitContainsNone

        default boolean waitContainsNone​(java.lang.Iterable<E> expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection contains none of elements from the expected collection.
        Parameters:
        expected - value to compare
        Returns:
        true if wait operation succeed otherwise return false
      • waitContainsNone

        default boolean waitContainsNone​(java.lang.Iterable<E> expected,
                                         int waitInSeconds)
        Wait for defined number of seconds till the actual collection contains none of elements from the expected collection.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitContainsNone

        default boolean waitContainsNone​(java.lang.Iterable<E> expected,
                                         int waitInSeconds,
                                         int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection contains none of elements from the expected collection.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitEmptyOrContains

        default boolean waitEmptyOrContains​(E expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection either is empty or contains the expected element.
        Parameters:
        expected - value to compare
        Returns:
        true if wait operation succeed otherwise return false
      • waitEmptyOrContains

        default boolean waitEmptyOrContains​(E expected,
                                            int waitInSeconds)
        Wait for defined number of seconds till the actual collection either is empty or contains the expected element.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitEmptyOrContains

        default boolean waitEmptyOrContains​(E expected,
                                            int waitInSeconds,
                                            int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection either is empty or contains the expected element.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitEmptyOrNotContains

        default boolean waitEmptyOrNotContains​(E expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection either is empty or does not contain the expected element.
        Parameters:
        expected - value to compare
        Returns:
        true if wait operation succeed otherwise return false
      • waitEmptyOrNotContains

        default boolean waitEmptyOrNotContains​(E expected,
                                               int waitInSeconds)
        Wait for defined number of seconds till the actual collection either is empty or does not contain the expected element.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitEmptyOrNotContains

        default boolean waitEmptyOrNotContains​(E expected,
                                               int waitInSeconds,
                                               int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection either is empty or does not contain the expected element.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitEquals

        default boolean waitEquals​(java.lang.Iterable<E> expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the 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 verify that expected has all elements from actual.
        Specified by:
        waitEquals in interface CObjectWaiter<E>
        Parameters:
        expected - value to compare
        Returns:
        true if wait operation succeed otherwise return false
      • waitEquals

        default boolean waitEquals​(java.lang.Iterable<E> expected,
                                   int waitInSeconds)
        Wait for defined number of seconds till the 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 verify that expected has all elements from actual.
        Specified by:
        waitEquals in interface CObjectWaiter<E>
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitEquals

        default boolean waitEquals​(java.lang.Iterable<E> expected,
                                   int waitInSeconds,
                                   int intervalInMilliSeconds)
        Wait for defined number of seconds till the 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 verify that expected has all elements from actual.
        Specified by:
        waitEquals in interface CObjectWaiter<E>
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitIsEmpty

        default boolean waitIsEmpty()
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection is empty.
        Returns:
        true if wait operation succeed otherwise return false
      • waitIsEmpty

        default boolean waitIsEmpty​(int waitInSeconds)
        Wait for defined number of seconds till the actual collection is empty.
        Parameters:
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitIsEmpty

        default boolean waitIsEmpty​(int waitInSeconds,
                                    int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection is empty.
        Parameters:
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitIsNotEmpty

        default boolean waitIsNotEmpty()
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection is not empty. (might contains null values)
        Returns:
        true if wait operation succeed otherwise return false
      • waitIsNotEmpty

        default boolean waitIsNotEmpty​(int waitInSeconds)
        Wait for defined number of seconds till the actual collection is not empty. (might contains null values)
        Parameters:
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitIsNotEmpty

        default boolean waitIsNotEmpty​(int waitInSeconds,
                                       int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection is not empty. (might contains null values)
        Parameters:
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitNotContains

        default boolean waitNotContains​(E expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection does not contain the expected element.
        Parameters:
        expected - value to compare
        Returns:
        true if wait operation succeed otherwise return false
      • waitNotContains

        default boolean waitNotContains​(E expected,
                                        int waitInSeconds)
        Wait for defined number of seconds till the actual collection does not contain the expected element.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitNotContains

        default boolean waitNotContains​(E expected,
                                        int waitInSeconds,
                                        int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection does not contain the expected element.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false
      • waitNotContainsAll

        default boolean waitNotContainsAll​(java.lang.Iterable<E> expected)
        Wait for CConfigs.TypeExtension.getDefaultWaitInSeconds() number of milliseconds till the actual collection contains some but not 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.
        Parameters:
        expected - value to compare
        Returns:
        true if wait operation succeed otherwise return false
      • waitNotContainsAll

        default boolean waitNotContainsAll​(java.lang.Iterable<E> expected,
                                           int waitInSeconds)
        Wait for defined number of seconds till the actual collection contains some but not 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.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        Returns:
        true if wait operation succeed otherwise return false
      • waitNotContainsAll

        default boolean waitNotContainsAll​(java.lang.Iterable<E> expected,
                                           int waitInSeconds,
                                           int intervalInMilliSeconds)
        Wait for defined number of seconds till the actual collection contains some but not 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.
        Parameters:
        expected - value to compare
        waitInSeconds - maximum wait time
        intervalInMilliSeconds - interval between retries in milliseconds
        Returns:
        true if wait operation succeed otherwise return false