Java 类org.junit.platform.commons.support.AnnotationSupport 实例源码

项目:junit5-conditional-execution-extensions    文件:DisabledOnJava8Condition.java   
@Override
public ConditionEvaluationResult evaluateExecutionCondition(final ExtensionContext context) {
  return context.getElement()
         .flatMap(annotatedElement -> AnnotationSupport.findAnnotation(annotatedElement, DisabledOnJava8.class))
         .map(annotation -> evaluatedIfJava8())
         .orElse(DEFAULT);
}
项目:junit5-conditional-execution-extensions    文件:DisabledOnJava9Condition.java   
@Override
public ConditionEvaluationResult evaluateExecutionCondition(final ExtensionContext context) {
  return context.getElement()
                .flatMap(annotatedElement -> AnnotationSupport.findAnnotation(annotatedElement, DisabledOnJava9.class))
                .map(annotation -> evaluatedIfJava8())
                .orElse(DEFAULT);
}
项目:jqwik    文件:PropertyMethodResolver.java   
private TestDescriptor createTestDescriptor(UniqueId uniqueId, Class<?> testClass, Method method) {
    Property property = AnnotationSupport.findAnnotation(method, Property.class).orElseThrow(() -> {
        String message = String.format("Method [%s] is not annotated with @Property", method);
        return new JqwikException(message);
    });
    long seed = determineSeed(uniqueId, property.seed());
    PropertyConfiguration propertyConfig = PropertyConfiguration.from(property, propertyDefaultValues).withSeed(seed);
    return new PropertyMethodDescriptor(uniqueId, method, testClass, propertyConfig);
}
项目:junit-dataprovider    文件:AbstractDataProviderInvocationContextProvider.java   
@Override
public boolean supportsTestTemplate(ExtensionContext context) {
    return context.getTestMethod().filter(m -> AnnotationSupport.isAnnotated(m, testAnnotationClass)).isPresent();
}