Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
1 /*
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
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 */
24 /*
25 * @test
26 * @bug 5090006
27 * @summary javac fails with assertion error
28 * @library /tools/javac/lib
29 * @build ToolBox
30 * @run main AssertionFailureTest
31 */
33 import java.io.File;
34 import java.nio.file.Paths;
36 //original test: test/tools/javac/T5090006/compiler.sh
37 public class AssertionFailureTest {
39 private static final String testSrc =
40 "import stub_tie_gen.wsdl_hello_lit.client.*;\n" +
41 "import junit.framework.*;\n" +
42 "import testutil.ClientServerTestUtil;\n" +
43 "\n" +
44 "public class Test {\n" +
45 "\n" +
46 " void getStub() throws Exception {\n" +
47 " Hello_PortType_Stub x = null;\n" +
48 " new ClientServerTestUtil().setTransport(x, null, null, null);\n" +
49 " }\n" +
50 "\n" +
51 " public static void main(String[] args) {\n" +
52 " System.out.println(\"FISK\");\n" +
53 " }\n" +
54 "}";
56 public static void main(String args[]) throws Exception {
57 String classpath = Paths.get(System.getProperty("test.src"), "broken.jar")
58 .toString();
59 classpath = new StringBuilder(classpath)
60 .append(File.pathSeparator).append(".").toString();
61 // "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -verbose -d "${TESTCLASSES}" -cp "${TESTSRC}${FS}broken.jar" "${TESTSRC}${FS}$1"
62 ToolBox.JavaToolArgs params =
63 new ToolBox.JavaToolArgs()
64 .setOptions("-cp", classpath)
65 .setSources(testSrc);
66 ToolBox.javac(params);
67 }
69 }