Java Code Examples for com.oracle.java.testlibrary.Utils#getFilteredTestJavaOpts()

The following examples show how to use com.oracle.java.testlibrary.Utils#getFilteredTestJavaOpts() . 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: RTMTestBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Prepares VM options for test execution.
 * This method get test java options, filter out all RTM-related options
 * and all options that matches regexps in {@code additionalFilters},
 * adds CompileCommand=compileonly,method_name options for each method
 * from {@code methodToCompile} and finally appends all {@code vmOpts}.
 *
 * @param test test case whose methods that should be compiled.
 *             If {@code null} then no additional <i>compileonly</i>
 *             commands will be added to VM options.
 * @param additionalFilters array with regular expression that will be
 *                          used to filter out test java options.
 *                          If {@code null} then no additional filters
 *                          will be used.
 * @param vmOpts additional options to pass to VM.
 * @return array with VM options.
 */
private static String[] prepareFilteredTestOptions(CompilableTest test,
        String[] additionalFilters, String... vmOpts) {
    List<String> finalVMOpts = new LinkedList<>();
    String[] filters;

    if (additionalFilters != null) {
        filters = Arrays.copyOf(additionalFilters,
                additionalFilters.length + 1);
    } else {
        filters = new String[1];
    }

    filters[filters.length - 1] = "RTM";
    String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
    Collections.addAll(finalVMOpts, filteredVMOpts);
    Collections.addAll(finalVMOpts, "-Xcomp", "-server",
            "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
            CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            "-Xbootclasspath/a:.", "-XX:+WhiteBoxAPI");

    if (test != null) {
        for (String method : test.getMethodsToCompileNames()) {
            finalVMOpts.add("-XX:CompileCommand=compileonly," + method);
        }
    }
    Collections.addAll(finalVMOpts, vmOpts);
    return finalVMOpts.toArray(new String[finalVMOpts.size()]);
}
 
Example 2
Source File: RTMTestBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Prepares VM options for test execution.
 * This method get test java options, filter out all RTM-related options
 * and all options that matches regexps in {@code additionalFilters},
 * adds CompileCommand=compileonly,method_name options for each method
 * from {@code methodToCompile} and finally appends all {@code vmOpts}.
 *
 * @param test test case whose methods that should be compiled.
 *             If {@code null} then no additional <i>compileonly</i>
 *             commands will be added to VM options.
 * @param additionalFilters array with regular expression that will be
 *                          used to filter out test java options.
 *                          If {@code null} then no additional filters
 *                          will be used.
 * @param vmOpts additional options to pass to VM.
 * @return array with VM options.
 */
private static String[] prepareFilteredTestOptions(CompilableTest test,
        String[] additionalFilters, String... vmOpts) {
    List<String> finalVMOpts = new LinkedList<>();
    String[] filters;

    if (additionalFilters != null) {
        filters = Arrays.copyOf(additionalFilters,
                additionalFilters.length + 1);
    } else {
        filters = new String[1];
    }

    filters[filters.length - 1] = "RTM";
    String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
    Collections.addAll(finalVMOpts, filteredVMOpts);
    Collections.addAll(finalVMOpts, "-Xcomp", "-server",
            "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
            CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            "-Xbootclasspath/a:.", "-XX:+WhiteBoxAPI");

    if (test != null) {
        for (String method : test.getMethodsToCompileNames()) {
            finalVMOpts.add("-XX:CompileCommand=compileonly," + method);
        }
    }
    Collections.addAll(finalVMOpts, vmOpts);
    return finalVMOpts.toArray(new String[finalVMOpts.size()]);
}
 
Example 3
Source File: RTMTestBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Prepares VM options for test execution.
 * This method get test java options, filter out all RTM-related options
 * and all options that matches regexps in {@code additionalFilters},
 * adds CompileCommand=compileonly,method_name options for each method
 * from {@code methodToCompile} and finally appends all {@code vmOpts}.
 *
 * @param test test case whose methods that should be compiled.
 *             If {@code null} then no additional <i>compileonly</i>
 *             commands will be added to VM options.
 * @param additionalFilters array with regular expression that will be
 *                          used to filter out test java options.
 *                          If {@code null} then no additional filters
 *                          will be used.
 * @param vmOpts additional options to pass to VM.
 * @return array with VM options.
 */
private static String[] prepareFilteredTestOptions(CompilableTest test,
        String[] additionalFilters, String... vmOpts) {
    List<String> finalVMOpts = new LinkedList<>();
    String[] filters;

    if (additionalFilters != null) {
        filters = Arrays.copyOf(additionalFilters,
                additionalFilters.length + 1);
    } else {
        filters = new String[1];
    }

    filters[filters.length - 1] = "RTM";
    String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
    Collections.addAll(finalVMOpts, filteredVMOpts);
    Collections.addAll(finalVMOpts, "-Xcomp", "-server",
            "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
            CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            "-Xbootclasspath/a:.", "-XX:+WhiteBoxAPI");

    if (test != null) {
        for (String method : test.getMethodsToCompileNames()) {
            finalVMOpts.add("-XX:CompileCommand=compileonly," + method);
        }
    }
    Collections.addAll(finalVMOpts, vmOpts);
    return finalVMOpts.toArray(new String[finalVMOpts.size()]);
}
 
Example 4
Source File: RTMTestBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Prepares VM options for test execution.
 * This method get test java options, filter out all RTM-related options
 * and all options that matches regexps in {@code additionalFilters},
 * adds CompileCommand=compileonly,method_name options for each method
 * from {@code methodToCompile} and finally appends all {@code vmOpts}.
 *
 * @param test test case whose methods that should be compiled.
 *             If {@code null} then no additional <i>compileonly</i>
 *             commands will be added to VM options.
 * @param additionalFilters array with regular expression that will be
 *                          used to filter out test java options.
 *                          If {@code null} then no additional filters
 *                          will be used.
 * @param vmOpts additional options to pass to VM.
 * @return array with VM options.
 */
private static String[] prepareFilteredTestOptions(CompilableTest test,
        String[] additionalFilters, String... vmOpts) {
    List<String> finalVMOpts = new LinkedList<>();
    String[] filters;

    if (additionalFilters != null) {
        filters = Arrays.copyOf(additionalFilters,
                additionalFilters.length + 1);
    } else {
        filters = new String[1];
    }

    filters[filters.length - 1] = "RTM";
    String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
    Collections.addAll(finalVMOpts, filteredVMOpts);
    Collections.addAll(finalVMOpts, "-Xcomp", "-server",
            "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
            CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            "-Xbootclasspath/a:.", "-XX:+WhiteBoxAPI");

    if (test != null) {
        for (String method : test.getMethodsToCompileNames()) {
            finalVMOpts.add("-XX:CompileCommand=compileonly," + method);
        }
    }
    Collections.addAll(finalVMOpts, vmOpts);
    return finalVMOpts.toArray(new String[finalVMOpts.size()]);
}
 
Example 5
Source File: RTMTestBase.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Prepares VM options for test execution.
 * This method get test java options, filter out all RTM-related options
 * and all options that matches regexps in {@code additionalFilters},
 * adds CompileCommand=compileonly,method_name options for each method
 * from {@code methodToCompile} and finally appends all {@code vmOpts}.
 *
 * @param test test case whose methods that should be compiled.
 *             If {@code null} then no additional <i>compileonly</i>
 *             commands will be added to VM options.
 * @param additionalFilters array with regular expression that will be
 *                          used to filter out test java options.
 *                          If {@code null} then no additional filters
 *                          will be used.
 * @param vmOpts additional options to pass to VM.
 * @return array with VM options.
 */
private static String[] prepareFilteredTestOptions(CompilableTest test,
        String[] additionalFilters, String... vmOpts) {
    List<String> finalVMOpts = new LinkedList<>();
    String[] filters;

    if (additionalFilters != null) {
        filters = Arrays.copyOf(additionalFilters,
                additionalFilters.length + 1);
    } else {
        filters = new String[1];
    }

    filters[filters.length - 1] = "RTM";
    String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
    Collections.addAll(finalVMOpts, filteredVMOpts);
    Collections.addAll(finalVMOpts, "-Xcomp", "-server",
            "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
            CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            "-Xbootclasspath/a:.", "-XX:+WhiteBoxAPI");

    if (test != null) {
        for (String method : test.getMethodsToCompileNames()) {
            finalVMOpts.add("-XX:CompileCommand=compileonly," + method);
        }
    }
    Collections.addAll(finalVMOpts, vmOpts);
    return finalVMOpts.toArray(new String[finalVMOpts.size()]);
}