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

Harmonize executeTestJvm with create[Limited]TestJavaProcessBuilder

XMLWordPrintable

    • gc
    • b04

        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.

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

                Created:
                Updated:
                Resolved: