hotspot/test/runtime/verifier/TraceClassRes.java
author mockner
Wed, 23 Dec 2015 15:05:38 -0500
changeset 35219 b9ef87beb87c
parent 30616 fde3a4fee412
child 38151 fffedc5e5cf8
permissions -rw-r--r--
8144874: Reimplement TraceClassResolution with Unified Logging. Summary: TraceClassResolution reimplemented with classresolve tag. Reviewed-by: coleenp, dholmes, iklam, rprotacio
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30616
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     1
/*
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     2
 * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     4
 *
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     8
 *
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    13
 * accompanied this code).
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    14
 *
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    18
 *
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    21
 * questions.
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    22
 */
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    23
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    24
/*
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    25
 * @test
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    26
 * @bug 8076318
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    27
 * @summary split verifier needs to add TraceClassResolution
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    28
 * @library /testlibrary
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    29
 */
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    30
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    31
import jdk.test.lib.*;
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    32
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    33
// Test that the verifier outputs the classes it loads if -XX:+TraceClassResolution is specified"
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    34
public class TraceClassRes {
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    35
  public static void main(String[] args) throws Exception {
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    36
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    37
    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    38
        "-XX:+TraceClassResolution", "-verify", "-Xshare:off", "-version");
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    39
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    40
    OutputAnalyzer output = new OutputAnalyzer(pb.start());
35219
b9ef87beb87c 8144874: Reimplement TraceClassResolution with Unified Logging.
mockner
parents: 30616
diff changeset
    41
    output.shouldContain("[classresolve] java.lang.ClassLoader java.lang.Throwable ClassLoader.java (verification)");
30616
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    42
    output.shouldHaveExitValue(0);
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    43
  }
fde3a4fee412 8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
diff changeset
    44
}