jdk/test/tools/jar/compat/CLICompatibility.java
changeset 38762 2956ccc7cb77
parent 36511 9d0388c6b336
child 39313 0970a9a1de13
equal deleted inserted replaced
38761:e31b47204f64 38762:2956ccc7cb77
    55 
    55 
    56 public class CLICompatibility {
    56 public class CLICompatibility {
    57     static final Path TEST_CLASSES = Paths.get(System.getProperty("test.classes", "."));
    57     static final Path TEST_CLASSES = Paths.get(System.getProperty("test.classes", "."));
    58     static final Path USER_DIR = Paths.get(System.getProperty("user.dir"));
    58     static final Path USER_DIR = Paths.get(System.getProperty("user.dir"));
    59 
    59 
       
    60     static final String TOOL_VM_OPTIONS = System.getProperty("test.tool.vm.opts", "");
       
    61 
    60     final boolean legacyOnly;  // for running on older JDK's ( test validation )
    62     final boolean legacyOnly;  // for running on older JDK's ( test validation )
    61 
    63 
    62     // Resources we know to exist, that can be used for creating jar files.
    64     // Resources we know to exist, that can be used for creating jar files.
    63     static final String RES1 = "CLICompatibility.class";
    65     static final String RES1 = "CLICompatibility.class";
    64     static final String RES2 = "CLICompatibility$Result.class";
    66     static final String RES2 = "CLICompatibility$Result.class";
   499                                             File workingDir,
   501                                             File workingDir,
   500                                             String... args) {
   502                                             String... args) {
   501         String jar = getJDKTool("jar");
   503         String jar = getJDKTool("jar");
   502         List<String> commands = new ArrayList<>();
   504         List<String> commands = new ArrayList<>();
   503         commands.add(jar);
   505         commands.add(jar);
       
   506         if (!TOOL_VM_OPTIONS.isEmpty()) {
       
   507             commands.addAll(Arrays.asList(TOOL_VM_OPTIONS.split("\\s+", -1)));
       
   508         }
   504         Stream.of(args).map(s -> s.split(" "))
   509         Stream.of(args).map(s -> s.split(" "))
   505                        .flatMap(Arrays::stream)
   510                        .flatMap(Arrays::stream)
   506                        .forEach(x -> commands.add(x));
   511                        .forEach(x -> commands.add(x));
   507         ProcessBuilder p = new ProcessBuilder(commands);
   512         ProcessBuilder p = new ProcessBuilder(commands);
   508         if (stdinFrom != null)
   513         if (stdinFrom != null)