Tabnine Logo
org.junit.runners.model
Code IndexAdd Tabnine to your IDE (free)

How to use org.junit.runners.model

Best Java code snippets using org.junit.runners.model (Showing top 20 results out of 4,761)

origin: org.mockito/mockito-core

  private Throwable evaluateSafely(Statement base) {
    try {
      base.evaluate();
      return null;
    } catch (Throwable throwable) {
      return throwable;
    }
  }
};
origin: google/j2objc

  @Override
  public void evaluate() throws Throwable {
    for (FrameworkMethod before : fBefores) {
      before.invokeExplosively(fTarget);
    }
    fNext.evaluate();
  }
}
origin: junit-team/junit4

  /**
   * @since 4.13
   */
  protected void invokeMethod(FrameworkMethod method) throws Throwable {
    method.invokeExplosively(target);
  }
}
origin: spring-projects/spring-framework

/**
 * Return {@code true} if {@link Ignore @Ignore} is present for the supplied
 * {@linkplain FrameworkMethod test method} or if the test method is disabled
 * via {@code @IfProfileValue}.
 * @see ProfileValueUtils#isTestEnabledInThisEnvironment(Method, Class)
 */
protected boolean isTestMethodIgnored(FrameworkMethod frameworkMethod) {
  Method method = frameworkMethod.getMethod();
  return (method.isAnnotationPresent(Ignore.class) ||
      !ProfileValueUtils.isTestEnabledInThisEnvironment(method, getTestClass().getJavaClass()));
}
origin: junit-team/junit4

/**
 * Returns the name that describes {@code method} for {@link Description}s.
 * Default implementation is the method's name
 */
protected String testName(FrameworkMethod method) {
  return method.getName();
}
origin: spring-projects/spring-framework

/**
 * Wrap the supplied {@link Statement} with a {@code SpringRepeat} statement.
 * <p>Supports Spring's {@link org.springframework.test.annotation.Repeat @Repeat}
 * annotation.
 * @see TestAnnotationUtils#getRepeatCount(Method)
 * @see SpringRepeat
 */
protected Statement withPotentialRepeat(FrameworkMethod frameworkMethod, Object testInstance, Statement next) {
  return new SpringRepeat(next, frameworkMethod.getMethod());
}
origin: junit-team/junit4

/**
 * Evaluates whether {@link FrameworkMethod}s are ignored based on the
 * {@link Ignore} annotation.
 */
@Override
protected boolean isIgnored(FrameworkMethod child) {
  return child.getAnnotation(Ignore.class) != null;
}
origin: junit-team/junit4

@Override
Iterable<FrameworkMethod> getAnnotatablesForTestClass(
    TestClass testClass) {
  return testClass.getAnnotatedMethods();
}
origin: junit-team/junit4

protected void scanAnnotatedMembers(Map<Class<? extends Annotation>, List<FrameworkMethod>> methodsForAnnotations, Map<Class<? extends Annotation>, List<FrameworkField>> fieldsForAnnotations) {
  for (Class<?> eachClass : getSuperClasses(clazz)) {
    for (Method eachMethod : MethodSorter.getDeclaredMethods(eachClass)) {
      addToAnnotationLists(new FrameworkMethod(eachMethod), methodsForAnnotations);
    }
    // ensuring fields are sorted to make sure that entries are inserted
    // and read from fieldForAnnotations in a deterministic order
    for (Field eachField : getSortedDeclaredFields(eachClass)) {
      addToAnnotationLists(new FrameworkField(eachField), fieldsForAnnotations);
    }
  }
}
origin: junit-team/junit4

  /**
   * Constructs a new instance of the default runner
   */
  public JUnit4(Class<?> klass) throws InitializationError {
    super(new TestClass(klass));
  }
}
origin: junit-team/junit4

/**
 * Returns, efficiently, all the non-overridden fields in this class and its
 * superclasses that are annotated.
 * 
 * @since 4.12
 */
public List<FrameworkField> getAnnotatedFields() {
  return collectValues(fieldsForAnnotations);
}
origin: spring-projects/spring-framework

  @Override
  public void evaluate() throws Throwable {
    try {
      this.next.evaluate();
    }
    finally {
      testContextManagerCache.remove(this.testClass);
    }
  }
}
origin: spring-projects/spring-framework

/**
 * Retrieve the configured Spring-specific {@code timeout} from the
 * {@link org.springframework.test.annotation.Timed @Timed} annotation
 * on the supplied {@linkplain FrameworkMethod test method}.
 * @return the timeout, or {@code 0} if none was specified
 * @see TestAnnotationUtils#getTimeout(Method)
 */
protected long getSpringTimeout(FrameworkMethod frameworkMethod) {
  return TestAnnotationUtils.getTimeout(frameworkMethod.getMethod());
}
origin: spring-projects/spring-framework

/**
 * Retrieve the configured JUnit {@code timeout} from the {@link Test @Test}
 * annotation on the supplied {@linkplain FrameworkMethod test method}.
 * @return the timeout, or {@code 0} if none was specified
 */
protected long getJUnitTimeout(FrameworkMethod frameworkMethod) {
  Test test = frameworkMethod.getAnnotation(Test.class);
  return (test != null && test.timeout() > 0 ? test.timeout() : 0);
}
origin: junit-team/junit4

  /**
   * @since 4.13
   */
  protected void invokeMethod(FrameworkMethod method) throws Throwable {
    method.invokeExplosively(target);
  }
}
origin: square/okhttp

 @Override public void evaluate() throws Throwable {
  base.evaluate();
  ensureResourcesClosed();
 }
};
origin: spring-projects/spring-framework

/**
 * Invoke {@link TestContextManager#beforeTestMethod(Object, Method)}
 * and then evaluate the next {@link Statement} in the execution chain
 * (typically an instance of
 * {@link org.junit.internal.runners.statements.RunBefores RunBefores}).
 */
@Override
public void evaluate() throws Throwable {
  this.testContextManager.beforeTestMethod(this.testInstance, this.testMethod);
  this.next.evaluate();
}
origin: spring-projects/spring-framework

/**
 * Invoke {@link TestContextManager#beforeTestExecution(Object, Method)}
 * and then evaluate the next {@link Statement} in the execution chain
 * (typically an instance of
 * {@link org.junit.internal.runners.statements.InvokeMethod InvokeMethod}).
 */
@Override
public void evaluate() throws Throwable {
  this.testContextManager.beforeTestExecution(this.testInstance, this.testMethod);
  this.next.evaluate();
}
origin: spring-projects/spring-framework

/**
 * Invoke {@link TestContextManager#prepareTestInstance(Object)} and
 * then evaluate the next {@link Statement} in the execution chain
 * (typically an instance of {@link RunAfterTestMethodCallbacks}).
 */
@Override
public void evaluate() throws Throwable {
  this.testContextManager.prepareTestInstance(this.testInstance);
  this.next.evaluate();
}
origin: spring-projects/spring-framework

/**
 * Invoke {@link TestContextManager#beforeTestClass()} and then evaluate
 * the next {@link Statement} in the execution chain (typically an instance
 * of {@link org.junit.internal.runners.statements.RunBefores RunBefores}).
 */
@Override
public void evaluate() throws Throwable {
  this.testContextManager.beforeTestClass();
  this.next.evaluate();
}
org.junit.runners.model

Most used classes

  • Statement
    Represents one or more actions to be taken at runtime in the course of running a JUnit test suite.
  • FrameworkMethod
    Represents a method on a test class to be invoked at the appropriate point in test execution. These
  • TestClass
    Wraps a class to be run, providing method validation and annotation searching
  • InitializationError
    Represents one or more problems encountered while initializing a Runner
  • MultipleFailureException
    Collects multiple Throwables into one exception.
  • RunnerBuilder,
  • RunnerScheduler,
  • FrameworkMember,
  • FrameworkMethod$1,
  • NoGenericTypeParametersValidator,
  • TestTimedOutException,
  • Annotatable,
  • ClassReader,
  • InvalidTestClassError,
  • JUnitQuickcheckTestClass,
  • MemberValueConsumer,
  • TestClassUtil$MyClassVisitor,
  • TestClassUtil
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now