类 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
另请参阅:
  • 字段详细资料

    • 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 the AnnotatedElement for the supplied ExtensionContext.
      参数:
      annotationType - the type of annotation to process
      expressionExtractor - a function that extracts the expression from the annotation
      reasonExtractor - a function that extracts the reason from the annotation
      loadContextExtractor - a function that extracts the loadContext flag from the annotation
      enabledOnTrue - indicates whether the returned ConditionEvaluationResult should be enabled if the expression evaluates to true
      context - the ExtensionContext
      返回:
      enabled if the container or test should be enabled; otherwise disabled
    • 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)