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. |
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(); |