test/hotspot/jtreg/runtime/SharedArchiveFile/SharedStringsRunAuto.java
author iklam
Mon, 04 Dec 2017 08:59:47 -0800
changeset 48469 7312ae4465d6
parent 47216 71c04702a3d5
child 49008 d777541fceba
permissions -rw-r--r--
8193672: [test] Enhance vm.cds property to check for all conditions required to run CDS tests Reviewed-by: dholmes, dsamersoff, simonis
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32589
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
     1
/*
46389
d55896236dfd 8177728: [TESTBUG] Improve CDS test utils
mseledtsov
parents: 40631
diff changeset
     2
 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
32589
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
     4
 *
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
     7
 * published by the Free Software Foundation.
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
     8
 *
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    13
 * accompanied this code).
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    14
 *
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    18
 *
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    21
 * questions.
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    22
 */
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    23
46779
d80ca591ae48 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46389
diff changeset
    24
/**
32589
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    25
 * @test SharedStringsAuto
46779
d80ca591ae48 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46389
diff changeset
    26
 * @requires vm.cds
32589
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    27
 * @summary Test -Xshare:auto with shared strings.
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    28
 * Feature support: G1GC only, compressed oops/kptrs, 64-bit os, not on windows
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    29
 * @requires (sun.arch.data.model != "32") & (os.family != "windows")
48469
7312ae4465d6 8193672: [test] Enhance vm.cds property to check for all conditions required to run CDS tests
iklam
parents: 47216
diff changeset
    30
 * @requires vm.cds
39414
4adf52148100 8160088: update hotspot tests depending on GC to use @requires vm.gc.X
dfazunen
parents: 36851
diff changeset
    31
 * @requires vm.gc.G1
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 39414
diff changeset
    32
 * @library /test/lib
36851
03e2f4d0a421 8153737: Unsupported Module
chegar
parents: 32589
diff changeset
    33
 * @modules java.base/jdk.internal.misc
32589
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    34
 *          java.management
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    35
 * @run main SharedStringsRunAuto
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    36
 */
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    37
46389
d55896236dfd 8177728: [TESTBUG] Improve CDS test utils
mseledtsov
parents: 40631
diff changeset
    38
import jdk.test.lib.cds.CDSTestUtils;
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 39414
diff changeset
    39
import jdk.test.lib.process.OutputAnalyzer;
32589
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    40
import java.io.File;
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    41
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    42
public class SharedStringsRunAuto {
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    43
    public static void main(String[] args) throws Exception {
46389
d55896236dfd 8177728: [TESTBUG] Improve CDS test utils
mseledtsov
parents: 40631
diff changeset
    44
        OutputAnalyzer out =
d55896236dfd 8177728: [TESTBUG] Improve CDS test utils
mseledtsov
parents: 40631
diff changeset
    45
            CDSTestUtils.createArchive("-XX:+UseCompressedOops", "-XX:+UseG1GC");
d55896236dfd 8177728: [TESTBUG] Improve CDS test utils
mseledtsov
parents: 40631
diff changeset
    46
        CDSTestUtils.checkDump(out, "Shared string table stats");
d55896236dfd 8177728: [TESTBUG] Improve CDS test utils
mseledtsov
parents: 40631
diff changeset
    47
        CDSTestUtils.runWithArchiveAndCheck("-XX:+UseCompressedOops", "-XX:+UseG1GC");
32589
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    48
    }
f86fb16fcab0 8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff changeset
    49
}