Package org.openbravo.base.weld.test
Class ParameterCdiTestRule<T>
- java.lang.Object
-
- org.openbravo.base.weld.test.ParameterCdiTestRule<T>
-
- All Implemented Interfaces:
org.junit.rules.MethodRule
public class ParameterCdiTestRule<T> extends Object implements org.junit.rules.MethodRule
Rule to make possible to run parameterized test cases with Arquillian runner. The Rule field defines the parameter values which will be taken by the field annotated with @ParameterCdiTest. Based on https://gist.github.com/poolik/8764414- Author:
- alostale
- See Also:
ParameterCdiTest
-
-
Constructor Summary
Constructors Constructor Description ParameterCdiTestRule(List<T> params)
Creates a ParameterCdiTestRule without a skipping conditionParameterCdiTestRule(List<T> params, Predicate<T> skipWhen)
Creates a ParameterCdiTestRule with an skipping condition if needed
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.junit.runners.model.Statement
apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target)
-
-
-
Constructor Detail
-
ParameterCdiTestRule
public ParameterCdiTestRule(List<T> params, Predicate<T> skipWhen)
Creates a ParameterCdiTestRule with an skipping condition if needed- Parameters:
params
- the list of parameters of the parameterized testskipWhen
- a predicate that can be used to skip the execution of the test for a subset of parameters. When it returns true for a given parameter, then the execution will be skipped. If this argument is null, then no parameter is skipped.
-
ParameterCdiTestRule
public ParameterCdiTestRule(List<T> params)
Creates a ParameterCdiTestRule without a skipping condition- See Also:
ParameterCdiTestRule(List, Predicate)
-
-
Method Detail
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target)
- Specified by:
apply
in interfaceorg.junit.rules.MethodRule
-
-