当前位置: 首页>>代码示例>>Java>>正文


Java Helper.IS_VERBOSE属性代码示例

本文整理汇总了Java中com.oracle.testlibrary.jsr292.Helper.IS_VERBOSE属性的典型用法代码示例。如果您正苦于以下问题:Java Helper.IS_VERBOSE属性的具体用法?Java Helper.IS_VERBOSE怎么用?Java Helper.IS_VERBOSE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.oracle.testlibrary.jsr292.Helper的用法示例。


在下文中一共展示了Helper.IS_VERBOSE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TestFactory

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();
}
 
开发者ID:infobip,项目名称:infobip-open-jdk-8,代码行数:20,代码来源:CatchExceptionTest.java

示例2: nextTest

/**
 * @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;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:39,代码来源:CatchExceptionTest.java

示例3: nextTest

/**
 * @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;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:38,代码来源:CatchExceptionTest.java

示例4: CatchExceptionTest

public CatchExceptionTest(TestCase testCase, final boolean isVararg, final int argsCount,
        final int catchDrops) {
    this.testCase = testCase;
    this.dropped = catchDrops;
    if (Helper.IS_VERBOSE) {
        System.out.printf("CatchException::CatchException(%s, isVararg=%b " +
                        "argsCount=%d catchDrops=%d)%n",
                testCase, isVararg, argsCount, catchDrops
        );
    }
    MethodHandle thrower = testCase.thrower;
    int throwerLen = thrower.type().parameterCount();
    List<Class<?>> classes;
    int extra = Math.max(0, argsCount - throwerLen);
    classes = getThrowerParams(isVararg, extra);
    this.argsCount = throwerLen + classes.size();
    thrower = Helper.addTrailingArgs(thrower, this.argsCount, classes);
    if (isVararg && argsCount > throwerLen) {
        MethodType mt = thrower.type();
        Class<?> lastParam = mt.parameterType(mt.parameterCount() - 1);
        thrower = thrower.asVarargsCollector(lastParam);
    }
    this.thrower = thrower;
    this.dropped = Math.min(this.argsCount, catchDrops);
    catcher = testCase.getCatcher(getCatcherParams());
    nargs = Math.max(2, this.argsCount);
}
 
开发者ID:infobip,项目名称:infobip-open-jdk-8,代码行数:27,代码来源:CatchExceptionTest.java

示例5: nextTest

/**
 * @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;
}
 
开发者ID:infobip,项目名称:infobip-open-jdk-8,代码行数:38,代码来源:CatchExceptionTest.java

示例6: runTest

private void runTest() {
    if (Helper.IS_VERBOSE) {
        System.out.printf("CatchException(%s, isVararg=%b argsCount=%d "
                + "dropped=%d)%n",
                testCase, thrower.isVarargsCollector(),
                argsCount, dropped);
    }

    Helper.clear();

    Object[] args = Helper.randomArgs(
            argsCount, thrower.type().parameterArray());
    Object arg0 = Helper.MISSING_ARG;
    Object arg1 = testCase.thrown;
    if (argsCount > 0) {
        arg0 = args[0];
    }
    if (argsCount > 1) {
        args[1] = arg1;
    }
    Asserts.assertEQ(nargs, thrower.type().parameterCount());
    if (argsCount < nargs) {
        Object[] appendArgs = {arg0, arg1};
        appendArgs = Arrays.copyOfRange(appendArgs, argsCount, nargs);
        thrower = MethodHandles.insertArguments(
                thrower, argsCount, appendArgs);
    }
    Asserts.assertEQ(argsCount, thrower.type().parameterCount());

    MethodHandle target = MethodHandles.catchException(
            testCase.filter(thrower), testCase.throwableClass,
            testCase.filter(catcher));

    Asserts.assertEQ(thrower.type(), target.type());
    Asserts.assertEQ(argsCount, target.type().parameterCount());

    Object returned;
    try {
        returned = target.invokeWithArguments(args);
    } catch (Throwable ex) {
        if (CodeCacheOverflowProcessor.isThrowableCausedByVME(ex)) {
            // This error will be treated by CodeCacheOverflowProcessor
            // to prevent the test from failing because of code cache overflow.
            throw new Error(ex);
        }
        testCase.assertCatch(ex);
        returned = ex;
    }

    testCase.assertReturn(returned, arg0, arg1, dropped, args);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:51,代码来源:CatchExceptionTest.java

示例7: runTest

private void runTest() {
    if (Helper.IS_VERBOSE) {
        System.out.printf("CatchException(%s, isVararg=%b argsCount=%d " +
                        "dropped=%d)%n",
                testCase, thrower.isVarargsCollector(), argsCount, dropped);
    }

    Helper.clear();

    Object[] args = Helper.randomArgs(
            argsCount, thrower.type().parameterArray());
    Object arg0 = Helper.MISSING_ARG;
    Object arg1 = testCase.thrown;
    if (argsCount > 0) {
        arg0 = args[0];
    }
    if (argsCount > 1) {
        args[1] = arg1;
    }
    Asserts.assertEQ(nargs, thrower.type().parameterCount());
    if (argsCount < nargs) {
        Object[] appendArgs = {arg0, arg1};
        appendArgs = Arrays.copyOfRange(appendArgs, argsCount, nargs);
        thrower = MethodHandles.insertArguments(
                thrower, argsCount, appendArgs);
    }
    Asserts.assertEQ(argsCount, thrower.type().parameterCount());

    MethodHandle target = MethodHandles.catchException(
            testCase.filter(thrower), testCase.throwableClass,
            testCase.filter(catcher));

    Asserts.assertEQ(thrower.type(), target.type());
    Asserts.assertEQ(argsCount, target.type().parameterCount());

    Object returned;
    try {
        returned = target.invokeWithArguments(args);
    } catch (Throwable ex) {
        if (CodeCacheOverflowProcessor.isThrowableCausedByVME(ex)) {
            // This error will be treated by CodeCacheOverflowProcessor
            // to prevent the test from failing because of code cache overflow.
            throw new Error(ex);
        }
        testCase.assertCatch(ex);
        returned = ex;
    }

    testCase.assertReturn(returned, arg0, arg1, dropped, args);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:50,代码来源:CatchExceptionTest.java


注:本文中的com.oracle.testlibrary.jsr292.Helper.IS_VERBOSE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。