public ExtensionRunner createExtensionRunner(SpecInfo spec) { return new ExtensionRunner(spec, globalExtensionRegistry, globalExtensionRegistry); }
private void doRunAnnotationDrivenExtensions(Iterable<MethodInfo> nodes) { for (MethodInfo node : nodes) { doRunAnnotationDrivenExtensions(node); } }
public void run() { runGlobalExtensions(); runAnnotationDrivenExtensions(); }
private void runExtensionsIfNecessary() { if (extensionsRun) return; RunContext.get().createExtensionRunner(getSpec()).run(); extensionsRun = true; }
public void runAnnotationDrivenExtensions(SpecInfo spec) { if (spec == null) return; runAnnotationDrivenExtensions(spec.getSuperSpec()); doRunAnnotationDrivenExtensions(spec); for (FieldInfo field : spec.getFields()) { doRunAnnotationDrivenExtensions(field); } doRunAnnotationDrivenExtensions(spec.getSetupSpecMethods()); doRunAnnotationDrivenExtensions(spec.getSetupMethods()); doRunAnnotationDrivenExtensions(spec.getCleanupMethods()); doRunAnnotationDrivenExtensions(spec.getCleanupSpecMethods()); for (FeatureInfo feature : spec.getFeatures()) { doRunAnnotationDrivenExtensions(feature.getFeatureMethod()); } }
public void runAnnotationDrivenExtensions() { runAnnotationDrivenExtensions(spec); for (IAnnotationDrivenExtension extension : localExtensions.values()) { extension.visitSpec(spec); } }
@SuppressWarnings("unchecked") private void doRunAnnotationDrivenExtensions(NodeInfo<?, ?> node) { for (Annotation ann : node.getAnnotations()) { ExtensionAnnotation extAnn = ann.annotationType().getAnnotation(ExtensionAnnotation.class); if (extAnn == null) continue; IAnnotationDrivenExtension extension = getOrCreateExtension(extAnn.value()); if (node instanceof SpecInfo) { extension.visitSpecAnnotation(ann, (SpecInfo) node); } else if (node instanceof MethodInfo) { MethodInfo method = (MethodInfo) node; if (method.getKind() == MethodKind.FEATURE) { extension.visitFeatureAnnotation(ann, method.getFeature()); } else { extension.visitFixtureAnnotation(ann, method); } } else { extension.visitFieldAnnotation(ann, (FieldInfo) node); } } }
private void runExtensionsIfNecessary() { if (extensionsRun) return; RunContext.get().createExtensionRunner(getSpec()).run(); extensionsRun = true; }
private void runExtensionsIfNecessary() { if (extensionsRun) return; RunContext.get().createExtensionRunner(getSpec()).run(); extensionsRun = true; }