author | coleenp |
Mon, 29 Jul 2019 10:34:20 -0400 | |
changeset 57567 | b000362a89a0 |
parent 52400 | test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java@ca309ee4fd92 |
permissions | -rw-r--r-- |
48138 | 1 |
/* |
57567
b000362a89a0
8202339: [TESTBUG] Consolidate the tests in runtime/SharedArchiveFile and runtime/appcds
coleenp
parents:
52400
diff
changeset
|
2 |
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. |
48138 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
/* |
|
26 |
* @test |
|
27 |
* @summary Test locking on shared strings |
|
49008
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48791
diff
changeset
|
28 |
* @requires vm.cds.archived.java.heap |
57567
b000362a89a0
8202339: [TESTBUG] Consolidate the tests in runtime/SharedArchiveFile and runtime/appcds
coleenp
parents:
52400
diff
changeset
|
29 |
* @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib |
52400
ca309ee4fd92
8211336: [TESTBUG] appcds tests with incorrect usage of -XX:+UseStringDeduplication
iklam
parents:
51990
diff
changeset
|
30 |
* @modules jdk.jartool/sun.tools.jar |
48138 | 31 |
* @compile LockStringTest.java LockStringValueTest.java |
32 |
* @build sun.hotspot.WhiteBox |
|
48791
6e079ff6c83c
8186635: ClassFileInstaller should be run as a driver
iignatyev
parents:
48469
diff
changeset
|
33 |
* @run driver ClassFileInstaller sun.hotspot.WhiteBox |
51990
6003e034cdd8
8209946: [TESTBUG] CDS tests should use "@run driver"
iklam
parents:
51370
diff
changeset
|
34 |
* @run driver LockSharedStrings |
48138 | 35 |
*/ |
36 |
||
37 |
public class LockSharedStrings { |
|
38 |
public static void main(String[] args) throws Exception { |
|
52400
ca309ee4fd92
8211336: [TESTBUG] appcds tests with incorrect usage of -XX:+UseStringDeduplication
iklam
parents:
51990
diff
changeset
|
39 |
SharedStringsUtils.run(args, LockSharedStrings::test); |
ca309ee4fd92
8211336: [TESTBUG] appcds tests with incorrect usage of -XX:+UseStringDeduplication
iklam
parents:
51990
diff
changeset
|
40 |
} |
ca309ee4fd92
8211336: [TESTBUG] appcds tests with incorrect usage of -XX:+UseStringDeduplication
iklam
parents:
51990
diff
changeset
|
41 |
|
ca309ee4fd92
8211336: [TESTBUG] appcds tests with incorrect usage of -XX:+UseStringDeduplication
iklam
parents:
51990
diff
changeset
|
42 |
public static void test(String[] args) throws Exception { |
48138 | 43 |
SharedStringsUtils.buildJarAndWhiteBox("LockStringTest", "LockStringValueTest"); |
44 |
||
45 |
SharedStringsUtils.dumpWithWhiteBox( |
|
46 |
TestCommon.list("LockStringTest", "LockStringValueTest"), |
|
51370
fbb62267e5e9
8208705: [TESTBUG] The -Xlog:cds,cds+hashtables vm option is not always required for appcds tests
ccheung
parents:
51279
diff
changeset
|
47 |
"ExtraSharedInput.txt", "-Xlog:cds,cds+hashtables"); |
48138 | 48 |
|
49 |
String[] extraMatch = new String[] {"LockStringTest: PASS"}; |
|
50 |
SharedStringsUtils.runWithArchiveAndWhiteBox(extraMatch, "LockStringTest"); |
|
51 |
||
52 |
extraMatch = new String[] {"LockStringValueTest: PASS"}; |
|
53 |
SharedStringsUtils.runWithArchiveAndWhiteBox(extraMatch, "LockStringValueTest", |
|
54 |
"--add-opens=java.base/java.lang=ALL-UNNAMED"); |
|
55 |
} |
|
56 |
} |