Java Code Examples for com.oracle.testlibrary.jsr292.Helper#IS_THOROUGH

The following examples show how to use com.oracle.testlibrary.jsr292.Helper#IS_THOROUGH . 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: CatchExceptionTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private CatchExceptionTest createTest() {
    if (!Helper.IS_THOROUGH) {
        return new CatchExceptionTest(
                TestCase.CONSTRUCTORS.get(constructor++).get(),
                Helper.RNG.nextBoolean(), args, dropArgs);
    } else {
        if (isVararg) {
            isVararg = false;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor++).get(),
                    isVararg, args, dropArgs);
        } else {
            isVararg = true;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor).get(),
                    isVararg, args, dropArgs);
        }
    }
}
 
Example 2
Source File: CatchExceptionTest.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private CatchExceptionTest createTest() {
    if (!Helper.IS_THOROUGH) {
        return new CatchExceptionTest(
                TestCase.CONSTRUCTORS.get(constructor++).get(),
                Helper.RNG.nextBoolean(), args, dropArgs);
    } else {
        if (isVararg) {
            isVararg = false;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor++).get(),
                    isVararg, args, dropArgs);
        } else {
            isVararg = true;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor).get(),
                    isVararg, args, dropArgs);
        }
    }
}
 
Example 3
Source File: CatchExceptionTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public TestFactory() {
    if (Helper.IS_THOROUGH) {
        maxArgs = maxDrops = CatchExceptionTest.MAX_ARITY;
    } else {
        maxArgs = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(CatchExceptionTest.MAX_ARITY
                        - MIN_TESTED_ARITY)
                + 1;
        maxDrops = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(maxArgs - MIN_TESTED_ARITY)
                + 1;
        args = 1;
    }

    System.out.printf("maxArgs = %d%nmaxDrops = %d%n", maxArgs, maxDrops);
    constructorSize = TestCase.CONSTRUCTORS.size();
}
 
Example 4
Source File: CatchExceptionTest.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public TestFactory() {
    if (Helper.IS_THOROUGH) {
        maxArgs = maxDrops = CatchExceptionTest.MAX_ARITY;
    } else {
        maxArgs = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(CatchExceptionTest.MAX_ARITY
                        - MIN_TESTED_ARITY)
                + 1;
        maxDrops = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(maxArgs - MIN_TESTED_ARITY)
                + 1;
        args = 1;
    }

    System.out.printf("maxArgs = %d%nmaxDrops = %d%n", maxArgs, maxDrops);
    constructorSize = TestCase.CONSTRUCTORS.size();
}
 
Example 5
Source File: CatchExceptionTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private CatchExceptionTest createTest() {
    if (!Helper.IS_THOROUGH) {
        return new CatchExceptionTest(
                TestCase.CONSTRUCTORS.get(constructor++).get(),
                Helper.RNG.nextBoolean(), args, dropArgs);
    } else {
       if (isVararg) {
           isVararg = false;
           return new CatchExceptionTest(
                   TestCase.CONSTRUCTORS.get(constructor++).get(),
                   isVararg, args, dropArgs);
       } else {
           isVararg = true;
           return new CatchExceptionTest(
                   TestCase.CONSTRUCTORS.get(constructor).get(),
                   isVararg, args, dropArgs);
       }
    }
}
 
Example 6
Source File: CatchExceptionTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private CatchExceptionTest createTest() {
    if (!Helper.IS_THOROUGH) {
        return new CatchExceptionTest(
                TestCase.CONSTRUCTORS.get(constructor++).get(),
                Helper.RNG.nextBoolean(), args, dropArgs);
    } else {
       if (isVararg) {
           isVararg = false;
           return new CatchExceptionTest(
                   TestCase.CONSTRUCTORS.get(constructor++).get(),
                   isVararg, args, dropArgs);
       } else {
           isVararg = true;
           return new CatchExceptionTest(
                   TestCase.CONSTRUCTORS.get(constructor).get(),
                   isVararg, args, dropArgs);
       }
    }
}
 
Example 7
Source File: CatchExceptionTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public TestFactory() {
    if (Helper.IS_THOROUGH) {
        maxArgs = maxDrops = CatchExceptionTest.MAX_ARITY;
    } else {
        maxArgs = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(CatchExceptionTest.MAX_ARITY
                        - MIN_TESTED_ARITY)
                + 1;
        maxDrops = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(maxArgs - MIN_TESTED_ARITY)
                + 1;
        args = 1;
    }

    if (Helper.IS_VERBOSE) {
        System.out.printf("maxArgs = %d%nmaxDrops = %d%n",
                maxArgs, maxDrops);
    }
    constructorSize = TestCase.CONSTRUCTORS.size();
}
 
Example 8
Source File: CatchExceptionTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public TestFactory() {
    if (Helper.IS_THOROUGH) {
        maxArgs = maxDrops = CatchExceptionTest.MAX_ARITY;
    } else {
        maxArgs = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(CatchExceptionTest.MAX_ARITY
                        - MIN_TESTED_ARITY)
                + 1;
        maxDrops = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(maxArgs - MIN_TESTED_ARITY)
                + 1;
        args = 1;
    }

    System.out.printf("maxArgs = %d%nmaxDrops = %d%n", maxArgs, maxDrops);
    constructorSize = TestCase.CONSTRUCTORS.size();
}
 
Example 9
Source File: CatchExceptionTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public TestFactory() {
    if (Helper.IS_THOROUGH) {
        maxArgs = maxDrops = CatchExceptionTest.MAX_ARITY;
    } else {
        maxArgs = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(CatchExceptionTest.MAX_ARITY
                        - MIN_TESTED_ARITY)
                + 1;
        maxDrops = MIN_TESTED_ARITY
                + Helper.RNG.nextInt(maxArgs - MIN_TESTED_ARITY)
                + 1;
        args = 1;
    }

    System.out.printf("maxArgs = %d%nmaxDrops = %d%n", maxArgs, maxDrops);
    constructorSize = TestCase.CONSTRUCTORS.size();
}
 
Example 10
Source File: CatchExceptionTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private CatchExceptionTest createTest() {
    if (!Helper.IS_THOROUGH) {
        return new CatchExceptionTest(
                TestCase.CONSTRUCTORS.get(constructor++).get(),
                Helper.RNG.nextBoolean(), args, dropArgs);
    } else {
        if (isVararg) {
            isVararg = false;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor++).get(),
                    isVararg, args, dropArgs);
        } else {
            isVararg = true;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor).get(),
                    isVararg, args, dropArgs);
        }
    }
}
 
Example 11
Source File: CatchExceptionTest.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private CatchExceptionTest createTest() {
    if (!Helper.IS_THOROUGH) {
        return new CatchExceptionTest(
                TestCase.CONSTRUCTORS.get(constructor++).get(),
                Helper.RNG.nextBoolean(), args, dropArgs);
    } else {
        if (isVararg) {
            isVararg = false;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor++).get(),
                    isVararg, args, dropArgs);
        } else {
            isVararg = true;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor).get(),
                    isVararg, args, dropArgs);
        }
    }
}
 
Example 12
Source File: CatchExceptionTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private CatchExceptionTest createTest() {
    if (!Helper.IS_THOROUGH) {
        return new CatchExceptionTest(
                TestCase.CONSTRUCTORS.get(constructor++).get(),
                Helper.RNG.nextBoolean(), args, dropArgs);
    } else {
        if (isVararg) {
            isVararg = false;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor++).get(),
                    isVararg, args, dropArgs);
        } else {
            isVararg = true;
            return new CatchExceptionTest(
                    TestCase.CONSTRUCTORS.get(constructor).get(),
                    isVararg, args, dropArgs);
        }
    }
}
 
Example 13
Source File: CatchExceptionTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return next test from test matrix: {varArgs, noVarArgs} x
 * TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x
 * {0, .., maxDrops}
 */
public CatchExceptionTest nextTest() {
    if (constructor < constructorSize) {
        return createTest();
    }
    constructor = 0;
    count++;
    if (!Helper.IS_THOROUGH && count > Helper.TEST_LIMIT) {
        System.out.println("test limit is exceeded");
        return null;
    }
    if (dropArgs <= currentMaxDrops) {
        if (dropArgs == 0) {
            if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
                ++dropArgs;
                return createTest();
            } else if (Helper.IS_VERBOSE) {
                System.out.printf(
                        "argsCount=%d : \"drop\" scenarios are skipped%n",
                        args);
            }
        } else {
            ++dropArgs;
            return createTest();
        }
    }

    if (args < maxArgs) {
        dropArgs = 0;
        currentMaxDrops = Math.min(args, maxDrops);
        ++args;
        return createTest();
    }
    return null;
}
 
Example 14
Source File: CatchExceptionTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return next test from test matrix: {varArgs, noVarArgs} x
 * TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x
 * {0, .., maxDrops}
 */
public CatchExceptionTest nextTest() {
    if (constructor < constructorSize) {
        return createTest();
    }
    constructor = 0;
    count++;
    if (!Helper.IS_THOROUGH && count > Helper.TEST_LIMIT) {
        System.out.println("test limit is exceeded");
        return null;
    }
    if (dropArgs <= currentMaxDrops) {
        if (dropArgs == 0) {
            if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
                ++dropArgs;
                return createTest();
            } else if (Helper.IS_VERBOSE) {
                System.out.printf(
                        "argsCount=%d : \"drop\" scenarios are skipped%n",
                        args);
            }
        } else {
            ++dropArgs;
            return createTest();
        }
    }

    if (args < maxArgs) {
        dropArgs = 0;
        currentMaxDrops = Math.min(args, maxDrops);
        ++args;
        return createTest();
    }
    return null;
}
 
Example 15
Source File: CatchExceptionTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return next test from test matrix: {varArgs, noVarArgs} x
 * TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x
 * {0, .., maxDrops}
 */
public CatchExceptionTest nextTest() {
    if (constructor < constructorSize) {
        return createTest();
    }
    constructor = 0;
    count++;
    if (!Helper.IS_THOROUGH && count > Helper.TEST_LIMIT) {
        System.out.println("test limit is exceeded");
        return null;
    }
    if (dropArgs <= currentMaxDrops) {
        if (dropArgs == 0) {
            if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
                ++dropArgs;
                return createTest();
            } else if (Helper.IS_VERBOSE) {
                System.out.printf(
                        "argsCount=%d : \"drop\" scenarios are skipped%n",
                        args);
            }
        } else {
            ++dropArgs;
            return createTest();
        }
    }

    if (args < maxArgs) {
        dropArgs = 0;
        currentMaxDrops = Math.min(args, maxDrops);
        ++args;
        return createTest();
    }
    return null;
}
 
Example 16
Source File: CatchExceptionTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return next test from test matrix:
 * {varArgs, noVarArgs} x TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x {1, .., maxDrops}
 */
public CatchExceptionTest nextTest() {
    if (constructor < constructorSize) {
        return createTest();
    }
    constructor = 0;
    count++;
    if (!Helper.IS_THOROUGH && count > Helper.TEST_LIMIT) {
        System.out.println("test limit is exceeded");
        return null;
    }
    if (dropArgs <= currentMaxDrops) {
        if (dropArgs == 1) {
            if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
                ++dropArgs;
                return createTest();
            } else if (Helper.IS_VERBOSE) {
                System.out.printf(
                        "argsCount=%d : \"drop\" scenarios are skipped%n",
                        args);
            }
        } else {
            ++dropArgs;
            return createTest();
        }
    }

    if (args <= maxArgs) {
        dropArgs = 1;
        currentMaxDrops = Math.min(args, maxDrops);
        ++args;
        return createTest();
    }
    return null;
}
 
Example 17
Source File: CatchExceptionTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return next test from test matrix: {varArgs, noVarArgs} x
 * TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x
 * {0, .., maxDrops}
 */
public CatchExceptionTest nextTest() {
    if (constructor < constructorSize) {
        return createTest();
    }
    constructor = 0;
    count++;
    if (!Helper.IS_THOROUGH && count > Helper.TEST_LIMIT) {
        System.out.println("test limit is exceeded");
        return null;
    }
    if (dropArgs <= currentMaxDrops) {
        if (dropArgs == 0) {
            if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
                ++dropArgs;
                return createTest();
            } else if (Helper.IS_VERBOSE) {
                System.out.printf(
                        "argsCount=%d : \"drop\" scenarios are skipped%n",
                        args);
            }
        } else {
            ++dropArgs;
            return createTest();
        }
    }

    if (args < maxArgs) {
        dropArgs = 0;
        currentMaxDrops = Math.min(args, maxDrops);
        ++args;
        return createTest();
    }
    return null;
}
 
Example 18
Source File: CatchExceptionTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return next test from test matrix:
 * {varArgs, noVarArgs} x TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x {1, .., maxDrops}
 */
public CatchExceptionTest nextTest() {
    if (constructor < constructorSize) {
        return createTest();
    }
    constructor = 0;
    count++;
    if (!Helper.IS_THOROUGH && count > Helper.TEST_LIMIT) {
        System.out.println("test limit is exceeded");
        return null;
    }
    if (dropArgs <= currentMaxDrops) {
        if (dropArgs == 1) {
            if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
                ++dropArgs;
                return createTest();
            } else if (Helper.IS_VERBOSE) {
                System.out.printf(
                        "argsCount=%d : \"drop\" scenarios are skipped%n",
                        args);
            }
        } else {
            ++dropArgs;
            return createTest();
        }
    }

    if (args <= maxArgs) {
        dropArgs = 1;
        currentMaxDrops = Math.min(args, maxDrops);
        ++args;
        return createTest();
    }
    return null;
}
 
Example 19
Source File: CatchExceptionTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return next test from test matrix: {varArgs, noVarArgs} x
 * TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x
 * {0, .., maxDrops}
 */
public CatchExceptionTest nextTest() {
    if (constructor < constructorSize) {
        return createTest();
    }
    constructor = 0;
    count++;
    if (!Helper.IS_THOROUGH && count > Helper.TEST_LIMIT) {
        System.out.println("test limit is exceeded");
        return null;
    }
    if (dropArgs <= currentMaxDrops) {
        if (dropArgs == 0) {
            if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
                ++dropArgs;
                return createTest();
            } else if (Helper.IS_VERBOSE) {
                System.out.printf(
                        "argsCount=%d : \"drop\" scenarios are skipped%n",
                        args);
            }
        } else {
            ++dropArgs;
            return createTest();
        }
    }

    if (args < maxArgs) {
        dropArgs = 0;
        currentMaxDrops = Math.min(args, maxDrops);
        ++args;
        return createTest();
    }
    return null;
}
 
Example 20
Source File: CatchExceptionTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return next test from test matrix: {varArgs, noVarArgs} x
 * TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x
 * {0, .., maxDrops}
 */
public CatchExceptionTest nextTest() {
    if (constructor < constructorSize) {
        return createTest();
    }
    constructor = 0;
    count++;
    if (!Helper.IS_THOROUGH && count > Helper.TEST_LIMIT) {
        System.out.println("test limit is exceeded");
        return null;
    }
    if (dropArgs <= currentMaxDrops) {
        if (dropArgs == 0) {
            if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
                ++dropArgs;
                return createTest();
            } else if (Helper.IS_VERBOSE) {
                System.out.printf(
                        "argsCount=%d : \"drop\" scenarios are skipped%n",
                        args);
            }
        } else {
            ++dropArgs;
            return createTest();
        }
    }

    if (args < maxArgs) {
        dropArgs = 0;
        currentMaxDrops = Math.min(args, maxDrops);
        ++args;
        return createTest();
    }
    return null;
}