Package org.spockframework.runtime

Examples of org.spockframework.runtime.SpockTimeoutError


      // act accordingly. We gloss over the fact that some other thread might also have tried to
      // interrupt this thread. This shouldn't be a problem in practice, in particular because
      // throwing an InterruptedException wouldn't abort the whole test run anyway.
      double timeoutSeconds = TimeUtil.toSeconds(timeout.value(), timeout.unit());
      String msg = String.format("Method timed out after %1.2f seconds", timeoutSeconds);
      SpockTimeoutError error = new SpockTimeoutError(timeoutSeconds, msg);
      error.setStackTrace(stackTrace);
      throw error;
    }
    if (saved != null) {
      throw saved;
    }
View Full Code Here


    long pendingEvalBlocks = latch.getCount();
    if (pendingEvalBlocks > 0) {
      String msg = String.format("Async conditions timed out " +
          "after %1.2f seconds; %d out of %d evaluate blocks did not complete in time",
          seconds, pendingEvalBlocks, numEvalBlocks);
      throw new SpockTimeoutError(seconds, msg);
    }
  }
View Full Code Here

   * @throws InterruptedException if the calling thread is interrupted
   */
  public T get() throws InterruptedException {
    if (!valueReady.await((long) (timeout * 1000), TimeUnit.MILLISECONDS)) {
      String msg = String.format("BlockingVariable.get() timed out after %1.2f seconds", timeout);
      throw new SpockTimeoutError(timeout, msg);
    }
    return value;
  }
View Full Code Here

        return;
      } catch (AssertionError e) {
        long elapsedTime = lastAttempt - start;
        if (elapsedTime >= timeoutMillis) {
          String msg = String.format("Condition not satisfied after %1.2f seconds and %d attempts", elapsedTime / 1000d, attempts);
          throw new SpockTimeoutError(seconds, msg, e);
        }
        Thread.sleep(Math.min(currDelay, start + timeoutMillis - System.currentTimeMillis()));
        currDelay *= factor;
      }
    }
View Full Code Here

TOP

Related Classes of org.spockframework.runtime.SpockTimeoutError

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.