Package org.testng.internal
Class TestMethodContainer
- java.lang.Object
-
- org.testng.internal.TestMethodContainer
-
- All Implemented Interfaces:
IContainer<ITestNGMethod>
public final class TestMethodContainer extends java.lang.Object implements IContainer<ITestNGMethod>
This implementation leverages a supplier to lazily load the test methods (data) for the very first time and "remembers it" for later invocations. If the user clears the data (the one that we were remembering) then, it resorts to just using the supplier to provide on-demand evaluation of test methods. This implementation is built such that once its been asked to forget the data, it no longer caches it anymore.
-
-
Constructor Summary
Constructors Constructor Description TestMethodContainer(java.util.function.Supplier<ITestNGMethod[]> supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearItems()
Clears the containerITestNGMethod[]
getItems()
boolean
isCleared()
-
-
-
Constructor Detail
-
TestMethodContainer
public TestMethodContainer(java.util.function.Supplier<ITestNGMethod[]> supplier)
-
-
Method Detail
-
getItems
public ITestNGMethod[] getItems()
- Specified by:
getItems
in interfaceIContainer<ITestNGMethod>
- Returns:
- - Retrieves data from the container
-
isCleared
public boolean isCleared()
- Specified by:
isCleared
in interfaceIContainer<ITestNGMethod>
- Returns:
- -
true
if the container items were cleared.
-
clearItems
public void clearItems()
Description copied from interface:IContainer
Clears the container- Specified by:
clearItems
in interfaceIContainer<ITestNGMethod>
-
-