Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8321713

Harmonize executeTestJvm with create[Limited]TestJavaProcessBuilder

    XMLWordPrintable

Details

    • gc
    • b04

    Backports

      Description

        JDK-8315097: 'Rename createJavaProcessBuilder' changed the name of the ProcessTools helper functions used to create ProcessBuilders used to spawn new java test processes.

        We now have createTestJavaProcessBuilder and createLimitedTestJavaProcess. The former prepends jvm options from jtreg, while the latter doesn't.

        With these functions, it is common to see the following pattern in tests:
        ```
        ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(...);
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
        ```

        We have a couple of thin wrapper in ProcessTools that does exactly this, so that the code can be written as a one-liner:
        ```
        OutputAnalyzer output = ProcessTools.executeTestJvm();
        ```

        I propose that we name this functions using the same naming scheme we used for createTestJavaProcessBuilder and createLimitedTestJavaProcessBuilder. That is, we change executeTestJvm to executeTestJava and add a new executeLimitedTestJava function.

        Attachments

          Issue Links

            Activity

              People

                stefank Stefan Karlsson
                stefank Stefan Karlsson
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: