hotspot/test/compiler/compilercontrol/share/scenario/Executor.java
author ppunegov
Tue, 24 Nov 2015 20:52:15 +0300
changeset 34215 ae6ba67d6420
child 34216 2818af1ce748
permissions -rw-r--r--
8066156: JEP-JDK-8046155: Test task: stress by dcmd Summary: Stress dcmd tests that add directives Reviewed-by: iignatyev, neliasso
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34215
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     1
/*
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     4
 *
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     8
 *
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    13
 * accompanied this code).
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    14
 *
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    18
 *
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    21
 * questions.
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    22
 */
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    23
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    24
package compiler.compilercontrol.share.scenario;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    25
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    26
import compiler.compilercontrol.share.actions.BaseAction;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    27
import jdk.test.lib.Asserts;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    28
import jdk.test.lib.OutputAnalyzer;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    29
import jdk.test.lib.ProcessTools;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    30
import jdk.test.lib.dcmd.CommandExecutor;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    31
import jdk.test.lib.dcmd.PidJcmdExecutor;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    32
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    33
import java.io.BufferedReader;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    34
import java.io.IOException;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    35
import java.io.InputStreamReader;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    36
import java.io.PrintWriter;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    37
import java.lang.reflect.Executable;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    38
import java.net.ServerSocket;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    39
import java.net.Socket;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    40
import java.util.ArrayList;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    41
import java.util.List;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    42
import java.util.Map;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    43
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    44
public class Executor {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    45
    private final boolean isValid;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    46
    private final List<String> vmOptions;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    47
    private final Map<Executable, State> states;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    48
    private final List<String> jcmdCommands;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    49
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    50
    /**
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    51
     * Constructor
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    52
     *
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    53
     * @param isValid      shows that the input given to the VM is valid and
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    54
     *                     VM shouldn't fail
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    55
     * @param vmOptions    a list of VM input options
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    56
     * @param states       a state map, or null for the non-checking execution
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    57
     * @param jcmdCommands a list of diagnostic commands to be preformed
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    58
     *                     on test VM
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    59
     */
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    60
    public Executor(boolean isValid, List<String> vmOptions,
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    61
            Map<Executable, State> states, List<String> jcmdCommands) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    62
        this.isValid = isValid;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    63
        if (vmOptions == null) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    64
            this.vmOptions = new ArrayList<>();
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    65
        } else {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    66
            this.vmOptions = vmOptions;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    67
        }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    68
        this.states = states;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    69
        this.jcmdCommands = jcmdCommands;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    70
    }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    71
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    72
    /**
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    73
     * Executes separate VM a gets an OutputAnalyzer instance with the results
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    74
     * of execution
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    75
     */
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    76
    public OutputAnalyzer execute() {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    77
        // Add class name that would be executed in a separate VM
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    78
        String classCmd = BaseAction.class.getName();
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    79
        vmOptions.add(classCmd);
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    80
        OutputAnalyzer output;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    81
        try (ServerSocket serverSocket = new ServerSocket(0)) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    82
            if (isValid) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    83
                // Get port test VM will connect to
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    84
                int port = serverSocket.getLocalPort();
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    85
                if (port == -1) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    86
                    throw new Error("Socket is not bound: " + port);
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    87
                }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    88
                vmOptions.add(String.valueOf(port));
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    89
                if (states != null) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    90
                    // add flag to show that there should be state map passed
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    91
                    vmOptions.add("states");
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    92
                }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    93
                // Start separate thread to connect with test VM
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    94
                new Thread(() -> connectTestVM(serverSocket)).start();
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    95
            }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    96
            // Start test VM
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    97
            output = ProcessTools.executeTestJvmAllArgs(
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    98
                    vmOptions.toArray(new String[vmOptions.size()]));
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
    99
        } catch (Throwable thr) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   100
            throw new Error("Execution failed: " + thr.getMessage(), thr);
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   101
        }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   102
        return output;
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   103
    }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   104
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   105
    /*
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   106
     * Performs connection with a test VM, sends method states and performs
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   107
     * JCMD operations on a test VM.
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   108
     */
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   109
    private void connectTestVM(ServerSocket serverSocket) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   110
        /*
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   111
         * There are no way to prove that accept was invoked before we started
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   112
         * test VM that connects to this serverSocket. Connection timeout is
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   113
         * enough
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   114
         */
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   115
        try (
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   116
                Socket socket = serverSocket.accept();
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   117
                PrintWriter pw = new PrintWriter(socket.getOutputStream(),
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   118
                        true);
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   119
                BufferedReader in = new BufferedReader(new InputStreamReader(
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   120
                        socket.getInputStream()))) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   121
            // Get pid of the executed process
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   122
            int pid = Integer.parseInt(in.readLine());
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   123
            Asserts.assertNE(pid, 0, "Got incorrect pid");
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   124
            executeJCMD(pid);
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   125
            if (states != null) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   126
                // serialize and send state map
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   127
                states.forEach((executable, state) -> {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   128
                    pw.println("{");
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   129
                    pw.println(executable.toGenericString());
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   130
                    pw.println(state.toString());
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   131
                    pw.println("}");
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   132
                });
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   133
            } else {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   134
                pw.println();
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   135
            }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   136
        } catch (IOException e) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   137
            throw new Error("Failed to write data: " + e.getMessage(), e);
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   138
        }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   139
    }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   140
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   141
    // Executes all diagnostic commands
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   142
    protected void executeJCMD(int pid) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   143
        CommandExecutor jcmdExecutor = new PidJcmdExecutor(String.valueOf(pid));
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   144
        for (String command : jcmdCommands) {
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   145
            jcmdExecutor.execute(command);
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   146
        }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   147
    }
ae6ba67d6420 8066156: JEP-JDK-8046155: Test task: stress by dcmd
ppunegov
parents:
diff changeset
   148
}