Class ListGenerator<T>

  • Type Parameters:
    T - Parameter type
    All Implemented Interfaces:
    Generator<T>, org.junit.rules.TestRule

    @ProviderType
    public final class ListGenerator<T>
    extends java.lang.Object
    implements Generator<T>
    Parameter generator rule based on a list of values.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement test, org.junit.runner.Description description)  
      T value()  
      • Methods inherited from class java.lang.Object

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

      • ListGenerator

        public ListGenerator​(java.util.List<T> values)
        Parameters:
        values - Parameter values
      • ListGenerator

        public ListGenerator​(java.util.List<T> values,
                             Callback<T> setUpCallback,
                             Callback<T> tearDownCallback)
        Parameters:
        values - Parameter values
        setUpCallback - Callback method that is called for each value iteration before test method is executed.
        tearDownCallback - Callback method that is called for each value iteration after test method was executed.
    • Method Detail

      • value

        public T value()
        Specified by:
        value in interface Generator<T>
        Returns:
        Current parameter value
      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement test,
                                                       org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule