Package org.junit.internal.runners.statements

Examples of org.junit.internal.runners.statements.FailOnTimeout.evaluate()


    public void stopEndlessStatement() throws Throwable {
        InfiniteLoopStatement infiniteLoop = new InfiniteLoopStatement();
        FailOnTimeout infiniteLoopTimeout = new FailOnTimeout(infiniteLoop,
                TIMEOUT);
        try {
            infiniteLoopTimeout.evaluate();
        } catch (Exception timeoutException) {
            sleep(20); // time to interrupt the thread
            int firstCount = InfiniteLoopStatement.COUNT;
            sleep(20); // time to increment the count
            assertTrue("Thread has not been stopped.",
View Full Code Here


    @Test
    public void stackTraceContainsRealCauseOfTimeout() throws Throwable {
        StuckStatement stuck = new StuckStatement();
        FailOnTimeout stuckTimeout = new FailOnTimeout(stuck, TIMEOUT);
        try {
            stuckTimeout.evaluate();
            // We must not get here, we expect a timeout exception
            fail("Expected timeout exception");
        } catch (Exception timeoutException) {
            StackTraceElement[] stackTrace = timeoutException.getStackTrace();
            boolean stackTraceContainsTheRealCauseOfTheTimeout = false;
View Full Code Here

  public void stopEndlessStatement() throws Throwable {
    InfiniteLoopStatement infiniteLoop= new InfiniteLoopStatement();
    FailOnTimeout infiniteLoopTimeout= new FailOnTimeout(infiniteLoop,
        TIMEOUT);
    try {
      infiniteLoopTimeout.evaluate();
    } catch (Exception timeoutException) {
      sleep(20); // time to interrupt the thread
      int firstCount= InfiniteLoopStatement.COUNT;
      sleep(20); // time to increment the count
      assertTrue("Thread has not been stopped.",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.