test/tools/javadoc/parser/7091528/T7091528.java

changeset 2281
b06e33ab7f61
parent 1094
dea82aa3ca4f
child 2367
1737ad9ac984
equal deleted inserted replaced
2280:8766826a4282 2281:b06e33ab7f61
1 /* 1 /*
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
21 * questions. 21 * questions.
22 */ 22 */
23 23
24 /** 24 /**
25 * @test 25 * @test
26 * @bug 7091528 26 * @bug 7091528 8029145
27 * @summary javadoc attempts to parse .class files 27 * @summary ensures javadoc parses unique source files and ignores all class files
28 * @compile p/C1.java p/q/C2.java 28 * @compile p/C1.java p/q/C2.java
29 * @run main T7091528 29 * @run main T7091528
30 */ 30 */
31 31
32 import java.io.File; 32 import java.io.File;
35 35
36 public class T7091528 { 36 public class T7091528 {
37 public static void main(String... args) { 37 public static void main(String... args) {
38 new T7091528().run(); 38 new T7091528().run();
39 } 39 }
40
41 void run() { 40 void run() {
42 File testSrc = new File(System.getProperty("test.src")); 41 File testSrc = new File(System.getProperty("test.src"));
43 File testClasses = new File(System.getProperty("test.classes")); 42 File testClasses = new File(System.getProperty("test.classes"));
44 String[] args = { 43 // 7091528, tests if class files are being ignored
45 "-d", ".", 44 runTest("-d", ".",
46 "-sourcepath", testClasses + File.pathSeparator + testSrc, 45 "-sourcepath", testClasses + File.pathSeparator + testSrc,
47 "-subpackages", 46 "-subpackages",
48 "p" 47 "p");
49 }; 48 // 8029145, tests if unique source files are parsed
49 runTest("-d", ".",
50 "-sourcepath", testSrc.getAbsolutePath(),
51 "-subpackages",
52 "p:p.q");
50 53
54 }
55 void runTest(String... args) {
51 StringWriter sw = new StringWriter(); 56 StringWriter sw = new StringWriter();
52 PrintWriter pw = new PrintWriter(sw); 57 PrintWriter pw = new PrintWriter(sw);
53 String doclet = com.sun.tools.doclets.standard.Standard.class.getName(); 58 String doclet = com.sun.tools.doclets.standard.Standard.class.getName();
54 int rc = com.sun.tools.javadoc.Main.execute("javadoc", pw, pw, pw, doclet, args); 59 int rc = com.sun.tools.javadoc.Main.execute("javadoc", pw, pw, pw, doclet, args);
55 pw.close(); 60 pw.close();

mercurial