jdk.testlibrary.TimeLimitedRunner Java Examples

The following examples show how to use jdk.testlibrary.TimeLimitedRunner. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LambdaFormTestCase.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    if (!run.passed) {
        throw new Error(String.format("%d of %d test cases FAILED! %n"
                + "Rerun the test with the same \"-Dseed=\" option as in the log file!",
                run.failCounter, run.testCounter));
    } else {
        System.err.printf("All %d test cases PASSED!%n", run.testCounter);
    }
}
 
Example #2
Source File: LambdaFormTestCase.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    run.checkPassed();
}
 
Example #3
Source File: LambdaFormTestCase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    run.checkPassed();
}
 
Example #4
Source File: LambdaFormTestCase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    run.checkPassed();
}
 
Example #5
Source File: LambdaFormTestCase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    run.checkPassed();
}
 
Example #6
Source File: LambdaFormTestCase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    run.checkPassed();
}
 
Example #7
Source File: LambdaFormTestCase.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    run.checkPassed();
}
 
Example #8
Source File: LambdaFormTestCase.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    run.checkPassed();
}
 
Example #9
Source File: LambdaFormTestCase.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Runs a number of test cases defined by the size of testCases list.
 *
 * @param ctor constructor of LambdaFormCachingTest or its child classes
 * object.
 * @param testMethods list of test methods
 */
public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
    LambdaFormTestCase.TestRun run
            = new LambdaFormTestCase.TestRun(ctor, testMethods);
    TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
    try {
        runner.call();
    } catch (Exception ex) {
        System.err.println("FAILED");
        throw new Error("Unexpected error!", ex);
    }
    run.checkPassed();
}