< prev index next >

test/jdk/tools/jpackage/share/ResourceTest.java

Print this page




  25 import java.nio.file.Files;
  26 
  27 /*
  28  * @test
  29  * @summary jpackage create image to verify --icon
  30  * @library ../helpers
  31  * @build JPackageHelper
  32  * @build JPackagePath
  33  * @requires ((os.family == "windows") | (os.family == "mac"))
  34  * @modules jdk.jpackage
  35  * @run main/othervm -Xmx512m ResourceTest
  36  */
  37 public class ResourceTest {
  38     private static final String OUTPUT = "output";
  39     private static final String app = JPackagePath.getApp("icon");
  40     private static final String appOutput = JPackagePath.getAppOutputFile();
  41     private static final String resourceDir =
  42             JPackagePath.getTestSrcRoot() + File.separator + "resources";
  43 
  44     private static final String[] CMD = {

  45         "--input", "input",
  46         "--name", "icon",
  47         "--main-jar", "hello.jar",
  48         "--main-class", "Hello",
  49         "--resource-dir", resourceDir,
  50         "--output", OUTPUT};
  51 
  52     private static void validateResult(String[] result) throws Exception {
  53         if (result.length != 2) {
  54             throw new AssertionError(
  55                    "Unexpected number of lines: " + result.length);
  56         }
  57 
  58         if (!result[0].trim().equals("jpackage test application")) {
  59             throw new AssertionError("Unexpected result[0]: " + result[0]);
  60         }
  61 
  62         if (!result[1].trim().equals("args.length: 0")) {
  63             throw new AssertionError("Unexpected result[1]: " + result[1]);
  64         }




  25 import java.nio.file.Files;
  26 
  27 /*
  28  * @test
  29  * @summary jpackage create image to verify --icon
  30  * @library ../helpers
  31  * @build JPackageHelper
  32  * @build JPackagePath
  33  * @requires ((os.family == "windows") | (os.family == "mac"))
  34  * @modules jdk.jpackage
  35  * @run main/othervm -Xmx512m ResourceTest
  36  */
  37 public class ResourceTest {
  38     private static final String OUTPUT = "output";
  39     private static final String app = JPackagePath.getApp("icon");
  40     private static final String appOutput = JPackagePath.getAppOutputFile();
  41     private static final String resourceDir =
  42             JPackagePath.getTestSrcRoot() + File.separator + "resources";
  43 
  44     private static final String[] CMD = {
  45         "--package-type", "app-image",
  46         "--input", "input",
  47         "--name", "icon",
  48         "--main-jar", "hello.jar",
  49         "--main-class", "Hello",
  50         "--resource-dir", resourceDir,
  51         "--output", OUTPUT};
  52 
  53     private static void validateResult(String[] result) throws Exception {
  54         if (result.length != 2) {
  55             throw new AssertionError(
  56                    "Unexpected number of lines: " + result.length);
  57         }
  58 
  59         if (!result[0].trim().equals("jpackage test application")) {
  60             throw new AssertionError("Unexpected result[0]: " + result[0]);
  61         }
  62 
  63         if (!result[1].trim().equals("args.length: 0")) {
  64             throw new AssertionError("Unexpected result[1]: " + result[1]);
  65         }


< prev index next >