Top Description Methods
org.testng

public Interface IDataProviderInterceptor

extends ITestNGListener
Imports
java.util.Iterator

This interface helps define an interceptor for data providers. Implementations of this TestNG listener can be wired in via the @Listeners annotation or via the listeners tag in the suite file or via a Service Provider Interface mechanism.

The implementation would be able to alter the actual set of data using which a test method would be iterated upon.

Method Summary

Modifier and TypeMethod and Description
public Iterator<Object[]>

Returns:

- The altered data set that would be used by TestNG to run the test method.
intercept
(Iterator<Object[]>
- The original data set as produced by a particular data provider.
original
,
IDataProviderMethod
- The IDataProviderMethod method object which represents the data provider that was invoked.
dataProviderMethod
,
ITestNGMethod
- The ITestNGMethod method object which represents the test method that will receive the parameters.
method
,
ITestContext
- The ITestContext object that represents the current test context.
iTestContext
)

Inherited from org.testng.ITestNGListener:
isEnabled

Method Detail

interceptback to summary
public Iterator<Object[]> intercept(Iterator<Object[]> original, IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext)
Parameters
original:Iterator<Object[]>

- The original data set as produced by a particular data provider.

dataProviderMethod:IDataProviderMethod

- The IDataProviderMethod method object which represents the data provider that was invoked.

method:ITestNGMethod

- The ITestNGMethod method object which represents the test method that will receive the parameters.

iTestContext:ITestContext

- The ITestContext object that represents the current test context.

Returns:Iterator<Object[]>

- The altered data set that would be used by TestNG to run the test method.