Java Code Examples for jdk.testlibrary.Utils#filterException()

The following examples show how to use jdk.testlibrary.Utils#filterException() . 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: CodeCacheOverflowProcessor.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
        t.printStackTrace();
    }
    return t;
}
 
Example 2
Source File: CodeCacheOverflowProcessor.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
        t.printStackTrace();
    }
    return t;
}
 
Example 3
Source File: CodeCacheOverflowProcessor.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
        t.printStackTrace();
    }
    return t;
}
 
Example 4
Source File: CodeCacheOverflowProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
        t.printStackTrace();
    }
    return t;
}
 
Example 5
Source File: CodeCacheOverflowProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
        t.printStackTrace();
    }
    return t;
}
 
Example 6
Source File: CodeCacheOverflowProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
    }
    return t;
}
 
Example 7
Source File: CodeCacheOverflowProcessor.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
        t.printStackTrace();
    }
    return t;
}
 
Example 8
Source File: CodeCacheOverflowProcessor.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
        t.printStackTrace();
    }
    return t;
}
 
Example 9
Source File: CodeCacheOverflowProcessor.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks if the given test throws an exception caused by
 * VirtualMachineError with message "Out of space in CodeCache", and, if VME
 * takes place, processes it so that no exception is thrown, and prints its
 * stack trace. If test throws exception not caused by VME, this method just
 * re-throws this exception.
 *
 * @param test - test to check for and process VirtualMachineError.
 * @return - an exception caused by VME or null
 *           if test has thrown no exception.
 * @throws Throwable - if test has thrown an exception
 *                     that is not caused by VME.
 */
public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
    Throwable t = Utils.filterException(test::run,
            CodeCacheOverflowProcessor::isThrowableCausedByVME);
    if (t != null) {
        System.err.printf("%nNon-critical exception caught becuse of"
                + " code cache size is not enough to run all test cases.%n%n");
        t.printStackTrace();
    }
    return t;
}