< prev index next >

test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java

Print this page
rev 17315 : 8181335: remove packageless CompilerUtils
Reviewed-by: duke


  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 import java.io.File;
  25 import java.io.IOException;
  26 import java.nio.file.Files;
  27 import java.nio.file.Path;
  28 import java.nio.file.Paths;
  29 import java.util.Arrays;
  30 import java.util.Set;
  31 import java.util.spi.ToolProvider;
  32 import java.util.stream.Collectors;
  33 import java.util.stream.Stream;
  34 

  35 import jdk.test.lib.util.FileUtils;
  36 
  37 import static jdk.testlibrary.ProcessTools.*;
  38 
  39 import org.testng.annotations.BeforeTest;
  40 import org.testng.annotations.Test;
  41 import static org.testng.Assert.*;
  42 
  43 /**
  44  * @test
  45  * @bug 8142968 8173381 8174740
  46  * @library /lib/testlibrary /test/lib
  47  * @modules jdk.compiler jdk.jlink
  48  * @modules java.base/jdk.internal.module
  49  * @modules java.base/jdk.internal.org.objectweb.asm
  50  * @build ModuleTargetHelper UserModuleTest CompilerUtils jdk.testlibrary.ProcessTools
  51  * @run testng UserModuleTest
  52  */
  53 
  54 public class UserModuleTest {
  55     private static final String JAVA_HOME = System.getProperty("java.home");
  56     private static final String TEST_SRC = System.getProperty("test.src");
  57 
  58     private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
  59     private static final Path MODS_DIR = Paths.get("mods");
  60     private static final Path JMODS_DIR = Paths.get("jmods");
  61 
  62     private static final Path IMAGE = Paths.get("image");
  63     private static final String MAIN_MID = "m1/p1.Main";
  64 
  65     // the names of the modules in this test
  66     private static String[] modules = new String[] {"m1", "m2", "m3", "m4", "m5"};
  67 
  68 
  69     private static boolean hasJmods() {
  70         if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) {




  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 import java.io.File;
  25 import java.io.IOException;
  26 import java.nio.file.Files;
  27 import java.nio.file.Path;
  28 import java.nio.file.Paths;
  29 import java.util.Arrays;
  30 import java.util.Set;
  31 import java.util.spi.ToolProvider;
  32 import java.util.stream.Collectors;
  33 import java.util.stream.Stream;
  34 
  35 import jdk.test.lib.compiler.CompilerUtils;
  36 import jdk.test.lib.util.FileUtils;
  37 
  38 import static jdk.testlibrary.ProcessTools.*;
  39 
  40 import org.testng.annotations.BeforeTest;
  41 import org.testng.annotations.Test;
  42 import static org.testng.Assert.*;
  43 
  44 /**
  45  * @test
  46  * @bug 8142968 8173381 8174740
  47  * @library /lib/testlibrary /test/lib
  48  * @modules jdk.compiler jdk.jlink
  49  * @modules java.base/jdk.internal.module
  50  * @modules java.base/jdk.internal.org.objectweb.asm
  51  * @build ModuleTargetHelper UserModuleTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.ProcessTools
  52  * @run testng UserModuleTest
  53  */
  54 
  55 public class UserModuleTest {
  56     private static final String JAVA_HOME = System.getProperty("java.home");
  57     private static final String TEST_SRC = System.getProperty("test.src");
  58 
  59     private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
  60     private static final Path MODS_DIR = Paths.get("mods");
  61     private static final Path JMODS_DIR = Paths.get("jmods");
  62 
  63     private static final Path IMAGE = Paths.get("image");
  64     private static final String MAIN_MID = "m1/p1.Main";
  65 
  66     // the names of the modules in this test
  67     private static String[] modules = new String[] {"m1", "m2", "m3", "m4", "m5"};
  68 
  69 
  70     private static boolean hasJmods() {
  71         if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) {


< prev index next >