< prev index next >

test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageTempRootTest.java

Print this page




  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 import java.io.File;
  25 
  26  /*
  27  * @test
  28  * @requires (os.family == "windows")
  29  * @summary jpackage create image to test --temp-root
  30  * @library ../helpers
  31  * @build JPackageHelper
  32  * @build JPackagePath
  33  * @modules jdk.jpackage
  34  * @run main/othervm -Xmx512m JPackageCreateImageTempRootTest
  35  */
  36 public class JPackageCreateImageTempRootTest {
  37     private static final String OUTPUT = "output";
  38     private static String buildRoot = null;
  39     private static final String BUILD_ROOT = "buildRoot";
  40     private static final String BUILD_ROOT_TB = "buildRootToolProvider";
  41 
  42     private static final String [] CMD = {
  43         "create-image",
  44         "--input", "input",
  45         "--output", OUTPUT,
  46         "--name", "test",
  47         "--main-jar", "hello.jar",
  48         "--main-class", "Hello",
  49         "--files", "hello.jar" };
  50 
  51     private static final String [] CMD_BUILD_ROOT = {
  52         "create-image",
  53         "--input", "input",
  54         "--output", OUTPUT,
  55         "--name", "test",
  56         "--main-jar", "hello.jar",
  57         "--main-class", "Hello",
  58         "--files", "hello.jar",
  59         "--temp-root", "TBD"};
  60 
  61     private static void validate(boolean retain) throws Exception {
  62         File br = new File(buildRoot);
  63         if (retain) {
  64             if (!br.exists()) {
  65                 throw new AssertionError(br.getAbsolutePath() + " does not exist");
  66             }
  67         } else {
  68             if (br.exists()) {
  69                 throw new AssertionError(br.getAbsolutePath() + " exist");
  70             }
  71         }
  72     }
  73 
  74     private static void init(boolean toolProvider) {
  75         if (toolProvider) {
  76             buildRoot = BUILD_ROOT_TB;
  77         } else {
  78             buildRoot = BUILD_ROOT;




  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 import java.io.File;
  25 
  26  /*
  27  * @test
  28  * @requires (os.family == "windows")
  29  * @summary jpackage create image to test --temp-root
  30  * @library ../helpers
  31  * @build JPackageHelper
  32  * @build JPackagePath
  33  * @modules jdk.jpackage
  34  * @run main/othervm -Xmx512m JPackageCreateAppImageTempRootTest
  35  */
  36 public class JPackageCreateAppImageTempRootTest {
  37     private static final String OUTPUT = "output";
  38     private static String buildRoot = null;
  39     private static final String BUILD_ROOT = "buildRoot";
  40     private static final String BUILD_ROOT_TB = "buildRootToolProvider";
  41 
  42     private static final String [] CMD = {
  43         "create-app-image",
  44         "--input", "input",
  45         "--output", OUTPUT,
  46         "--name", "test",
  47         "--main-jar", "hello.jar",
  48         "--main-class", "Hello",
  49     };
  50 
  51     private static final String [] CMD_BUILD_ROOT = {
  52         "create-app-image",
  53         "--input", "input",
  54         "--output", OUTPUT,
  55         "--name", "test",
  56         "--main-jar", "hello.jar",
  57         "--main-class", "Hello",

  58         "--temp-root", "TBD"};
  59 
  60     private static void validate(boolean retain) throws Exception {
  61         File br = new File(buildRoot);
  62         if (retain) {
  63             if (!br.exists()) {
  64                 throw new AssertionError(br.getAbsolutePath() + " does not exist");
  65             }
  66         } else {
  67             if (br.exists()) {
  68                 throw new AssertionError(br.getAbsolutePath() + " exist");
  69             }
  70         }
  71     }
  72 
  73     private static void init(boolean toolProvider) {
  74         if (toolProvider) {
  75             buildRoot = BUILD_ROOT_TB;
  76         } else {
  77             buildRoot = BUILD_ROOT;


< prev index next >