< prev index next >

test/jdk/tools/jlink/basic/BasicTest.java

Print this page
rev 51881 : [mq]: 8211171
rev 51882 : [mq]: 8211171-1


   8  *
   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  * @summary Basic test of jlink to create jmods and images
  27  * @author Andrei Eremeev
  28  * @library /lib/testlibrary /test/lib
  29  * @modules java.base/jdk.internal.module
  30  *          jdk.jlink
  31  *          jdk.compiler
  32  * @build jdk.test.lib.process.ProcessTools
  33  *        jdk.test.lib.process.OutputAnalyzer
  34  *        JarUtils jdk.test.lib.compiler.CompilerUtils

  35  * @run main BasicTest
  36  */
  37 
  38 import java.io.File;
  39 import java.io.PrintWriter;
  40 import java.nio.file.Files;
  41 import java.nio.file.Path;
  42 import java.nio.file.Paths;
  43 import java.util.ArrayList;
  44 import java.util.Collections;
  45 import java.util.List;
  46 import java.util.spi.ToolProvider;
  47 
  48 import jdk.test.lib.compiler.CompilerUtils;
  49 import jdk.test.lib.process.OutputAnalyzer;
  50 import jdk.test.lib.process.ProcessTools;

  51 
  52 public class BasicTest {
  53     static final ToolProvider JMOD_TOOL = ToolProvider.findFirst("jmod")
  54         .orElseThrow(() ->
  55             new RuntimeException("jmod tool not found")
  56         );
  57 
  58     static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
  59         .orElseThrow(() ->
  60             new RuntimeException("jlink tool not found")
  61         );
  62 
  63     private final String TEST_MODULE = "test";
  64     private final Path jdkHome = Paths.get(System.getProperty("test.jdk"));
  65     private final Path jdkMods = jdkHome.resolve("jmods");
  66     private final Path testSrc = Paths.get(System.getProperty("test.src"));
  67     private final Path src = testSrc.resolve("src").resolve(TEST_MODULE);
  68     private final Path classes = Paths.get("classes");
  69     private final Path jmods = Paths.get("jmods");
  70     private final Path jars = Paths.get("jars");




   8  *
   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  * @summary Basic test of jlink to create jmods and images
  27  * @author Andrei Eremeev
  28  * @library /test/lib
  29  * @modules java.base/jdk.internal.module
  30  *          jdk.jlink
  31  *          jdk.compiler
  32  * @build jdk.test.lib.process.ProcessTools
  33  *        jdk.test.lib.process.OutputAnalyzer
  34  *        jdk.test.lib.compiler.CompilerUtils
  35  *        jdk.test.lib.util.JarUtils
  36  * @run main BasicTest
  37  */
  38 
  39 import java.io.File;
  40 import java.io.PrintWriter;
  41 import java.nio.file.Files;
  42 import java.nio.file.Path;
  43 import java.nio.file.Paths;
  44 import java.util.ArrayList;
  45 import java.util.Collections;
  46 import java.util.List;
  47 import java.util.spi.ToolProvider;
  48 
  49 import jdk.test.lib.compiler.CompilerUtils;
  50 import jdk.test.lib.process.OutputAnalyzer;
  51 import jdk.test.lib.process.ProcessTools;
  52 import jdk.test.lib.util.JarUtils;
  53 
  54 public class BasicTest {
  55     static final ToolProvider JMOD_TOOL = ToolProvider.findFirst("jmod")
  56         .orElseThrow(() ->
  57             new RuntimeException("jmod tool not found")
  58         );
  59 
  60     static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
  61         .orElseThrow(() ->
  62             new RuntimeException("jlink tool not found")
  63         );
  64 
  65     private final String TEST_MODULE = "test";
  66     private final Path jdkHome = Paths.get(System.getProperty("test.jdk"));
  67     private final Path jdkMods = jdkHome.resolve("jmods");
  68     private final Path testSrc = Paths.get(System.getProperty("test.src"));
  69     private final Path src = testSrc.resolve("src").resolve(TEST_MODULE);
  70     private final Path classes = Paths.get("classes");
  71     private final Path jmods = Paths.get("jmods");
  72     private final Path jars = Paths.get("jars");


< prev index next >