langtools/test/tools/javac/classfiles/attributes/Module/ModuleFlagTest.java
changeset 36778 e04318f39f92
parent 36526 3b41f1c69604
equal deleted inserted replaced
36777:28d33fb9097f 36778:e04318f39f92
     1 /*
     1 /*
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2016, 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.
    28  * @library /tools/lib
    28  * @library /tools/lib
    29  * @modules jdk.compiler/com.sun.tools.javac.api
    29  * @modules jdk.compiler/com.sun.tools.javac.api
    30  *          jdk.compiler/com.sun.tools.javac.main
    30  *          jdk.compiler/com.sun.tools.javac.main
    31  *          jdk.compiler/com.sun.tools.javac.util
    31  *          jdk.compiler/com.sun.tools.javac.util
    32  *          jdk.jdeps/com.sun.tools.classfile
    32  *          jdk.jdeps/com.sun.tools.classfile
    33  *          jdk.jdeps/com.sun.tools.javap
    33  * @build toolbox.ToolBox toolbox.JavacTask toolbox.ToolBox
    34  * @build ToolBox
       
    35  * @run main ModuleFlagTest
    34  * @run main ModuleFlagTest
    36  */
    35  */
    37 
    36 
    38 import com.sun.tools.classfile.AccessFlags;
    37 import com.sun.tools.classfile.AccessFlags;
    39 import com.sun.tools.classfile.ClassFile;
    38 import com.sun.tools.classfile.ClassFile;
    41 
    40 
    42 import java.io.IOException;
    41 import java.io.IOException;
    43 import java.nio.file.Path;
    42 import java.nio.file.Path;
    44 import java.nio.file.Paths;
    43 import java.nio.file.Paths;
    45 
    44 
       
    45 import toolbox.JavacTask;
       
    46 import toolbox.ToolBox;
       
    47 
    46 public class ModuleFlagTest {
    48 public class ModuleFlagTest {
    47     public static void main(String[] args) throws IOException, ConstantPoolException {
    49     public static void main(String[] args) throws IOException, ConstantPoolException {
    48         Path outdir = Paths.get(".");
    50         Path outdir = Paths.get(".");
    49         ToolBox tb = new ToolBox();
    51         ToolBox tb = new ToolBox();
    50         final Path moduleInfo = Paths.get("module-info.java");
    52         final Path moduleInfo = Paths.get("module-info.java");
    51         tb.writeFile(moduleInfo, "module test_module{}");
    53         tb.writeFile(moduleInfo, "module test_module{}");
    52         tb.new JavacTask()
    54         new JavacTask(tb)
    53                 .outdir(outdir)
    55                 .outdir(outdir)
    54                 .files(moduleInfo)
    56                 .files(moduleInfo)
    55                 .run();
    57                 .run();
    56 
    58 
    57         AccessFlags accessFlags = ClassFile.read(outdir.resolve("module-info.class"))
    59         AccessFlags accessFlags = ClassFile.read(outdir.resolve("module-info.class"))