类 ProfileValueChecker
- java.lang.Object
- org.junit.runners.model.Statement
- org.springframework.test.context.junit4.statements.ProfileValueChecker
public class ProfileValueChecker extends Statement
ProfileValueChecker
is a custom JUnitStatement
that checks whether a test class or test method is enabled in the current environment via Spring's@IfProfileValue
annotation.- 从以下版本开始:
- 4.2
- 作者:
- Sam Brannen, Philippe Marschall
- 另请参阅:
evaluate()
,IfProfileValue
,ProfileValueUtils
构造器概要
构造器 构造器 说明 ProfileValueChecker(Statement next, Class<?> testClass, Method testMethod)
Construct a newProfileValueChecker
statement.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
evaluate()
Determine if the test specified by arguments to the constructor is enabled in the current environment, as configured via the@IfProfileValue
annotation.
构造器详细资料
ProfileValueChecker
public ProfileValueChecker(Statement next, Class<?> testClass, Method testMethod)
Construct a newProfileValueChecker
statement.- 参数:
next
- the nextStatement
in the execution chain; nevernull
testClass
- the test class to check; nevernull
testMethod
- the test method to check; may benull
if thisProfileValueChecker
is being applied at the class level
方法详细资料
evaluate
public void evaluate() throws Throwable
Determine if the test specified by arguments to the constructor is enabled in the current environment, as configured via the@IfProfileValue
annotation.If the test is not annotated with
@IfProfileValue
it is considered enabled.If a test is not enabled, this method will abort further evaluation of the execution chain with a failed assumption; otherwise, this method will simply evaluate the next
Statement
in the execution chain.- 指定者:
evaluate
在类中Statement
- 抛出:
AssumptionViolatedException
- if the test is disabledThrowable
- if evaluation of the next statement fails- 另请参阅:
ProfileValueUtils.isTestEnabledInThisEnvironment(Class)
,ProfileValueUtils.isTestEnabledInThisEnvironment(Method, Class)