com.pholser.junit.quickcheck.generator.Generator.configure()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中com.pholser.junit.quickcheck.generator.Generator.configure()方法的一些代码示例,展示了Generator.configure()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Generator.configure()方法的具体详情如下:
包路径:com.pholser.junit.quickcheck.generator.Generator
类名称:Generator
方法名:configure

Generator.configure介绍

暂无

代码示例

代码示例来源:origin: pholser/junit-quickcheck

private void configureLenient(
  Class<? extends Annotation> annotationType,
  Annotation configuration) {
  configure(annotationType, configuration, ex -> {});
}

代码示例来源:origin: pholser/junit-quickcheck

@Override
public void configure(AnnotatedElement element) {
  delegate.configure(element);
}

代码示例来源:origin: pholser/junit-quickcheck

@Override public void configure(AnnotatedType annotatedType) {
  super.configure(annotatedType);
  for (int i = 0; i < parameters.length; ++i)
    parameterGenerators.get(i).configure(parameters[i].getAnnotatedType());
}

代码示例来源:origin: pholser/junit-quickcheck

@Override public void configure(AnnotatedType annotatedType) {
  super.configure(annotatedType);
  for (int i = 0; i < fields.size(); ++i)
    fieldGenerators.get(i).configure(fields.get(i).getAnnotatedType());
}

代码示例来源:origin: pholser/junit-quickcheck

@Override public void configure(AnnotatedType annotatedType) {
  super.configure(annotatedType);
  List<AnnotatedType> annotated = annotatedComponentTypes(annotatedType);
  if (!annotated.isEmpty())
    component.configure(annotated.get(0));
}

代码示例来源:origin: pholser/junit-quickcheck

@Override public void configure(AnnotatedType annotatedType) {
  super.configure(annotatedType);
  List<AnnotatedType> annotatedComponentTypes = annotatedComponentTypes(annotatedType);
  if (annotatedComponentTypes.size() == components.size()) {
    for (int i = 0; i < components.size(); ++i)
      components.get(i).configure(annotatedComponentTypes.get(i));
  }
}

代码示例来源:origin: pholser/junit-quickcheck

@Override public void configure(AnnotatedType annotatedType) {
  List<Weighted<Generator<?>>> candidates = new ArrayList<>(composed);
  for (Iterator<Weighted<Generator<?>>> it = candidates.iterator(); it.hasNext();) {
    try {
      it.next().item.configure(annotatedType);
    } catch (GeneratorConfigurationException e) {
      it.remove();
    }
  }
  installCandidates(candidates, annotatedType);
}

代码示例来源:origin: pholser/junit-quickcheck

@Override public void configure(AnnotatedElement element) {
  List<Weighted<Generator<?>>> candidates = new ArrayList<>(composed);
  for (Iterator<Weighted<Generator<?>>> it = candidates.iterator(); it.hasNext();) {
    try {
      it.next().item.configure(element);
    } catch (GeneratorConfigurationException e) {
      it.remove();
    }
  }
  installCandidates(candidates, element);
}

代码示例来源:origin: pholser/junit-quickcheck

@Override
public void configure(AnnotatedType annotatedType) {
  Optional.ofNullable(annotatedType.getAnnotation(NullAllowed.class)).ifPresent(this::configure);
  delegate.configure(annotatedType);
}

代码示例来源:origin: pholser/junit-quickcheck

private void configureStrict(
  Class<? extends Annotation> annotationType,
  Annotation configuration) {
  configure(
    annotationType,
    configuration,
    ex -> {
      throw new GeneratorConfigurationException(
        String.format(
          "Generator %s does not understand configuration annotation %s",
          getClass().getName(),
          annotationType.getName()),
        ex);
    });
}

代码示例来源:origin: pholser/junit-quickcheck

@Override public final <T extends Generator<?>> T make(
  Class<T> genType,
  Generator<?>... components) {
  T generator = instantiate(genType);
  generator.provide(this);
  generator.configure(genType);
  generator.addComponentGenerators(asList(components));
  return generator;
}

代码示例来源:origin: pholser/junit-quickcheck

public Generator<?> produceGenerator(ParameterTypeContext parameter) {
  Generator<?> generator = generatorFor(parameter);
  if (!isPrimitiveType(parameter.annotatedType().getType()) && hasNullableAnnotation(parameter.annotatedElement()))
    generator = new NullableGenerator<>(generator);
  generator.provide(this);
  generator.configure(parameter.annotatedType());
  if (parameter.topLevel())
    generator.configure(parameter.annotatedElement());
  return generator;
}

代码示例来源:origin: com.pholser/junit-quickcheck-core

private void configureLenient(
  Class<? extends Annotation> annotationType,
  Annotation configuration) {
  configure(annotationType, configuration, ex -> {});
}

代码示例来源:origin: com.pholser/junit-quickcheck-core

@Override public void configure(AnnotatedType annotatedType) {
  super.configure(annotatedType);
  for (int i = 0; i < parameters.length; ++i)
    parameterGenerators.get(i).configure(parameters[i].getAnnotatedType());
}

代码示例来源:origin: com.pholser/junit-quickcheck-core

@Override public void configure(AnnotatedType annotatedType) {
  super.configure(annotatedType);
  List<AnnotatedType> annotated = annotatedComponentTypes(annotatedType);
  if (!annotated.isEmpty())
    component.configure(annotated.get(0));
}

代码示例来源:origin: com.pholser/junit-quickcheck-core

@Override public void configure(AnnotatedType annotatedType) {
  super.configure(annotatedType);
  for (int i = 0; i < fields.size(); ++i)
    fieldGenerators.get(i).configure(fields.get(i).getAnnotatedType());
}

代码示例来源:origin: com.pholser/junit-quickcheck-core

@Override public void configure(AnnotatedType annotatedType) {
  super.configure(annotatedType);
  List<AnnotatedType> annotatedComponentTypes = annotatedComponentTypes(annotatedType);
  if (annotatedComponentTypes.size() == components.size()) {
    for (int i = 0; i < components.size(); ++i)
      components.get(i).configure(annotatedComponentTypes.get(i));
  }
}

代码示例来源:origin: com.pholser/junit-quickcheck-core

@Override public void configure(AnnotatedElement element) {
  List<Weighted<Generator<?>>> candidates = new ArrayList<>(composed);
  for (Iterator<Weighted<Generator<?>>> it = candidates.iterator(); it.hasNext();) {
    try {
      it.next().item.configure(element);
    } catch (GeneratorConfigurationException e) {
      it.remove();
    }
  }
  installCandidates(candidates, element);
}

代码示例来源:origin: com.pholser/junit-quickcheck-core

public Generator<?> produceGenerator(ParameterTypeContext parameter) {
  Generator<?> generator = generatorFor(parameter);
  generator.provide(this);
  generator.configure(parameter.annotatedType());
  if (parameter.topLevel())
    generator.configure(parameter.annotatedElement());
  return generator;
}

代码示例来源:origin: edu.berkeley.cs.jqf/jqf-fuzz

private Generator<?> produceGenerator(ParameterTypeContext parameter) {
    Generator<?> generator = generatorRepository.generatorFor(parameter);
    generator.provide(generatorRepository);
    generator.configure(parameter.annotatedType());
    return generator;
  }
}

相关文章