类 ProfileValueChecker
- java.lang.Object
- org.junit.runners.model.Statement
- org.springframework.test.context.junit4.statements.ProfileValueChecker
public class ProfileValueChecker extends Statement
ProfileValueCheckeris a custom JUnitStatementthat checks whether a test class or test method is enabled in the current environment via Spring's@IfProfileValueannotation.- 从以下版本开始:
- 4.2
- 作者:
- Sam Brannen, Philippe Marschall
- 另请参阅:
evaluate(),IfProfileValue,ProfileValueUtils
构造器概要
构造器 构造器 说明 ProfileValueChecker(Statement next, Class<?> testClass, Method testMethod)Construct a newProfileValueCheckerstatement.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidevaluate()Determine if the test specified by arguments to the constructor is enabled in the current environment, as configured via the@IfProfileValueannotation.
构造器详细资料
ProfileValueChecker
public ProfileValueChecker(Statement next, Class<?> testClass, @Nullable Method testMethod)
Construct a newProfileValueCheckerstatement.- 参数:
next- the nextStatementin the execution chain; nevernulltestClass- the test class to check; nevernulltestMethod- the test method to check; may benullif thisProfileValueCheckeris 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@IfProfileValueannotation.If the test is not annotated with
@IfProfileValueit 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
Statementin 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)