test/gc/TestVerifyDuringStartup.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8012447 Sdiff test/gc

test/gc/TestVerifyDuringStartup.java

Print this page
rev 5017 : 8012447: Java CTW implementation
Reviewed-by:


  31 import com.oracle.java.testlibrary.JDKToolFinder;
  32 import com.oracle.java.testlibrary.OutputAnalyzer;
  33 import com.oracle.java.testlibrary.ProcessTools;
  34 import java.util.ArrayList;
  35 import java.util.Collections;
  36 
  37 public class TestVerifyDuringStartup {
  38   public static void main(String args[]) throws Exception {
  39     ArrayList<String> vmOpts = new ArrayList();
  40 
  41     String testVmOptsStr = System.getProperty("test.java.opts");
  42     if (!testVmOptsStr.isEmpty()) {
  43       String[] testVmOpts = testVmOptsStr.split(" ");
  44       Collections.addAll(vmOpts, testVmOpts);
  45     }
  46     Collections.addAll(vmOpts, new String[] {"-XX:-UseTLAB",
  47                                              "-XX:+UnlockDiagnosticVMOptions",
  48                                              "-XX:+VerifyDuringStartup",
  49                                              "-version"});
  50 
  51     System.out.print("Testing:\n" + JDKToolFinder.getJDKTool("java"));
  52     for (int i = 0; i < vmOpts.size(); i += 1) {
  53       System.out.print(" " + vmOpts.get(i));
  54     }
  55     System.out.println();
  56 
  57     ProcessBuilder pb =
  58       ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()]));
  59     OutputAnalyzer output = new OutputAnalyzer(pb.start());
  60 
  61     System.out.println("Output:\n" + output.getOutput());
  62 
  63     output.shouldContain("[Verifying");
  64     output.shouldHaveExitValue(0);
  65   }
  66 }


  31 import com.oracle.java.testlibrary.JDKToolFinder;
  32 import com.oracle.java.testlibrary.OutputAnalyzer;
  33 import com.oracle.java.testlibrary.ProcessTools;
  34 import java.util.ArrayList;
  35 import java.util.Collections;
  36 
  37 public class TestVerifyDuringStartup {
  38   public static void main(String args[]) throws Exception {
  39     ArrayList<String> vmOpts = new ArrayList();
  40 
  41     String testVmOptsStr = System.getProperty("test.java.opts");
  42     if (!testVmOptsStr.isEmpty()) {
  43       String[] testVmOpts = testVmOptsStr.split(" ");
  44       Collections.addAll(vmOpts, testVmOpts);
  45     }
  46     Collections.addAll(vmOpts, new String[] {"-XX:-UseTLAB",
  47                                              "-XX:+UnlockDiagnosticVMOptions",
  48                                              "-XX:+VerifyDuringStartup",
  49                                              "-version"});
  50 
  51     System.out.print("Testing:\n" + JDKToolFinder.getCurrentJDKTool("java"));
  52     for (int i = 0; i < vmOpts.size(); i += 1) {
  53       System.out.print(" " + vmOpts.get(i));
  54     }
  55     System.out.println();
  56 
  57     ProcessBuilder pb =
  58       ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()]));
  59     OutputAnalyzer output = new OutputAnalyzer(pb.start());
  60 
  61     System.out.println("Output:\n" + output.getOutput());
  62 
  63     output.shouldContain("[Verifying");
  64     output.shouldHaveExitValue(0);
  65   }
  66 }
test/gc/TestVerifyDuringStartup.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File