hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
author neliasso
Wed, 09 Mar 2016 21:19:13 +0100
changeset 36598 ecfd16d711d6
parent 35472 cd54a457564e
child 36851 03e2f4d0a421
permissions -rw-r--r--
8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class Summary: Make test less fragile using whitebox API Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     1
/*
35472
cd54a457564e 8146620: CodelistTest.java fails with "Test failed on: jdk.internal.misc.Unsafe.getUnsafe()Ljdk/internal/misc/Unsafe;"
jbachorik
parents: 32747
diff changeset
     2
 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     4
 *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     8
 *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    13
 * accompanied this code).
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    14
 *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    18
 *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    21
 * questions.
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    22
 */
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    23
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    24
/*
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    25
 * @test CodelistTest
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    26
 * @bug 8054889
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    27
 * @library /testlibrary /test/lib /
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 28821
diff changeset
    28
 * @modules java.base/sun.misc
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 28821
diff changeset
    29
 *          java.compiler
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 28821
diff changeset
    30
 *          java.management
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 28821
diff changeset
    31
 *          jdk.jvmstat/sun.jvmstat.monitor
30604
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    32
 * @build jdk.test.lib.*
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    33
 *        jdk.test.lib.dcmd.*
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    34
 *        sun.hotspot.WhiteBox
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    35
 *        compiler.testlibrary.CompilerUtils
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    36
 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    37
 *                                sun.hotspot.WhiteBox$WhiteBoxPermission
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    38
 * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -Xmixed CodelistTest
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    39
 * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -Xint CodelistTest
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    40
 * @summary Test of diagnostic command Compiler.codelist
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    41
 *
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    42
 * Flag comment:
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    43
 * -XX:-UseCodeCacheFlushing - to prevent methods from being removed from the code cache before we have checked the results
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    44
 *
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    45
 * This test should never run in the same VM as other tests - the code cache may get huge which will
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    46
 * create an enormous amount of output to parse. Same for -Xcomp.
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    47
 */
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    48
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    49
import compiler.testlibrary.CompilerUtils;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    50
import compiler.whitebox.CompilerWhiteBoxTest;
30604
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    51
import jdk.test.lib.OutputAnalyzer;
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    52
import jdk.test.lib.dcmd.CommandExecutor;
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    53
import jdk.test.lib.dcmd.JMXExecutor;
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    54
import org.testng.annotations.Test;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    55
import org.testng.Assert;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    56
import sun.hotspot.WhiteBox;
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 26941
diff changeset
    57
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    58
import java.lang.reflect.Method;
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    59
import java.util.Iterator;
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    60
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    61
public class CodelistTest {
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    62
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    63
    /**
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    64
     * This test calls Jcmd (diagnostic command tool) Compiler.codelist and then parses the output,
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    65
     * making sure that the first methods in the list is valid by reflection.
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    66
     *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    67
     * Output example:
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    68
     *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    69
     * 6 0 java.lang.System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V [0x00007f7b49200910, 0x00007f7b49200aa0 - 0x00007f7b49200d30]
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    70
     * 2 3 java.lang.String.indexOf(II)I [0x00007f7b49200d90, 0x00007f7b49200f60 - 0x00007f7b49201490]
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    71
     * 7 3 java.lang.Math.min(II)I [0x00007f7b4922f010, 0x00007f7b4922f180 - 0x00007f7b4922f338]
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    72
     * 8 3 java.lang.String.equals(Ljava/lang/Object;)Z [0x00007f7b4922fb10, 0x00007f7b4922fd40 - 0x00007f7b49230698]
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    73
     * 9 3 java.lang.AbstractStringBuilder.ensureCapacityInternal(I)V [0x00007f7b49232010, 0x00007f7b492321a0 - 0x00007f7b49232510]
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    74
     * 10 1 java.lang.Object.<init>()V [0x00007f7b49233e90, 0x00007f7b49233fe0 - 0x00007f7b49234118]
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    75
     *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    76
     */
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    77
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    78
    protected static final WhiteBox WB = WhiteBox.getWhiteBox();
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    79
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 26941
diff changeset
    80
    public void run(CommandExecutor executor) {
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    81
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    82
        TestCase[] testcases = {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    83
                new TestCase(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE, "testcaseMethod1"),
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    84
                new TestCase(CompilerWhiteBoxTest.COMP_LEVEL_LIMITED_PROFILE, "testcaseMethod2"),
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    85
                new TestCase(CompilerWhiteBoxTest.COMP_LEVEL_FULL_PROFILE, "testcaseMethod3"),
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    86
                new TestCase(CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION, "testcaseMethod4"),
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    87
        };
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    88
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    89
        String directive = "{ match: \"CodelistTest.testcaseMethod*\", " +
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    90
                "BackgroundCompilation: false }";
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    91
        Assert.assertTrue(
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    92
                WB.addCompilerDirective(directive) == 1,
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    93
                "Must succeed");
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    94
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    95
        try {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    96
            // Enqueue one test method for each available level
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    97
            int[] complevels = CompilerUtils.getAvailableCompilationLevels();
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    98
            for (int level : complevels) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
    99
                // Only test comp level 1 and 4 - level 1, 2 and 3 may interfere with each other
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   100
                if (level == 1 || level == 4) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   101
                    TestCase testcase = testcases[level - 1];
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   102
                    WB.enqueueMethodForCompilation(testcase.method, testcase.level);
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   103
                    // Set results to false for those methods we must to find
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   104
                    // We will also assert if we find any test method we don't expect
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   105
                    testcase.check = false;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   106
                }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   107
            }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   108
        } finally {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   109
            WB.removeCompilerDirective(1);
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   110
        }
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   111
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   112
        // Get output from dcmd (diagnostic command)
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 26941
diff changeset
   113
        OutputAnalyzer output = executor.execute("Compiler.codelist");
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   114
        Iterator<String> lines = output.asLines().iterator();
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   115
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   116
        // Loop over output set result for all found methods
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   117
        while (lines.hasNext()) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   118
            String line = lines.next();
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   119
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   120
            // Fast check for common part of method name
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   121
            if (line.contains("CodelistTest.testcaseMethod")) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   122
                String[] parts = line.split(" ");
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   123
                int compileID = Integer.parseInt(parts[0]);
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   124
                int compileLevel = Integer.parseInt(parts[1]);
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   125
                String str = parts[2];
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   126
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   127
                for (TestCase testcase : testcases) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   128
                    if (str.contains(testcase.methodName)) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   129
                        Assert.assertFalse(testcase.check, "Must not be found or already found.");
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   130
                        Assert.assertTrue(testcase.level == compileLevel, "Must have correct level");
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   131
                        testcase.check = true;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   132
                    }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   133
                }
26941
96aa76b27b9c 8058891: serviceability/dcmd/CodelistTest.java - fails on all platforms
neliasso
parents: 26587
diff changeset
   134
            }
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   135
        }
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   136
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   137
        // Check all testcases that was run
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   138
        for (TestCase testcase : testcases) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   139
            Assert.assertTrue(testcase.check, "Missing testcase " + testcase.methodName);
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   140
        }
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   141
    }
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 26941
diff changeset
   142
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 26941
diff changeset
   143
    @Test
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 26941
diff changeset
   144
    public void jmx() {
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 26941
diff changeset
   145
        run(new JMXExecutor());
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 26941
diff changeset
   146
    }
36598
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   147
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   148
    public void testcaseMethod1() {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   149
    }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   150
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   151
    public void testcaseMethod2() {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   152
    }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   153
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   154
    public void testcaseMethod3() {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   155
    }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   156
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   157
    public void testcaseMethod4() {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   158
    }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   159
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   160
    public static Method getMethod(Class klass, String name, Class<?>... parameterTypes) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   161
        try {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   162
            return klass.getDeclaredMethod(name, parameterTypes);
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   163
        } catch (NoSuchMethodException | SecurityException e) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   164
            throw new RuntimeException("exception on getting method Helper." + name, e);
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   165
        }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   166
    }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   167
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   168
    class TestCase {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   169
        Method method;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   170
        int level;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   171
        String methodName;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   172
        Boolean check;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   173
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   174
        public TestCase(int level, String methodName) {
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   175
            this.method = getMethod(CodelistTest.class, methodName);
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   176
            this.level = level;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   177
            this.methodName = methodName;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   178
            this.check = true;
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   179
        }
ecfd16d711d6 8073793: serviceability/dcmd/compiler/CodelistTest.java fails with ClassNotFoundException trying to load VM anonymous class
neliasso
parents: 35472
diff changeset
   180
    }
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   181
}