author | lana |
Thu, 16 Jul 2015 19:31:01 -0700 | |
changeset 31758 | ca2d747bbf94 |
parent 30846 | 2b3f379840f0 |
child 32337 | c9d3ab9f601c |
permissions | -rw-r--r-- |
1039 | 1 |
/* |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
5520
diff
changeset
|
2 |
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. |
1039 | 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 |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
1039 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
1039 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
2319
71bde363b33e
6814592: Legal notice repair needed in langtools/test/tools/javap/T4884240.java
tbell
parents:
1039
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
1039 | 20 |
* |
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
1039 | 24 |
*/ |
25 |
||
26 |
/* |
|
27 |
* @test |
|
28 |
* @bug 4884240 |
|
29 |
* @summary additional option required for javap |
|
30846 | 30 |
* @modules jdk.jdeps |
1039 | 31 |
*/ |
32 |
||
33 |
import java.io.*; |
|
34 |
||
35 |
public class T4884240 { |
|
36 |
public static void main(String... args) throws Exception { |
|
37 |
new T4884240().run(); |
|
38 |
} |
|
39 |
||
40 |
public void run() throws Exception { |
|
41 |
StringWriter sw = new StringWriter(); |
|
42 |
PrintWriter pw = new PrintWriter(sw); |
|
43 |
String[] args = { "-sysinfo", "java.lang.Object" }; |
|
44 |
int rc = com.sun.tools.javap.Main.run(args, pw); |
|
45 |
if (rc != 0) |
|
46 |
throw new Exception("unexpected return code: " + rc); |
|
47 |
pw.close(); |
|
48 |
String[] lines = sw.toString().split("\n"); |
|
49 |
if (lines.length < 3 |
|
3547 | 50 |
|| !lines[0].trim().startsWith("Classfile") |
51 |
|| !lines[1].trim().startsWith("Last modified") |
|
52 |
|| !lines[2].trim().startsWith("MD5")) { |
|
1039 | 53 |
System.out.println(sw); |
54 |
throw new Exception("unexpected output"); |
|
55 |
} |
|
56 |
} |
|
57 |
} |