test/runtime/ErrorHandling/ProblematicFrameTest.java

Print this page




  27  * @summary Test that error is not occurred during printing problematic frame
  28  * @library /testlibrary
  29  * @build com.oracle.java.testlibrary.*
  30  * @run driver ProblematicFrameTest
  31  */
  32 
  33 import com.oracle.java.testlibrary.*;
  34 
  35 import sun.misc.Unsafe;
  36 import com.oracle.java.testlibrary.Utils;
  37 
  38 public class ProblematicFrameTest {
  39     private static class Crasher {
  40         public static void main(String[] args) {
  41             Utils.getUnsafe().getInt(0);
  42         }
  43     }
  44 
  45     public static void main(String[] args) throws Exception {
  46         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  47             "-Xmx64m", "-XX:-TransmitErrorReport", "-XX:-CreateMinidumpOnCrash", Crasher.class.getName());
  48         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  49         output.shouldNotMatch("error occurred during error reporting \\(printing problematic frame\\)");
  50     }
  51 }


  27  * @summary Test that error is not occurred during printing problematic frame
  28  * @library /testlibrary
  29  * @build com.oracle.java.testlibrary.*
  30  * @run driver ProblematicFrameTest
  31  */
  32 
  33 import com.oracle.java.testlibrary.*;
  34 
  35 import sun.misc.Unsafe;
  36 import com.oracle.java.testlibrary.Utils;
  37 
  38 public class ProblematicFrameTest {
  39     private static class Crasher {
  40         public static void main(String[] args) {
  41             Utils.getUnsafe().getInt(0);
  42         }
  43     }
  44 
  45     public static void main(String[] args) throws Exception {
  46         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  47             "-Xmx64m", "-XX:-TransmitErrorReport", "-XX:-CreateCoredumpOnCrash", Crasher.class.getName());
  48         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  49         output.shouldNotMatch("error occurred during error reporting \\(printing problematic frame\\)");
  50     }
  51 }