Package org.springframework.test.annotation

Examples of org.springframework.test.annotation.Repeat


   * count or <code>1</code> if no repeat count is configured.
   *
   * @see SpringRepeat
   */
  protected Statement withPotentialRepeat(FrameworkMethod frameworkMethod, Object testInstance, Statement next) {
    Repeat repeatAnnotation = frameworkMethod.getAnnotation(Repeat.class);
    int repeat = (repeatAnnotation != null ? repeatAnnotation.value() : 1);
    return new SpringRepeat(next, frameworkMethod.getMethod(), repeat);
  }
View Full Code Here


    ExpectedException expectedExceptionAnnotation = testMethod.getAnnotation(ExpectedException.class);
    boolean exceptionIsExpected = (expectedExceptionAnnotation != null && expectedExceptionAnnotation.value() != null);
    Class<? extends Throwable> expectedException = (exceptionIsExpected ? expectedExceptionAnnotation.value()
        : null);

    Repeat repeat = testMethod.getAnnotation(Repeat.class);
    int runs = ((repeat != null) && (repeat.value() > 1)) ? repeat.value() : 1;

    for (int i = 0; i < runs; i++) {
      try {
        if (runs > 1 && this.logger.isInfoEnabled()) {
          this.logger.info("Repetition " + (i + 1) + " of test " + testMethod.getName());
View Full Code Here

   * {@link SpringRepeat} statement initialized with the configured repeat
   * count or <code>1</code> if no repeat count is configured.
   * @see SpringRepeat
   */
  protected Statement withPotentialRepeat(FrameworkMethod frameworkMethod, Object testInstance, Statement next) {
    Repeat repeatAnnotation = frameworkMethod.getAnnotation(Repeat.class);
    int repeat = (repeatAnnotation != null ? repeatAnnotation.value() : 1);
    return new SpringRepeat(next, frameworkMethod.getMethod(), repeat);
  }
View Full Code Here

    ExpectedException expectedExceptionAnnotation = testMethod.getAnnotation(ExpectedException.class);
    boolean exceptionIsExpected = (expectedExceptionAnnotation != null && expectedExceptionAnnotation.value() != null);
    Class<? extends Throwable> expectedException = (exceptionIsExpected ? expectedExceptionAnnotation.value()
        : null);

    Repeat repeat = testMethod.getAnnotation(Repeat.class);
    int runs = ((repeat != null) && (repeat.value() > 1)) ? repeat.value() : 1;

    for (int i = 0; i < runs; i++) {
      try {
        if (runs > 1 && this.logger.isInfoEnabled()) {
          this.logger.info("Repetition " + (i + 1) + " of test " + testMethod.getName());
View Full Code Here

   * @param test the runnable test
   * @see Repeat
   */
  protected void runWithRepetitions(Runnable test) {
    Method method = this.testMethod.getMethod();
    Repeat repeat = method.getAnnotation(Repeat.class);
    int runs = (repeat != null && repeat.value() > 1 ? repeat.value() : 1);

    for (int i = 0; i < runs; i++) {
      if (runs > 1 && logger.isInfoEnabled()) {
        logger.info("Repetition " + (i + 1) + " of test " + method.getName());
      }
View Full Code Here

    boolean exceptionIsExpected = (expectedExceptionAnnotation != null &&
        expectedExceptionAnnotation.value() != null);
    Class<? extends Throwable> expectedException =
        (exceptionIsExpected ? expectedExceptionAnnotation.value() : null);

    Repeat repeat = testMethod.getAnnotation(Repeat.class);
    int runs = ((repeat != null) && (repeat.value() > 1)) ? repeat.value() : 1;

    for (int i = 0; i < runs; i++) {
      try {
        if (runs > 1 && this.logger.isInfoEnabled()) {
          this.logger.info("Repetition " + (i + 1) + " of test " + testMethod.getName());
View Full Code Here

   * {@link SpringRepeat} statement initialized with the configured repeat
   * count or {@code 1} if no repeat count is configured.
   * @see SpringRepeat
   */
  protected Statement withPotentialRepeat(FrameworkMethod frameworkMethod, Object testInstance, Statement next) {
    Repeat repeatAnnotation = AnnotationUtils.getAnnotation(frameworkMethod.getMethod(), Repeat.class);
    int repeat = (repeatAnnotation != null ? repeatAnnotation.value() : 1);
    return new SpringRepeat(next, frameworkMethod.getMethod(), repeat);
  }
View Full Code Here

    this.concurrency = concurrency < 0 ? 0 : concurrency;
  }

  public Statement apply(final Statement base, FrameworkMethod method, final Object target) {

    Repeat repeat = AnnotationUtils.findAnnotation(method.getMethod(), Repeat.class);
    if (repeat == null) {
      return base;
    }

    final int repeats = repeat.value();
    if (repeats <= 1) {
      return base;
    }

    initializeIfNecessary(target);
View Full Code Here

TOP

Related Classes of org.springframework.test.annotation.Repeat

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.