hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
author dcubed
Mon, 18 Jul 2016 14:20:30 -0700
changeset 39978 d79e47b2d2d9
parent 36851 03e2f4d0a421
child 40077 49e1e5dacc25
permissions -rw-r--r--
8161173: quarantine compiler/arraycopy/TestEliminatedArrayCopyDeopt.java 8161174: quarantine gc/stress/TestStressG1Humongous.java on 32-bit 8161175: quarantine serviceability/dcmd/compiler/CompilerQueueTest.java on 32-bit Reviewed-by: sspitsyn, jmasa, gtriantafill
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
     1
/*
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 28821
diff changeset
     2
 * Copyright (c) 2014, 2015, 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 CompilerQueueTest
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    26
 * @bug 8054889
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    27
 * @library /testlibrary /test/lib /
36851
03e2f4d0a421 8153737: Unsupported Module
chegar
parents: 36323
diff changeset
    28
 * @modules java.base/jdk.internal.misc
29678
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
39978
d79e47b2d2d9 8161173: quarantine compiler/arraycopy/TestEliminatedArrayCopyDeopt.java
dcubed
parents: 36851
diff changeset
    32
 * @summary Test of diagnostic command Compiler.queue
d79e47b2d2d9 8161173: quarantine compiler/arraycopy/TestEliminatedArrayCopyDeopt.java
dcubed
parents: 36851
diff changeset
    33
 * Fails intermittently on 32-bit VMs due to 8158756 so quarantine
d79e47b2d2d9 8161173: quarantine compiler/arraycopy/TestEliminatedArrayCopyDeopt.java
dcubed
parents: 36851
diff changeset
    34
 * it on those platforms:
d79e47b2d2d9 8161173: quarantine compiler/arraycopy/TestEliminatedArrayCopyDeopt.java
dcubed
parents: 36851
diff changeset
    35
 * @requires vm.bits != "32"
30604
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    36
 * @build jdk.test.lib.*
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    37
 *        jdk.test.lib.dcmd.*
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    38
 *        sun.hotspot.WhiteBox
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    39
 *        compiler.testlibrary.CompilerUtils
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    40
 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    41
 *                                sun.hotspot.WhiteBox$WhiteBoxPermission
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    42
 * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -Xmixed -XX:+WhiteBoxAPI CompilerQueueTest
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    43
 * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -Xmixed -XX:-TieredCompilation -XX:+WhiteBoxAPI CompilerQueueTest
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    44
 * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -Xint -XX:+WhiteBoxAPI CompilerQueueTest
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    45
 */
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    46
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    47
import compiler.testlibrary.CompilerUtils;
30604
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    48
import jdk.test.lib.OutputAnalyzer;
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    49
import jdk.test.lib.dcmd.CommandExecutor;
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    50
import jdk.test.lib.dcmd.JMXExecutor;
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
    51
import org.testng.annotations.Test;
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    52
import org.testng.Assert;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    53
import sun.hotspot.WhiteBox;
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
    54
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    55
import java.lang.reflect.Executable;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    56
import java.lang.reflect.Method;
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
    57
import java.util.Iterator;
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    58
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    59
public class CompilerQueueTest {
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    60
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    61
    /**
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    62
     * This test calls Jcmd (diagnostic command tool) Compiler.queue and
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    63
     * then parses the output, making sure that the output look ok.
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    64
     *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    65
     *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    66
     * Output example:
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    67
     *
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    68
     * Current compiles:
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    69
     * C1 CompilerThread14 267       3       java.net.URLStreamHandler::parseURL (1166 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    70
     * C1 CompilerThread13 760       3       javax.management.StandardMBean::getDescription (11 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    71
     * C1 CompilerThread12 757  s    3       com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory::getMapping (27 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    72
     * C1 CompilerThread11 756  s!   3       com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory::mappingForType (110 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    73
     * C1 CompilerThread10 761       3       java.lang.StringLatin1::indexOf (121 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    74
     * C2 CompilerThread7 769       4       CompilerQueueTest::testcaseMethod4 (1 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    75
     *
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    76
     * C1 compile queue:
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    77
     * 762       3       java.lang.invoke.MethodType::basicType (8 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    78
     * 763       3       java.util.ArrayList::rangeCheck (22 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    79
     * 764       3       java.util.ArrayList::elementData (7 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    80
     * 765       3       jdk.internal.org.objectweb.asm.MethodVisitor::<init> (35 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    81
     * 766       1       CompilerQueueTest::testcaseMethod1 (1 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    82
     * 767       2       CompilerQueueTest::testcaseMethod2 (1 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    83
     * 768       3       CompilerQueueTest::testcaseMethod3 (1 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    84
     * 770       3       java.util.Properties::getProperty (46 bytes)
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    85
     *
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    86
     * C2 compile queue:
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    87
     * Empty
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    88
     *
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    89
     **/
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    90
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    91
    protected static final WhiteBox WB = WhiteBox.getWhiteBox();
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    92
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
    93
    public void run(CommandExecutor executor) {
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
    94
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    95
        TestCase[] testcases = {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    96
                new TestCase(1, "testcaseMethod1"),
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    97
                new TestCase(2, "testcaseMethod2"),
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    98
                new TestCase(3, "testcaseMethod3"),
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
    99
                new TestCase(4, "testcaseMethod4"),
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   100
        };
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   101
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   102
        // Lock compilation makes all compiles stay in queue or compile thread before completion
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   103
        WB.lockCompilation();
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   104
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   105
        // Enqueue one test method for each available level
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   106
        int[] complevels = CompilerUtils.getAvailableCompilationLevels();
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   107
        for (int level : complevels) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   108
            TestCase testcase = testcases[level - 1];
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   109
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   110
            boolean added = WB.enqueueMethodForCompilation(testcase.method, testcase.level);
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   111
            // Set results to false for those methods we must to find
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   112
            // We will also assert if we find any test method we don't expect
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   113
            Assert.assertTrue(WB.isMethodQueuedForCompilation(testcase.method));
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   114
            testcase.check = false;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   115
        }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   116
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   117
        // Get output from dcmd (diagnostic command)
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   118
        OutputAnalyzer output = executor.execute("Compiler.queue");
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   119
        Iterator<String> lines = output.asLines().iterator();
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   120
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   121
        // Loop over output set result for all found methods
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   122
        while (lines.hasNext()) {
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   123
            String str = lines.next();
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   124
            // Fast check for common part of method name
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   125
            if (str.contains("testcaseMethod")) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   126
                for (TestCase testcase : testcases) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   127
                    if (str.contains(testcase.methodName)) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   128
                        Assert.assertFalse(testcase.check, "Must not be found or already found.");
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   129
                        testcase.check = true;
26941
96aa76b27b9c 8058891: serviceability/dcmd/CodelistTest.java - fails on all platforms
neliasso
parents: 26587
diff changeset
   130
                    }
96aa76b27b9c 8058891: serviceability/dcmd/CodelistTest.java - fails on all platforms
neliasso
parents: 26587
diff changeset
   131
                }
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   132
            }
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   133
        }
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   134
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   135
        for (TestCase testcase : testcases) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   136
            if (!testcase.check) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   137
                // If this method wasn't found it must have been removed by policy,
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   138
                // verify that it is now removed from the queue
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   139
                Assert.assertFalse(WB.isMethodQueuedForCompilation(testcase.method), "Must be found or not in queue");
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   140
            }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   141
            // Otherwise all good.
26941
96aa76b27b9c 8058891: serviceability/dcmd/CodelistTest.java - fails on all platforms
neliasso
parents: 26587
diff changeset
   142
        }
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   143
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   144
        // Enable compilations again
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   145
        WB.unlockCompilation();
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   146
    }
28821
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   147
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   148
    @Test
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   149
    public void jmx() {
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   150
        run(new JMXExecutor());
f7820f311663 8071908: Port internal Diagnostic Command tests and test framework to jtreg
miauno
parents: 28649
diff changeset
   151
    }
36323
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   152
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   153
    public void testcaseMethod1() {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   154
    }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   155
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   156
    public void testcaseMethod2() {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   157
    }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   158
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   159
    public void testcaseMethod3() {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   160
    }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   161
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   162
    public void testcaseMethod4() {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   163
    }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   164
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   165
    public static Method getMethod(Class klass, String name, Class<?>... parameterTypes) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   166
        try {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   167
            return klass.getDeclaredMethod(name, parameterTypes);
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   168
        } catch (NoSuchMethodException | SecurityException e) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   169
            throw new RuntimeException("exception on getting method Helper." + name, e);
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   170
        }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   171
    }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   172
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   173
    class TestCase {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   174
        Method method;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   175
        int level;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   176
        String methodName;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   177
        Boolean check;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   178
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   179
        public TestCase(int level, String methodName) {
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   180
            this.method = getMethod(CompilerQueueTest.class, methodName);
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   181
            this.level = level;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   182
            this.methodName = methodName;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   183
            this.check = true;
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   184
        }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   185
    }
f7d5ddfbb5ce 8069160: serviceability/dcmd/compiler/CompilerQueueTest.java fails due to class not found
neliasso
parents: 30604
diff changeset
   186
26587
e8b28fa936af 8054889: Compiler team's implementation task
neliasso
parents:
diff changeset
   187
}