author | jiangli |
Wed, 27 Sep 2017 17:55:20 -0400 | |
changeset 47548 | 664b9d44db74 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
40660
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
1 |
/* |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
4 |
* |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
8 |
* |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
13 |
* accompanied this code). |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
14 |
* |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
18 |
* |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
21 |
* questions. |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
22 |
*/ |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
23 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
24 |
/* |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
25 |
* @test |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
26 |
* @requires vm.flavor == "minimal" |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
27 |
* @modules java.base/jdk.internal.misc |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
28 |
* @library /test/lib |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
29 |
* @run driver NMT |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
30 |
*/ |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
31 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
32 |
import jdk.test.lib.process.OutputAnalyzer; |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
33 |
import jdk.test.lib.process.ProcessTools; |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
34 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
35 |
public class NMT { |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
36 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
37 |
public static void main(String args[]) throws Exception { |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
38 |
ProcessBuilder pb; |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
39 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
40 |
pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=detail", "-version"); |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
41 |
new OutputAnalyzer(pb.start()) |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
42 |
.shouldContain("Native Memory Tracking is not supported in this VM") |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
43 |
.shouldHaveExitValue(1); |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
44 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
45 |
pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=summary", "-version"); |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
46 |
new OutputAnalyzer(pb.start()) |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
47 |
.shouldContain("Native Memory Tracking is not supported in this VM") |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
48 |
.shouldHaveExitValue(1); |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
49 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
50 |
pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=off", "-version"); |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
51 |
new OutputAnalyzer(pb.start()) |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
52 |
.shouldContain("Native Memory Tracking is not supported in this VM") |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
53 |
.shouldHaveExitValue(1); |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
54 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
55 |
|
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
56 |
} |
d2f433c48708
8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff
changeset
|
57 |
} |