Package org.spockframework.runtime

Examples of org.spockframework.runtime.InvalidSpecException


    return ruleClass != null && ruleClass.isAssignableFrom(field.getType());
  }

  protected void invalidFieldType(FieldInfo field) {
    if (field.getType() == Object.class) {
      throw new InvalidSpecException("@Rule field '%s' does not have a declared type. Please add a type declaration.").withArgs(field.getName());
    }
    throw new InvalidSpecException("The declared type of @Rule field '%s' does not appear to be a rule type.").withArgs(field.getName());
  }
View Full Code Here


*
* @author Peter Niederwieser
*/
public abstract class AbstractAnnotationDrivenExtension<T extends Annotation> implements IAnnotationDrivenExtension<T> {
  public void visitSpecAnnotation(T annotation, SpecInfo spec) {
    throw new InvalidSpecException("@%s may not be applied to Specs")
        .withArgs(annotation.annotationType().getSimpleName());
  }
View Full Code Here

    throw new InvalidSpecException("@%s may not be applied to Specs")
        .withArgs(annotation.annotationType().getSimpleName());
  }

  public void visitFeatureAnnotation(T annotation, FeatureInfo feature) {
    throw new InvalidSpecException("@%s may not be applied to feature methods")
        .withArgs(annotation.annotationType().getSimpleName());
  }
View Full Code Here

    throw new InvalidSpecException("@%s may not be applied to feature methods")
        .withArgs(annotation.annotationType().getSimpleName());
  }

  public void visitFixtureAnnotation(T annotation, MethodInfo fixtureMethod) {
    throw new InvalidSpecException("@%s may not be applied to fixture methods")
        .withArgs(annotation.annotationType().getSimpleName());
  }
View Full Code Here

    throw new InvalidSpecException("@%s may not be applied to fixture methods")
        .withArgs(annotation.annotationType().getSimpleName());
  }

  public void visitFieldAnnotation(T annotation, FieldInfo field) {
    throw new InvalidSpecException("@%s may not be applied to fields")
        .withArgs(annotation.annotationType().getSimpleName());
  }
View Full Code Here

TOP

Related Classes of org.spockframework.runtime.InvalidSpecException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.