hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java
author kshefov
Fri, 24 Oct 2014 12:32:53 +0400
changeset 27173 566704615ade
child 28623 c6d1cfa63594
permissions -rw-r--r--
8057135: [TESTBUG] Need a test to cover JDK-8050167 Reviewed-by: ctornqvi, coleenp Contributed-by: boris.molodenkov@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27173
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     1
/*
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     4
 *
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     8
 *
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    13
 * accompanied this code).
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    14
 *
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    18
 *
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    21
 * questions.
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    22
 */
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    23
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    24
/*
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    25
 * @test
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    26
 * @bug 8050167
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    27
 * @summary Test that error is not occurred during printing problematic frame
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    28
 * @library /testlibrary
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    29
 * @build com.oracle.java.testlibrary.*
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    30
 * @run driver ProblematicFrameTest
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    31
 */
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    32
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    33
import com.oracle.java.testlibrary.*;
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    34
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    35
import sun.misc.Unsafe;
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    36
import com.oracle.java.testlibrary.Utils;
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    37
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    38
public class ProblematicFrameTest {
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    39
    private static class Crasher {
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    40
        public static void main(String[] args) {
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    41
            Utils.getUnsafe().getInt(0);
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    42
        }
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    43
    }
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    44
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    45
    public static void main(String[] args) throws Exception {
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    46
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    47
            "-Xmx64m", "-XX:-TransmitErrorReport", Crasher.class.getName());
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    48
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    49
        output.shouldNotMatch("error occurred during error reporting \\(printing problematic frame\\)");
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    50
    }
566704615ade 8057135: [TESTBUG] Need a test to cover JDK-8050167
kshefov
parents:
diff changeset
    51
}