类 AbstractExpressionEvaluatingCondition
java.lang.Object
cn.taketoday.test.context.junit.jupiter.AbstractExpressionEvaluatingCondition
- 所有已实现的接口:
org.junit.jupiter.api.extension.ExecutionCondition,org.junit.jupiter.api.extension.Extension
- 直接已知子类:
DisabledIfCondition,EnabledIfCondition
abstract class AbstractExpressionEvaluatingCondition
extends Object
implements org.junit.jupiter.api.extension.ExecutionCondition
Abstract base class for implementations of
ExecutionCondition that
evaluate expressions configured via annotations to determine if a container
or test is enabled.
Expressions can be any of the following.
- Spring Expression Language (SpEL) expression — for example:
#{systemProperties['os.name'].toLowerCase().contains('mac')} - Placeholder for a property available in the Infra
Environment— for example:${smoke.tests.enabled} - Text literal — for example:
true
- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen, Tadaya Tsuyukubo
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected <A extends Annotation>
org.junit.jupiter.api.extension.ConditionEvaluationResultevaluateAnnotation(Class<A> annotationType, Function<A, String> expressionExtractor, Function<A, String> reasonExtractor, Function<A, Boolean> loadContextExtractor, boolean enabledOnTrue, org.junit.jupiter.api.extension.ExtensionContext context) Evaluate the expression configured via the supplied annotation type on theAnnotatedElementfor the suppliedExtensionContext.private <A extends Annotation>
booleanevaluateExpression(String expression, boolean loadContext, Class<A> annotationType, org.junit.jupiter.api.extension.ExtensionContext context) private static <A extends Annotation>
Optional<A>findMergedAnnotation(AnnotatedElement element, Class<A> annotationType) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.junit.jupiter.api.extension.ExecutionCondition
evaluateExecutionCondition
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger
-
-
构造器详细资料
-
AbstractExpressionEvaluatingCondition
AbstractExpressionEvaluatingCondition()
-
-
方法详细资料
-
evaluateAnnotation
protected <A extends Annotation> org.junit.jupiter.api.extension.ConditionEvaluationResult evaluateAnnotation(Class<A> annotationType, Function<A, String> expressionExtractor, Function<A, String> reasonExtractor, Function<A, Boolean> loadContextExtractor, boolean enabledOnTrue, org.junit.jupiter.api.extension.ExtensionContext context) Evaluate the expression configured via the supplied annotation type on theAnnotatedElementfor the suppliedExtensionContext.- 参数:
annotationType- the type of annotation to processexpressionExtractor- a function that extracts the expression from the annotationreasonExtractor- a function that extracts the reason from the annotationloadContextExtractor- a function that extracts theloadContextflag from the annotationenabledOnTrue- indicates whether the returnedConditionEvaluationResultshould beenabledif the expression evaluates totruecontext- theExtensionContext- 返回:
enabledif the container or test should be enabled; otherwisedisabled
-
evaluateExpression
private <A extends Annotation> boolean evaluateExpression(String expression, boolean loadContext, Class<A> annotationType, org.junit.jupiter.api.extension.ExtensionContext context) -
findMergedAnnotation
private static <A extends Annotation> Optional<A> findMergedAnnotation(AnnotatedElement element, Class<A> annotationType)
-