hotspot/test/gc/arguments/TestExplicitGCInvokesConcurrentAndUnloadsClasses.java
author lana
Thu, 23 Feb 2017 16:21:29 +0000
changeset 43895 a9970f1b6b70
parent 42620 a6f74efe32aa
permissions -rw-r--r--
Added tag jdk-9+158 for changeset 51a9f82cff03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42620
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     1
/*
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     4
 *
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     8
 *
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    13
 * accompanied this code).
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    14
 *
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    18
 *
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    21
 * questions.
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    22
 */
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    23
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    24
/*
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    25
 * @test TestExplicitGCInvokesConcurrentAndUnloadsClasses
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    26
 * @summary Test that the flag ExplicitGCInvokesConcurrentAndUnloadsClasses is deprecated
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    27
 * @bug 8170388
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    28
 * @key gc
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    29
 * @library /test/lib
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    30
 * @modules java.base/jdk.internal.misc
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    31
 *          java.management
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    32
 * @run driver TestExplicitGCInvokesConcurrentAndUnloadsClasses
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    33
 */
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    34
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    35
import jdk.test.lib.process.OutputAnalyzer;
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    36
import jdk.test.lib.process.ProcessTools;
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    37
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    38
public class TestExplicitGCInvokesConcurrentAndUnloadsClasses {
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    39
    public static void main(String[] args) throws Exception {
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    40
        ProcessBuilder pb =
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    41
            ProcessTools.createJavaProcessBuilder("-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses",
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    42
                                                  "-Xlog:gc",
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    43
                                                  "-version");
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    44
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    45
        output.shouldContain("ExplicitGCInvokesConcurrentAndUnloadsClasses was deprecated");
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    46
        output.shouldHaveExitValue(0);
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    47
    }
a6f74efe32aa 8170388: Deprecate the flag -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses
ehelin
parents:
diff changeset
    48
}