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 */ 23 24 /* 25 * @test 26 * @bug 8037085 27 * @summary Ensures that sjavac can handle various exclusion patterns. 28 * 29 * @modules jdk.compiler/com.sun.tools.sjavac 30 * jdk.jdeps/com.sun.tools.javap 31 * @library /tools/lib 32 * @build Wrapper toolbox.ToolBox 33 * @run main Wrapper IncludeExcludePatterns 34 */ 35 36 import com.sun.tools.javac.main.Main.Result; 37 import com.sun.tools.javac.util.Assert; 38 import com.sun.tools.sjavac.server.Sjavac; 39 40 import java.io.File; 41 import java.io.IOException; 42 import java.nio.file.Files; 43 import java.nio.file.Path; 44 import java.nio.file.Paths; 45 import java.util.Arrays; 46 import java.util.Collection; 47 import java.util.HashSet; 48 import java.util.Set; 49 import java.util.stream.Collectors; 50 import java.util.stream.Stream; 51 52 public class IncludeExcludePatterns extends SjavacBase { 53 54 final Path SRC = Paths.get("src"); 55 final Path BIN = Paths.get("bin"); 56 final Path STATE_DIR = Paths.get("state-dir"); 57 58 // An arbitrarily but sufficiently complicated source tree. 59 final Path A = Paths.get("pkga/A.java"); 60 final Path X1 = Paths.get("pkga/subpkg/Xx.java"); 61 final Path Y = Paths.get("pkga/subpkg/subsubpkg/Y.java"); 62 final Path B = Paths.get("pkgb/B.java"); 63 final Path C = Paths.get("pkgc/C.java"); 64 final Path X2 = Paths.get("pkgc/Xx.java"); 65 66 final Path[] ALL_PATHS = {A, X1, Y, B, C, X2}; 67 68 public static void main(String[] ignore) throws Exception { 69 new IncludeExcludePatterns().runTest(); 70 } 71 | 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 */ 23 24 /* 25 * @test 26 * @bug 8037085 27 * @summary Ensures that sjavac can handle various exclusion patterns. 28 * 29 * @modules jdk.compiler/com.sun.tools.javac.main 30 * jdk.compiler/com.sun.tools.sjavac 31 * jdk.compiler/com.sun.tools.sjavac.server 32 * @library /tools/lib 33 * @build Wrapper toolbox.ToolBox toolbox.Assert 34 * @run main Wrapper IncludeExcludePatterns 35 */ 36 37 import java.io.File; 38 import java.io.IOException; 39 import java.nio.file.Files; 40 import java.nio.file.Path; 41 import java.nio.file.Paths; 42 import java.util.Arrays; 43 import java.util.Collection; 44 import java.util.HashSet; 45 import java.util.Set; 46 import java.util.stream.Collectors; 47 import java.util.stream.Stream; 48 49 import com.sun.tools.javac.main.Main.Result; 50 51 import toolbox.Assert; 52 53 public class IncludeExcludePatterns extends SjavacBase { 54 55 final Path SRC = Paths.get("src"); 56 final Path BIN = Paths.get("bin"); 57 final Path STATE_DIR = Paths.get("state-dir"); 58 59 // An arbitrarily but sufficiently complicated source tree. 60 final Path A = Paths.get("pkga/A.java"); 61 final Path X1 = Paths.get("pkga/subpkg/Xx.java"); 62 final Path Y = Paths.get("pkga/subpkg/subsubpkg/Y.java"); 63 final Path B = Paths.get("pkgb/B.java"); 64 final Path C = Paths.get("pkgc/C.java"); 65 final Path X2 = Paths.get("pkgc/Xx.java"); 66 67 final Path[] ALL_PATHS = {A, X1, Y, B, C, X2}; 68 69 public static void main(String[] ignore) throws Exception { 70 new IncludeExcludePatterns().runTest(); 71 } 72 |